6 Replies Latest reply on Apr 26, 2011 7:20 AM by nou

    Device <-> cl_device_id

    Raistmer
      How to get device pointer (of type cl_device_id ) for given object of class Device?
      I need to know if particular Device is the same as particular cl_device_id object or not.

      Device constructor saves cl_device_id device in _object member - is it possible to read this member?
        • Device <-> cl_device_id
          himanshu.gautam

          Can you explain what you want to do.

          I don't think there would be any way to access a private class member without a member function.

          • Device <-> cl_device_id
            Raistmer
            yes, it can be patched, and private member can be accessed... but I though there is some "proper" way to get it.
            IMHO to be useful any wrapper including this one should provide access to original object it wraps. I need to know what Device object belongs to what GPU device in heterogeneous host (NV/ATi platforms mixed).
            Cause rest of code uses cl_device_id based device descriptor (to select appropriate device) and enumerating part of code uses CLinfo(i.e. Device) based device descriptor I need way to compare they for equality.
            Now I think it's better to re-write device quering in "plain OpenCL" and forget AMD OpenCL-C++ attempt as too incomplete to be useful... It will be better than hacking private class members....