AnsweredAssumed Answered

What is right order to queue multiple kernels in loop

Question asked by papercompute on May 8, 2015
Latest reply on May 12, 2015 by papercompute

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!

Outcomes