clock
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
Function Usage
Provides the clock timestamp function in the SIMD and SIMT debugging scenario. It records the number of clock cycles (Cycle Count) from program start to the moment of API invocation, enabling precise analysis of execution latency and performance bottlenecks.
Prototype
1 | __simt_callee__ inline uint64_t clock(void) |
Parameters
None
Returns
Number of clock cycles from program start to API invocation
Restrictions
None
Header Files to Be Included
To use this API, the utils/debug/asc_time.h header file must be included.
1 | #include "utils/debug/asc_time.h" |
Examples
1 2 3 4 5 | __simt_vf__ __launch_bounds__(1024) inline void SimtKernel(__gm__ uint64_t* dst) { int idx = threadIdx.x + blockIdx.x * blockDim.x; dst[idx] = clock(); } |
Parent topic: Commissioning APIs