aclmdlRIBindStream

Applicability

Product

Supported

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

Description

Binds a model running instance to a stream.

Prototype

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

Parameters

Parameter

Input/Output

Description

modelRI

Input

Model running instance.

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

stream

Input

Stream.

The stream must be created by calling aclrtCreateStreamWithConfig, which is used to create a stream of the ACL_STREAM_PERSISTENT type.

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; else, failure. For details, see aclError.