Results 1 to 2 of 2

Thread: typedefs (cl_int etc) for mulitple platforms

  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    12

    typedefs (cl_int etc) for mulitple platforms

    Hi,

    Consider multiple platforms on the same system, e.g. Intel OpenCL SDK for targeting an Intel CPU, and Nvidia SDK for targeting an Nvidia GPU. Both platforms / devices shall be targeted in the same application.

    #including cl.h gives me access to typedefs such as cl_int, cl_double etc.
    Obviously however I can only #include cl.h of a single platform. But I don't see any guarantee that say cl_int of the Intel SDK map to the same host application type as cl_int of the Nvidia SDK.
    My question is: Am I correct that in general there can be little done about that? Is there any technical way to get the guarantee that host code types match to all device code types correctly (without storing the host data individually for each platform of course)?
    If there is no such solution (which I do suppose...), or if it is very expensive, is there some more or less straightforward way to make at least a compiletime / runtime check that host application types are identical for all platforms and host data can be distributed to any platform-device?

    thanks!

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

    Re: typedefs (cl_int etc) for mulitple platforms

    Is there any technical way to get the guarantee that host code types match to all device code types correctly (without storing the host data individually for each platform of course)?
    Type cl_int on the host is guaranteed to match type "int" on the device. This is true for other types as well with the notable exception of bool and size_t. See section 6.1.1. in the OpenCL 1.2. specification for details.
    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. OpenCL On Multiple Platforms
    By homemade-jam in forum OpenCL
    Replies: 2
    Last Post: 03-03-2012, 10:14 AM
  2. Provide typedefs for OpenCL functions
    By ebfe in forum Suggestions for next release
    Replies: 0
    Last Post: 02-24-2010, 02:01 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
  •