Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clock() in opencl

Tags:

cuda

gpu

opencl

I know that there is function clock() in CUDA where you can put in kernel code and query the GPU time. But I wonder if such a thing exists in OpenCL? Is there any way to query the GPU time in OpenCL? (I'm using NVIDIA's tool kit).

like image 329
Zk1001 Avatar asked Jan 13 '12 10:01

Zk1001


1 Answers

There is no OpenCL way to query clock cycles directly. However, OpenCL does have a profiling mechanism that exposes incremental counters on compute devices. By comparing the differences between ordered events, elapsed times can be measured. See clGetEventProfilingInfo.

like image 65
vocaro Avatar answered Sep 23 '22 18:09

vocaro