Hello everyone!
My code works unstable, what is wrong with it:
for(int i=0;i<numIter;i++){
//
status = clEnqueueNDRangeKernel(commandQueue,kernel1,2,NULL,globalThreads,localThreads,0,NULL,NULL);
ASSERT_CL(status);
status = clEnqueueNDRangeKernel(commandQueue,kernel2,2,NULL,globalThreads,localThreads,0,NULL,&ndrEvt);
ASSERT_CL(status);
if(i%16==0){
status = clFlush(commandQueue);
ASSERT_CL(status);
spinForEventsComplete( 1, &ndrEvt );
//status = clWaitForEvents(1, &ndrEvt);
//ASSERT_CL(status);
}
}
status = clFlush(commandQueue);
ASSERT_CL(status);
spinForEventsComplete( 1, &ndrEvt );
Thank you!