Niklas Peter
Niklas Peter

Reputation: 1856

How does OpenCL work without ICD loader extension?

AFAIK it works like this with ICD loader extension:

As the ICD loader is just an optional OpenCL extension, I wonder how OpenCL works without the ICD loader. Of course, in this case you can not use multiple vendors' implementations in the same application at the same time, but what is used for linking the application? If the developer linked it against a specific implementation, then the main goal of OpenCL, portability, could not be reached anymore.

Or do the vendors have to provide dynamic libraries, that are compatible to each other? That means, if the developer linked to the dynamic library of vendor A, at runtime it would also work, if the target system has the dynamic library of vendor B installed?

Is that anywhere documented?

Upvotes: 7

Views: 1814

Answers (2)

Blacklight MG
Blacklight MG

Reputation: 106

A program is not built against a vendor OpenCL implementation. It is build against OpenCL itself, and the vendor OpenCL is the OpenCL implementation for the end user's processor.

So the specific implementation is for the end user, and multiple implementations are for when the user wants to use any of the multiple OpenCL capable processors. It's about the end-user preferences.

Upvotes: 0

Dithermaster
Dithermaster

Reputation: 6343

For Windows OpenCL applications, your application includes OpenCL.h (or cl.h) and links to OpenCL.lib, which is a static library wrapper for OpenCL.dll which resides in the Windows System32 folder. You don't know if it is an ICD or a vendor driver. For the past many years it has been an ICD, but before that (for very early OpenCL implementations) it was a vendor driver. The beauty of the ICD is that the application does not need to know, you just call the OpenCL API. Only when it is an ICD will the number of platforms be greater than 1.

Upvotes: 1

Related Questions