Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simplest CUDA Wrapper for Beginners

Tags:

cuda

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?

like image 657
Vanwaril Avatar asked Jan 09 '10 12:01

Vanwaril


People also ask

How do I get started with CUDA programming?

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.

Is Cuda C or C++?

CUDA C is essentially C/C++ with a few extensions that allow one to execute functions on the GPU using many threads in parallel.

What do you need for Cuda?

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.


1 Answers

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.

like image 85
Tom Avatar answered Nov 02 '22 20:11

Tom