Aborting long-time kernel, how?

Discussion created by bubu on Feb 2, 2011
Latest reply on Feb 5, 2011 by laobrasuca

Imagine I execute a very time-consuming kernel using clEnqueueRangeND().

How can I stop it if the user presses a button?


I'm currently trying to abort it as:


cl_event l_evt;

clEnqueueRangeND( .... &l_evt );


void OnCancelButtonClick()


    if ( l_evt!=NULL )


       clReleaseEvent ( l_evt );





the question is... will that clReleaseEvent(l_evt)+clFinish() abort the kernel execution in a resonable time really?

ps: Before you suggest it... i CANNOT make the kernel simpler+use multiple kernel calls. Assume a BIG time-consuming kernel, pls. That's the whole point of the thread.