CustomAllocateStreamPassFn

Applicability

Product

Supported or Not

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Function Usage

Registers the execution function for a custom logical stream–assigned pass.

For details about the API, see "Custom Concurrency Using CustomStreamPassFunc".

Prototype

1
PassRegistrationData &CustomAllocateStreamPassFn(const CustomAllocateStreamPassFunc &allocate_stream_pass_fn)

Parameters

Parameter

Input/Output

Description

allocate_stream_pass_fn

Input

Custom logic stream assignment function. For details, see Callback Function CustomAllocateStreamPassFunc.

Returns

Reference to its own object.

Constraints

None

Callback Function CustomAllocateStreamPassFunc

You can customize and implement the CustomAllocateStreamPassFunc class function.

Status CustomAllocateStreamPassFunc(const ConstGraphPtr &graph, StreamPassContext &stream_context)
Table 1 Parameters

Parameter

Input/Output

Description

graph

Input

Graph of the logical stream to be allocated.

stream_context

Input

Context of the flow stream assignment. It can be used to apply for a new stream ID and set the stream ID of a node. For details, see the structure definition of StreamPassContext.

-

Output

  • SUCCESS: success.
  • Other values: failure.