cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

isaid
Journeyman III

OpenCL inner Kernel Timing

Hi

Is there any way to use the clock() inside an OpenCL kernel?

Thx

0 Likes
2 Replies
rick_weber
Adept II

No. OpenCL doesn't provide access to any POSIX libraries. The one exception is some vendors, such as AMD, provide an extension that lets you call printf() in kernels.

Generally, you can time pieces of your kernels by commenting out sections of the kernel and timing it on the CPU, but it's tricky because you have to make sure the compiler doesn't dead store optimize away the code you actually want to time.

0 Likes

Thank you Rick.

I am afraid I have to use a lower level solution ... probably trying to use CAL/IL instead 

0 Likes