Implement sleep() in OpenCL C [duplicate]
问题 This question already has an answer here : Calculate run time of kernel code in OpenCL C (1 answer) Closed 4 years ago . I want to measure the performance of different devices viz CPU and GPUs. This is my kernel code: __kernel void dataParallel(__global int* A) { sleep(10); A[0]=2; A[1]=3; A[2]=5; int pnp;//pnp=probable next prime int pprime;//previous prime int i,j; for(i=3;i<10;i++) { j=0; pprime=A[i-1]; pnp=pprime+2; while((j<i) && A[j]<=sqrt((float)pnp)) { if(pnp%A[j]==0) { pnp+=2; j=0; }