terminate kernel execution for a thread Is there something like break from loops or clip from HLSL?

In some Kernels I would like to terminate the execution of the kernel in the current thread.

In HLSL there was a function clip() which ended the execution of the “shader” at that point for the given pixel.

of cause it can be done like:

if(condition)

[indent]something()[/indent]

I search for something like:

if(!condition)

[indent]exit()[/indent]

something();

Would be pretty useful.

Assuming you mean for threads in your kernel, you could just have them return if they meet the condition, and any other threads that didn’t meet the condition would continue their execution

if(condition){

  //threads that meet the condition exit

  return;

}

//threads that didnt meet the condition continue execution

something...

Hope I understood your question correctly

oh that was easy :D, thanks