I want to start learning how to program in CUDA, not just the language, but program-design -- things like -- from what I've heard -- writing kernels without conditionals so that all the threads run the same instructions and there's minimal synchronization overhead.
And from what I've heard, the python wrapper is a lot more intuitive to use and code with than the C library.
So assuming that the languages I already know/don't know aren't a barrier, which language is it best to start learning CUDA in?
Which one gives you the best idea of the DO's and DONTs in CUDA and the easiest learning curve?
To get started programming with CUDA, download and install the CUDA Toolkit and developer driver. The toolkit includes nvcc , the NVIDIA CUDA Compiler, and other software necessary to develop CUDA applications. The driver ensures that GPU programs run correctly on CUDA-capable hardware, which you'll also need.
CUDA C is essentially C/C++ with a few extensions that allow one to execute functions on the GPU using many threads in parallel.
To follow along, you'll need a computer with an CUDA-capable GPU (Windows, Mac, or Linux, and any NVIDIA GPU should do), or a cloud instance with GPUs (AWS, Azure, IBM SoftLayer, and other cloud service providers have them). You'll also need the free CUDA Toolkit installed.
Given that languages aren't a barrier, I would say that sticking to C/C++ would leave more resources available to help you. There are more potential pitfalls but if you take a look in the CUDA Best Practices Guide (provided with the CUDA toolkit on the NVIDIA website) then you'll be on the right track.
You could also consider looking at the open-source project "Thrust" which is a STL/Boost style template library built on top of CUDA C++. It works well in many cases and you can just call more complex kernels as you learn more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With