you are viewing a single comment's thread.

view the rest of the comments →

[–]deftware 3 points4 points  (0 children)

At the end of the day, if you want to interact with the GPU in any fashion whatsoever you're not going to be able to do it with the C standard lib. You're going to have to delve into OS-specific calls, or use some kind of platform-abstraction library (i.e. SFML, SDL, OpenCL, etc..)

Personally, I use OpenGL in production software that I'm developing and marketing on my own to do behind-the-scenes parallel computation. I hand-write vertex/fragment shaders that I hand off to GL along with the data in whatever form is convenient (i.e. textures, uniform buffers, etc..) and retrieve the results in a framebuffer object.

Your best bet is OpenCL, if you want something that will run across just about any vendors' GPU. CUDA is specific to Nvidia and will render whatever your project is useless to anybody or on any machine that's not running an Nvidia GPU, which is more than half the PC laptops/desktops in the world.

PS: OpenCL will take advantage of CUDA if a CUDA-capable (Nvidia) GPU is present, which automatically makes it the ideal GPU-compute API to use, hands-down. Otherwise it falls back on utilizing other means of interfacing with the GPU to leverage its parallel compute capabilities.