aclrtSetStreamConfigOpt

Applicability

Product

Supported

Atlas 350 Accelerator Card

X

Atlas A3 training product/Atlas A3 inference product

X

Atlas A2 training product/Atlas A2 inference product

X

Atlas 200I/500 A2 inference product

X

Atlas inference product

X

Atlas training product

X

Description

Sets the value of each attribute in the stream configuration object.

This API must be used together with other APIs to create a stream. The API call sequence is as follows:
  1. Call aclrtCreateStreamConfigHandle to create a stream configuration object.
  2. Call aclrtSetStreamConfigOpt multiple times to set the value of each attribute in the configuration object.
  3. Call aclrtCreateStreamV2 to create a stream.
  4. After the stream is used, call aclrtDestroyStreamConfigHandle to destroy the stream configuration object and call aclrtDestroyStream to destroy the stream.

Prototype

1
aclError aclrtSetStreamConfigOpt(aclrtStreamConfigHandle *handle, aclrtStreamConfigAttr attr, const void *attrValue, size_t valueSize)

Parameters

Parameter

Input/Output

Description

handle

Output

Pointer to the stream configuration object. For details about the type definition, see aclrtStreamConfigHandle.

Call aclrtCreateStreamConfigHandle to create this object in advance.

attr

Input

Attribute to set. For details about the type definition, see aclrtStreamConfigAttr.

attrValue

Input

Pointer to the attr value to set.

If the attribute value itself is a pointer, pass the address of the pointer.

valueSize

Input

Data length of attrValue.

You can use the sizeof(*attrValue) function in the C/C++ standard library to query the data length.

Returns

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