I am a beginner in OpenCL programming. My PC has windows 8.1 with both intel graphics and AMD Radeon 7670. When I searched to download an OpenCL SDK and sample helloworld programs, I found that there are separate SDKs and programs in entirely different formats available. I have to use C not C++. Can anyone suggest which SDK I should install? Please help.
2 Answers
At the lowest level, the various OpenCL SDKs are the same; they all include cl.h from the Khronos website. Once you've included that header you can write to the OpenCL API, and then you need to link to OpenCL.lib, which is also supplied in the SDK. At runtime, your application will load the OpenCL.dll that your GPU vendor has installed in /Windows/System32.
Alternatively, you can include cl.hpp and use the C++ wrapper, but since you said you're a C programmer, and because most of the books use the C API, stick with cl.h. I think this might account for the "programs in entirely different formats" observation you made which is why I bring it up here.
The benefit of one SDK over another typically is for profiling and debugging. The AMD SDK, for example, includes APP Profiler (or now CodeXL) which will help you figure out how to make your kernels faster. NVIDIA supplies Parallel Nsight for the same purpose, and Intel also has performance tools.
So you might choose your SDK based on the hardware in your machine, but understand that once you've coded to the OpenCL API, your application can run on other GPUs from other vendors -- that is the benefit of OpenCL. You should even be able to get samples from one vendor to execute on hardware from another.
One thing to be careful of is versions: If you code to an OpenCL 1.2 SDK you might not run on OpenCL 1.1 hardware.

- 6,223
- 1
- 12
- 20
-
Nice summary but another important fact to point out is that the AMD platform also recognizes the CPU as an OpenCL device, in addition to any GPUs, while the Nvidia platform only recognizes GPUs. – Bruce Dean Mar 13 '14 at 03:37
-
I would also add that Nvidia's Parallel Nsight and profiling tools do not work with OpenCL, only CUDA, but that is not important for the OP since only an AMD GPU and Intel CPU are being used. – chippies Mar 13 '14 at 19:41
-
@roybatty, good point. The Intel OpenCL runtime also exposes the CPU as a device. Any and all of these platforms can be installed and usable at the same time. – Dithermaster Mar 14 '14 at 00:50
-
@chippies, my version of Parallel Nsight works with OpenCL for timeline event tracing but it might be older. It would be a pity if they removed support in newer versions. – Dithermaster Mar 14 '14 at 00:53
-
@Dithermaster the last version that worked for me for OpenCL was the visual profiler in version 4.1 or 4.2 of the CUDA toolkit. It wasn't very stable though. – chippies Mar 14 '14 at 08:55
-
Something else to consider is that, ideally, the examples in each SDK should show how to optimise for the hardware that SDK is designed for. This should include demonstrating extensions that are specific to that vendor's hardware. Therefore, you should download every vendor's SDK to learn the tricks that apply for each type of hardware. – chippies Mar 15 '14 at 20:53
For me the best thing with OpenCL is that you do not need an SDK at all because it abstracts different Vendor implementations behind a common Interface (see Answer in this Thread: Do I really need an OpenCL SDK?).