Results 1 to 3 of 3

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

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    4

    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?

  2. #2

    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.

  3. #3
    Junior Member
    Join Date
    Feb 2013
    Posts
    4

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

    This is exactly what I was looking for, thanks!

Similar Threads

  1. Link to compiled library
    By tomd in forum OpenCL
    Replies: 1
    Last Post: 09-09-2012, 04:03 PM
  2. How to get the OpenGL ES link-library?
    By in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 07-14-2004, 02:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •