cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

notooth
Journeyman III

Execute a kernel from OpenCL platform?

Hi everyone,

I am looking for a way to execute a kernel from OpenCL platform, just like clEnqueueNDRangeKernel command from host side. Please help.

0 Likes
3 Replies
nou
Exemplar

you mean execute another kernel within kernel? that is not currently possible. you can only call kernel instaide another kernel when it behaves as normal function.

0 Likes
himanshu_gautam
Grandmaster

What nou is saying is correct.

Please refer  section 6.7.1 in OpenCL spec.

I am pasting it for your convenience.

 

The __kernel (or kernel) qualifier declares a function to be a kernel that can be executed by an application on an OpenCL device(s). The following rules apply to functions that are declared with this qualifier:

 

It can be executed on the device only

It can be called by the host

It is just a regular function call if a __kernel function is called by another kernel function.

0 Likes
notooth
Journeyman III

So, I can only call another kernel with just 1 work-tem, unlike clEnqueueNDRangeKernel command with multi work-items running parallely. Hope the next version of OpenCL work that out.

0 Likes