Results 1 to 4 of 4

Thread: Multi Platform Contexts

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    7

    Multi Platform Contexts

    Hi,
    Is it supported to make a single context over a multiple cl_device_ids which in turn span multiple cl_platform_ids?

    When I try under Windows, it fails with either an access violation or CL_INVALID_DEVICE, depending on which cl_device_ids I include in the call to clCreateContext.
    I've tried calling clCreateContext with NULL for properties, {CL_CONTEXT_PLATFORM, NULL, 0} and the properties array having one CL_CONTEXT_PLATFORM entry for each cl_platform_id

    I get the following platforms/devices returned by clGetPlatformIDs/clGetDeviceIDs on my PC:

    Intel
    CPU - OpenCL 1.1
    nvidia
    GPU - OpenCL 1.0
    AMD
    GPU - OpenCL 1.1
    CPU - OpenCL 1.1

    For a bonus question, how do I determine at runtime that two cl_device_ids relate to the same physical hardware. In the above list Intel/CPU and AMD/CPU appear as two distinct cl_device_ids but in reality share the same hardware. The only way I could think of was to limit my application to a single CL_DEVICE_TYPE_CPU device and hope that a given platform scaled across all cores of the CPU.

    [I looking to run OpenCL across customer hardware over which I have no knowledge, other than that it runs Windows. Therefore all discovery / decisions have to be made at runtime]

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Multi Platform Contexts

    Is it supported to make a single context over a multiple cl_device_ids which in turn span multiple cl_platform_ids?
    No, it's not supported. That's actually why we have different platforms.

    For a bonus question, how do I determine at runtime that two cl_device_ids relate to the same physical hardware. In the above list Intel/CPU and AMD/CPU appear as two distinct cl_device_ids but in reality share the same hardware.
    I don't think there's a way to do that, unfortunately. If I was writing an application I would use the heuristic that the CPU will always be the same physical device in all platforms.

    The only way I could think of was to limit my application to a single CL_DEVICE_TYPE_CPU device and hope that a given platform scaled across all cores of the CPU.
    Yes, it will scale to all physical cores.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3

    Re: Multi Platform Contexts

    Is it supported to make a single context over a multiple cl_device_ids which in turn span multiple cl_platform_ids?
    I know you're seeking a Windows solution, but there is something like this for Linux: http://www.alphaworks.ibm.com/tech/ocr

  4. #4
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Multi Platform Contexts

    Hey Brian,

    Thanks for posting that link! I had no idea such middleware already existed.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. Replies: 3
    Last Post: 01-05-2011, 09:45 AM
  2. One device, many contexts
    By Amnon in forum OpenCL
    Replies: 4
    Last Post: 11-29-2010, 02:12 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
  •