函数:get_op_duration
产品支持情况
产品 |
是否支持 |
---|---|
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
功能说明
获取算子执行的耗时时间,单位为ns。
建议用户新建一个线程,在新线程内调用该接口,否则可能阻塞主线程中的其它任务调度。
函数原型
- C函数原型
1
uint64_t aclprofGetOpDuration(const void *opInfo, size_t opInfoLen, uint32_t index)
- python函数
1
op_duration = acl.prof.get_op_duration(op_info, op_info_len, index)
参数说明
参数名 |
说明 |
---|---|
op_info |
int,指定算子信息的内存地址。 |
op_info_len |
int,算子信息的长度。 |
index |
int,指定获取第几个算子的算子名称。 用户调用acl.prof.get_op_num接口获取算子数量后,这个index的取值范围:[0, (算子数量-1)]。 |
返回值说明
返回值 |
说明 |
---|---|
op_duration |
int,算子执行的耗时时间。 |
父主题: 订阅算子信息