aclmdlRIBindStream

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Description

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