文档
注册

函数:record_event

C函数原型

aclError aclrtRecordEvent(aclrtEvent event, aclrtStream stream)

Python函数

ret = acl.rt.record_event(event, stream)

函数功能

在Stream中记录一个Event。

输入说明

event:int,待记录的Event的指针地址。

stream:int,将该Event记录在指定的Stream(指针地址)中,如果使用默认Stream,此处设置为0。

返回值说明

ret:int,错误码。

  • 返回0表示成功。
  • 返回其它值表示失败。

约束说明

  • 该接口是异步接口,调用接口成功仅表示任务下发成功,不表示任务执行成功。调用该接口后,需调用同步等待接口(例如,acl.rt.synchronize_stream)确保任务已执行完成。
  • acl.rt.record_event接口与acl.rt.stream_wait_event接口配合使用时,主要用于多Stream之间同步的场景,在调用acl.rt.record_event接口时,系统内部会申请Event资源,在调用acl.rt.stream_wait_event接口之后,请及时调用acl.rt.reset_event接口释放Event资源。

    接口调用顺序acl.rt.create_event-->acl.rt.record_event-->acl.rt.stream_wait_event-->acl.rt.reset_event

  • 由于在调用acl.rt.record_event接口,系统内部会申请Event资源,因此会受Event数量的限制,具体参考如下:

    Atlas 200/300/500 推理产品,单个Device上最多支持1023个Event。

    Atlas 200/500 A2推理产品,单个Device上最多支持1023个Event。

    Atlas 训练系列产品,单个Device上最多支持65535个Event。

    Atlas A2训练系列产品/Atlas 300I A2推理产品,单个Device上最多支持65535个Event。

    Atlas 推理系列产品(Ascend 310P处理器),单个Device上最多支持1023个Event。

参考资源

搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词