aclmdlRIBindStream

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

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

Binds a model running instance to a stream.

Prototype

1
aclError aclmdlRIBindStream(aclmdlRI modelRI, aclrtStream stream, uint32_t flag)

Parameters

Parameter

Input/Output

Description

modelRI

Input

Model running instance. For details about the type definition, see aclmdlRI.

The value of modelRI here must be the same as that of modelRI in aclmdlRIBuildBegin.

stream

Input

Stream. For details about the type definition, see aclrtStream.

The stream must be created by calling aclrtCreateStreamWithConfig with the type ACL_STREAM_PERSISTENT.

Passing NULL is not supported. A stream cannot be bound to multiple modelRIs.

flag

Input

Whether the stream runs from the beginning of model execution.

  • ACL_MODEL_STREAM_FLAG_HEAD: Runs from the beginning of model execution.
  • ACL_MODEL_STREAM_FLAG_DEFAULT: Activated based on the branch operator or loop operator during model execution. The stream can be activated by calling aclrtActiveStream.

The macros are defined as follows:

#define ACL_MODEL_STREAM_FLAG_HEAD    0x00000000U 
#define ACL_MODEL_STREAM_FLAG_DEFAULT 0x7FFFFFFFU

Returns

0 on success; otherwise, failure. For details, see aclError.