Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCL with c++ wrapper - how to convert cl::CommandQueue to cl_command_queue?

Tags:

c++

opencl

I am using OpenCL with the CL/cl.hpp c++ wrappers. So I have c++ objects such as e.g. cl::CommandQueue instead of cl_command_queue.

I am also wanting to use AMD's BLAS library, clAmdBlas. The functions there require a cl_command_queue as one of their arguments.

How do I get cl_command_queue from cl::CommandQueue?

like image 715
osbert Avatar asked Jan 11 '23 14:01

osbert


1 Answers

To get the cl_command_queue object, you simply need to use the () operator:

cl::CommandQueue cppQueue;
...
cl_command_queue queue = cppQueue();

The same goes for all of the other C++ objects in this header that are wrapping OpenCL runtime objects.

like image 136
jprice Avatar answered Jan 25 '23 04:01

jprice