6.15.21. Kernel Clock Functions
6.15.21. 内核时钟函数
The functionality described in this section requires support for the
本节中描述的功能需要支持cl_khr_kernel_clock扩展。
clock_read_device和clock_read_hilo_device函数需要支持 |
This section describes OpenCL C built-in functions that sample the value from one of three clocks provided by compute units.
本节介绍OpenCL C内置函数,这些函数从计算单元提供的三个时钟之一中采样值。
Function 函数 | Description 描述 |
---|---|
| Returns a sampled value of a clock as seen by the compute unit.
返回计算单元看到的时钟采样值。
An idealized clock is an unbounded unsigned scalar integer tick count increasing monotonically over time. A clock’s rate of progress may vary within the lifetime of a work-item, may vary across different executions of the program, and may be affected by conditions beyond the control of the programmer. The sampled value read by this function consists of the least significant bits of the idealized clock’s tick count at the time the instruction was executed. In particular, an observer may see sampled values wrap around zero.
理想化的时钟是一个无界的无符号标量整数滴答数,随时间单调递增。时钟的进度可能在工作项的生命周期内有所不同,可能在程序的不同执行过程中有所不同,并可能受到程序员无法控制的条件的影响。此函数读取的采样值由执行指令时理想时钟滴答数的最低有效位组成。特别是,观察者可能会看到采样值围绕零。 |
| Performs the same operation as
执行与clock_read相同的操作,但返回值为uint2,其.lo分量包含结果的32个最低有效位,.hi分量包含结果中的32个最高有效位。 |