Quantcast
Channel: Community : All Content - OpenCL
Viewing all articles
Browse latest Browse all 2400

What is right order to queue multiple kernels in loop

$
0
0

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!


Viewing all articles
Browse latest Browse all 2400

Latest Images

Trending Articles



Latest Images