In my application, a parent kernel generates many child kernels using dynamic parallelism, some running for a long time. Inside a child kernel, I insert a trap instruction like the following when some goal is achieved, hoping that only that child kernel is killed.
if(goalAchieved == true)
I found if asm(“trap”) is executed, the subsequent child kernels cannot execute correctly.
Is there a way to elegantly kill child kernels?