Is there any example of using clEnqueueNativeKernel in OpenCL? In this way one can write a kernel in a c or c++ language. Do other commands remain unchanged?
Is there any example of using clEnqueueNativeKernel in OpenCL? In this way one can
Share
Native C++ “kernels” are essentially just functions that you want to execute within command queue to preserve order of commands.
AFAIK they are not supported on GPU. If you want to execute C++ functions across all devices, you should consider to use cl_event callbacks (when status == CL_COMPLETE).
Assume you have a buffer object you want to read from device and pass to your C++ function. Also you want to pass some integer value as well
(I use C++ OpenCL wrapper):