C函数原型 |
aclError aclrtEventElapsedTime(float *ms, aclrtEvent startEvent, aclrtEvent endEvent) |
---|---|
Python函数 |
ms, ret = acl.rt.event_elapsed_time(start, end) |
函数功能 |
统计两个Event之间的耗时。 |
输入说明 |
start:int,指定起始Event对象的指针地址。 end:int,指定结尾Event对象的指针地址。 |
返回值说明 |
ms:float,表示的是两个Event之间的耗时,单位是毫秒。 ret:int,错误码。
|
约束说明 |
接口调用顺序:调用acl.rt.create_event/acl.rt.create_event_with_flag接口创建event-->调用acl.rt.record_event接口在同一个stream中记录起始event、结尾event-->调用acl.rt.synchronize_stream接口阻塞应用程序运行,直到指定Stream中的所有任务都完成-->调用acl.rt.event_elapsed_time接口统计两个Event之间的耗时。 |