2 Replies Latest reply on Jun 8, 2011 1:38 PM by isaid

    OpenCL inner Kernel Timing



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


        • OpenCL inner Kernel Timing

          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.