• 10/30/2018
  • Public Content
Contents

Host-Side Timing

The following code snippet is a host-side timing routine around a kernel call (error handling is omitted):
float start = …;//getting the first time-stamp         clEnqueueNDRangeKernel(g_cmd_queue, …);         clFinish(g_cmd_queue);// to make sure the kernel completed float end = …;//getting the last time-stamp float time = (end-start);
In this example, host-side timing is implemented using the following functions:
  • clEnqueueNDRangeKernel
    puts a kernel to a queue and immediately returns
  • clFinish
    explicitly indicates the completion of kernel execution. You can also use
    clWaitForEvents
    .
Remember to profile operations on memory objects separately.

See Also

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804