CustomAllocateStreamPassFn

函数功能

注册自定义的逻辑流分配Pass执行函数。

函数原型

1
PassRegistrationData &CustomAllocateStreamPassFn(const CustomAllocateStreamPassFunc &allocate_stream_pass_fn)

约束说明

无。

参数说明

参数名

输入/输出

描述

allocate_stream_pass_fn

输入

自定义的逻辑流分配函数。详情请参见回调函数CustomAllocateStreamPassFunc

返回值

返回自身对象的引用。

回调函数CustomAllocateStreamPassFunc

用户自定义并实现CustomAllocateStreamPassFunc类函数,即自定义的逻辑流分配函数。

Status CustomStreamPassFunc(const ConstGraphPtr &graph, StreamPassContext &stream_context)
表1 参数说明

参数名

输入/输出

描述

graph

输入

待分配逻辑流的图

stream_context

输入

逻辑流分配上下文,可通过该上下文申请新stream id,设置节点的stream id等。详见StreamPassContext结构定义。

-

输出

  • SUCCESS:成功。
  • 其他值:失败。