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