The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

How OpenCL chooses which vendor's library to link @ runtime?

I am a little naive with how this works, I was hoping to get some clarification here.

Say I have a PC with an intel CPU and an AMD GPU. From what I understand, there will be implementations of the OpenCL standard provided by both Intel and AMD.

In my OpenCL program, I should see two separate platforms, one platform has the Intel device, the second platform has the AMD device.

I go on to write code to utilize both devices, compile program, etc...

I typically code on a Linux platform, and understand how to write a Makefile which gives the right include paths and link directories. I would like to know specifically, when I execute my program, how does it know which OpenCL libraries to link with? What is the process it uses to find these libraries?

Re: How OpenCL chooses which vendor's library to link @ runt

The point is, you never directly link against the vendor implementation of the OpenCL functions. You link against some libOpenCL.so that fills out function pointer tables to the actual implementations at run-time and forwards the calls depending on which context you created. You can read about the so-called ICD mechanism here.