产品 |
是否支持 |
|---|---|
Ascend 950PR/Ascend 950DT |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
本接口在SIMD与SIMT混合和SIMT调试场景中提供Clock时间戳功能,用于记录从程序启动到接口调用时刻所经历的时钟周期数(Cycle Count),便于精确分析执行延迟和性能瓶颈。
1 | inline uint64_t clock(void) |
无
从程序开始到调用时所经历的时钟周期数。
无
使用该接口需要包含"utils/debug/asc_time.h"头文件。
1 | #include "utils/debug/asc_time.h" |
1 2 3 4 5 | __global__ __launch_bounds__(1024) void SimtKernel(uint64_t* dst) { int idx = threadIdx.x + blockIdx.x * blockDim.x; dst[idx] = clock(); } |
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(); } |