Sign in to follow this  

About OpenCL, CUDA and shaders

This topic is 1560 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Not a long time ago I read article about OpenCL. The article said, OpenCL is different from CUDA in independent of the hardware ability. OpenCL is independent of the hardware side, and CUDA is depends of the hardware? Hah, It's crazy thought. No of course! Am I right? And I believe that OpenCL/CUDA use for a NO graphical compute, but  shaders use for a graphical compute. Am I right? Please, will advice. What use CUDA/OpenCL? What are their differences?

Share this post


Link to post
Share on other sites

AFAIK, CUDA was something cooked up by NVIDIA specifically to do GPU programming for their hardware. OpenCL is Khronos Group's implementation of a hardware independent GPU programming library, so that you can write it once and port it to all graphics cards (in theory), kinda like OpenGL does for graphics. 

Share this post


Link to post
Share on other sites

AFAIK, CUDA was something cooked up by NVIDIA specifically to do GPU programming for their hardware. OpenCL is Khronos Group's implementation of a hardware independent GPU programming library, so that you can write it once and port it to all graphics cards (in theory), kinda like OpenGL does for graphics. 

 

Correction: OpenCL is a specification, and vendors design hardware and implement their drivers to conform to the specification. CUDA is not the same, since it is available from only one vendor it is just a GPGPU API very similar to OpenCL. In fact, the NVIDIA driver used to implement OpenCL by translating it to CUDA behind the scenes, though nowadays they have just stopped supporting later versions of OpenCL iirc. It makes better use of NVIDIA hardware by virtue of being designed specifically for it.

 

OpenCL and CUDA can both do graphics-related tasks, they both have a concept of textures and can use the sampling units, and can interoperate (to some extent) with OpenGL and DirectX resources. Whether it is worth using them in your application is up to you to decide. Note some graphics API's already provide their own tightly-coupled "compute languages", e.g. DirectX's compute shaders with HLSL which are easier to manage if you are already using DirectX to start off with. But people have written raytracers in CUDA and OpenCL, so it's completely possible.

Share this post


Link to post
Share on other sites
Sign in to follow this