clock

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

x

Atlas A2 training product/Atlas A2 inference product

x

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

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();
}