Terminating threads early

Hi,
Is there an equivalent to discard in Cuda?
Thanks again Danny

Just return.

Careful: you may not return if you want to do a sync afterwards.

Peter

can I return if the condition statement is “if(blockId…”? since this will cause a same return/continue for all threads in the block, the sync afterwards won’t be dead. Thanks!

Yes. Doesn’t need to be blockIdx, just make sure that all threads take the path.

Peter