cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

spectral
Adept II

How to retreive the cl_device_id from cl::Device to cl_device_id

I use different OpenCL API, the first on use cl::Device, cl::Platform, cl::Context, cl::Queue and the other library use cl_device_id, cl_context, cl_command_queue, cl_platform_id.

And I would like to retreive all the corresponding information for cl::Device etc... to convert them into cl_device_id (...).

 

It is possible ? How ?

 

Thanks

0 Likes
2 Replies
spectral
Adept II

I have try this :

cl_platform_id pid = (cl_platform_id)platform;

But I got the following error message :

error C2440: 'type cast' : cannot convert from 'cl::Platform' to 'cl_platform_id'

(It sounds that using operators works for device, queue...)


0 Likes

use operator()

So something like this

  cl::Device device;
  cl_device_id dev = device();

0 Likes