Hacker News new | ask | show | jobs
by Everlag 3071 days ago
From the perspective of a CUDA beginner, this doesn't seem simpler than writing CUDA with C(not C++, just C). If you're going to pick up CUDA, starting with C means you get the best tooling support and community docs. Not to mention that managing pointers and explicit types in C will genuinely help your understanding of how CPU-GPU works.

If you already know Clojure, this is probably the best chance to extend something you already love using. If you don't, you're probably better off learning either CUDA or Clojure rather than both at the same time. Debugging CUDA errors are already painful, I wouldn't add a new host language on top of that.

For context, I'm currently taking my school's GPGPU course. We've just started actually writing non-trivial code.

4 comments

The development feedback loop is incredibly tight when using a clojure (or lisp in general) repl. The interactivity lets you interactively develop your code, including ( it appears) the C/cuda code since you can call out to compile it at the repl and then upload it to the GPU for execution.
Note the word Interactive. That's not something you'll get in the plain C tutorial.
you should give it a shot, interactively working with stuff is an excellent learning experience; my 11 year old daughter is having a great time, she might be a bit stunned if i said "here now you have to do it like this in C"
CUDA is C++, and benefits greatly from templates as they let you optimize work per thread. Many years ago I tried to add GPU support to a C code and was surprised to learn the flag that did C compilation didn't work!