Hello,
I’m working on an open-source project that will use OpenCL. My goal would be that the user can just download the .exe and the opencl.dll will be supplied by the graphics driver. Or they can compile the application from source.
But that requires opencl.lib and CL header files. These files are atleast according to my understanding distributed by vendor SDKs.
Are those SDKs really needed? Because CL header files can be downloaded from Khronos and I have found a thing called ICD loader, also from Khronos, that generates both .lib and .dll files.
Can I use this library instead of a SDK? I mean I got it working, but should I do it this way? My project would link against the .lib library from ICD but runtime would use .dll supplied by graphics driver?
And what files can I distribute exactly, because licenses seem prety relaxed expect in ICD loader’s there is a following paragraph that I do not fully understand:
If the binary is used as part of an OpenCL™ implementation, whether binary
is distributed together with or separately to that implementation, then
recipient must become an OpenCL Adopter and follow the published OpenCL
conformance process for that implementation, details at: url that I cannot post on this forum;
What does the term implementation mean? I do not mean to ‘implement’ OpenCL, merely use it. Is this relevant only for vendors that want to implement better versions of .lib/.dll library for their SDKs? Because I do not plan on to distributing .lib nor .dll files. My project would contain my source files, CL headers, ICD loader sources and CMake files to build it together into working application.
I do not plan on using any vendor-specific functions, just standard OpenCL 1.2, so is driver’s .dll superset/compatible with ICD .lib? I would also like that my project be multi-platform which is another reason I do not want any SDKs. And last question, is there version of ICD that targets OpenCL 1.2? Because I had to supply CL 2.2 headers for it to compile and I don’t plan on using those new functions. Or does it matter?
Could somebody please help me answer my questions?
OpenCL.lib is the same for every OpenCL vendor. It is a simple library that searches for actual OpenCL dlls. You don’t need to provide anything but your app binary. Also, OpenCL 2.2 is backwards compatible with older versions, so it’s fine.