@Jaap....,
A related question. I want to use my software on different OpenCL platforms like AMD, NVIDIA and Intel. My host code can only link with one version of OpenCL.lib. Do you expect problems linking with AMD's OpenCL.lib and executing NVIDIA or Intel OpenCL platform? |
This is where ICD come to play.
Just think how "clGetPlatformIds" will work, if there are multiple platforms?
Although you link with AMD's opencl Lib -- the ICD will make sure that it detects all other platforms involved and will route your API calls correctly.
On Linux, I know for a fact that OpenCL drivers register themselves at /etc/OpenCL/vendors/
The ICD files present there are just plain text files that contain the name of the shared-library that implements the platform (icd)'s runt-ime. These files can be read at run-time, platform DLLs located and opened and queried.
On windows - Registry values @ HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors hold DLL file names that implement the platform
Note that OpenCl extension provides APIs to provide function addresses of a platform (clGetExtensionFunctionAddress)
You can check OpenCL extensions PDF for more details.
Hope this helps,