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

    OpenCL inner Kernel Timing

    isaid

      Hi

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

      Thx

        • OpenCL inner Kernel Timing
          rick.weber

          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.