Results 1 to 6 of 6

Thread: One cl_context includes devices from different cl_platforms?

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Posts
    6

    One cl_context includes devices from different cl_platforms?

    Assuming I have a OpenCL driver / environment in which the function clGetPlatformIDs() returns more than one cl_platform_id:

    Is it possible to create a create a context including devices from different platforms?

    I tried to find an answer in the OpenCL specifications but didn't found any definitive answer. There are some passage in section 4.3 which makes me think it is not possible but I'd like to be sure on this one.

  2. #2
    Senior Member
    Join Date
    Sep 2002
    Location
    Santa Clara
    Posts
    105

    Re: One cl_context includes devices from different cl_platforms?

    The devices specified in <devices> argument to clCreateContext must be for the same platform. clCreateContext returns CL_INVALID_DEVICE if devices contains an invalid device or are not associated with the specified platform.

  3. #3
    Junior Member
    Join Date
    Jun 2009
    Posts
    6

    Re: One cl_context includes devices from different cl_platforms?

    thank you!

    now that i now of this, it is finally clear to me that the sentence
    "devices is a pointer to a list of unique devices returned by clGetDeviceIDs for a platform."
    implies this behaviour.

    Perhaps it might be a good idea to clarify this point in the OpenCL spec? Something similar to this would have helped me a lot:

    "devices is a pointer to a list of unique devices returned by clGetDeviceIDs for a specific platform. Therefor, it is not possible to mix devices from different platforms into one context."


    edit:
    after reading your answer again it is also clear to me that the sentence
    "CL_INVALID_DEVICE if devices contains an invalid device or are not associated with the
    specified platform."
    also describes this behaviour. Nevertheless, I think an additional sentence like the above might clarify the situation.

  4. #4
    Junior Member
    Join Date
    Aug 2010
    Posts
    5

    Re: One cl_context includes devices from different cl_platfo

    Is the restriction of not allowing a single context to include different platforms a design choice or a technical limitation?

    Will OpenCL ever be able to support that feature (a context of different platforms)?

  5. #5
    Senior Member
    Join Date
    Mar 2011
    Location
    Seoul
    Posts
    118

    Re: One cl_context includes devices from different cl_platfo

    In my opinion the restriction is due to vendors having little or no apparent financial incentive to implement that level of interoperability relative to the support it would require. Efficiently managing buffers across platforms and including a compiler optimized for each device requires knowing all the hardware platforms and devices.

    The closest thing available to what you seem to want is the IBM OpenCL Common Runtime for Linux, which is a platform wrapper. It hasn't been updated in awhile and only supports OpenCL 1.1 vendor platforms (and/or devices, I can't recall exactly).

  6. #6
    Junior Member
    Join Date
    Aug 2010
    Posts
    5

    Re: One cl_context includes devices from different cl_platfo

    Thank you Sean for the explanation.

Similar Threads

  1. Problem creating cl_context
    By tomma82 in forum OpenCL
    Replies: 1
    Last Post: 11-26-2010, 05:44 AM
  2. Why is 'cl_mem' associated to 'cl_context'?
    By tanakamura in forum OpenCL
    Replies: 2
    Last Post: 09-16-2009, 03:29 AM

Posting Permissions

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