Cuda Streams Can you call a stream interrupt from CPU?

Hi again,

imagine an application using three streams A, B, C . Suppose we want them to run in the sequence : 1.A 2.B 3.C . We want to make sure that A always executes to its end and it is the highest priority stream. B and C should only finish their execution if a certain condition applies. If the condition fails, we want to stop their execution and switch to Stream A.

Can we pass a variable to a cuda stream from the CPU and cause the stream to exit?

something along the lines :

static bool interrupt = false; //initially

kernel_of_Stream_A(){

if (!interrupt){

…kernel executes
}

}

Any help apreciated,

Cheers,
Than