'WIll Opencl still run on AMD gpu, if I were to write a program with OpenCL from Nvidia Vendor?
So I downloaded OpenCL from Nvidia vendor, and I wrote a program. So I was wondering can my program still run on AMD GPU or I need to install AMD version of OpenCL?
Solution 1:[1]
In short: Yes, programs developed with the OpenCL headers from Nvidia toolkit will also work on AMD and Intel GPUs. Programs for Nvidia GPUs are always in OpenCL C 1.2, and AMD/Intel GPUs support OpenCL C 1.2/2.0/2.1/2.2, which always is backwards-compatible with OpenCL C 1.2.
However there are some rare issues that you could encounter, based on differences in the hardware.
One example: Nvidia GPUs work with "warps" of 32 threads, so if you choose the workgroup size 32 or a multiple of 32, you will fully use the hardware. AMD GCN GPUs need at least workgroup size 64 or a multiple of 64 to fully use the hardware. With only workgroup size 32 you only get half the arithmetic performance.
Another example: For Nvidia GPUs, you can have quite large tables still in private memory, and if it is too much you get a spilling into global memory (makes it very slow, but still works without error). Some AMD GPUs can't fit so many private variables and will throw an error during compiling, so you'd have to move the table in constant memory (this then works with both AMD and Nvidia).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
