Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCL vs. DirectCompute?

Tags:

I'm looking for comparisons between OpenCL and DirectCompute, but I haven't found anything. OpenCL's advantages of being cross-platform and having a wider range of supported GPUs don't matter to me. I'm fine with coding on Windows against DX11 GPUs only. Assuming that, what are the pros and cons of each API?

I know this question was raised before, but I'm looking for more details.

I'm not interested in CUDA, since I don't want to restrict myself to only Nvidia hardware.

like image 343
royco Avatar asked Jul 03 '10 17:07

royco


People also ask

Which one is better CUDA or OpenCL?

Generally if the app of your choice supports both CUDA and OpenCL, going with CUDA is the best option as it generates better performance results in this scenario. This is because NVIDIA provides top quality support.

Is CUDA faster than OpenCL?

A study that directly compared CUDA programs with OpenCL on NVIDIA GPUs showed that CUDA was 30% faster than OpenCL.

Is OpenCL GPU or CPU?

CUDA and OpenCL offer two different interfaces for programming GPUs. OpenCL is an open standard that can be used to program CPUs, GPUs, and other devices from different vendors, while CUDA is specific to NVIDIA GPUs.

Do Nvidia cards support OpenCL?

In addition to OpenCL, NVIDIA supports a variety of GPU-accelerated libraries and high-level programming solutions that enable developers to get started quickly with GPU Computing. OpenCL is a trademark of Apple Inc., used under license by Khronos.


2 Answers

Probably the biggest difference for a coder is that DirectCompute is programmed by a language which is similar to HLSL, and OpenCL is programmed via a C-like language.

Another difference to consider is that, generally, for commodity level GPUs, the DirectX support is better (faster and less buggy) than OpenGL support on Windows. This may translate to more stable support for DirectCompute, but really, this is just speculation.

like image 74
codekaizen Avatar answered Sep 19 '22 09:09

codekaizen


Well the major advantage of OpenCL is that it is not just limited to graphics cards. You can make use of your multicore CPU, Graphics Card and potentially any number of other hardware acceleration devices (DSPs etc) all from the same program.

I'm not sure if DirectCompute allows that freedom.

like image 35
Cromulent Avatar answered Sep 19 '22 09:09

Cromulent