Created
May 13, 2015 15:11
-
-
Save papercompute/082c8406c4e624af4006 to your computer and use it in GitHub Desktop.
OpenCL Host level synchronization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for(int i=0;i<numIter-1;i++){ // numIter = 1000 | |
| status = clEnqueueNDRangeKernel(commandQueue,kernel1,2,NULL,globalThreads,localThreads,0,NULL,NULL); | |
| ASSERT_CL(status); | |
| status = clEnqueueNDRangeKernel(commandQueue,kernel2,2,NULL,globalThreads,localThreads,0,NULL,NULL); | |
| ASSERT_CL(status); | |
| if(i>0 && i%256==0){ // just | |
| status = clFlush(commandQueue); | |
| ASSERT_CL(status); | |
| } // if | |
| } // for i | |
| // last iteration | |
| 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); | |
| status = clFlush(commandQueue); | |
| ASSERT_CL(status); | |
| // wait | |
| spinForEventsComplete( 1, &ndrEvt ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment