Function: set_stream_attribute

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

Sets the attributes of a stream.

Prototype

  • C Prototype
    aclError aclrtSetStreamAttribute(aclrtStream stream, aclrtStreamAttr stmAttrType, aclrtStreamAttrValue *value)
  • Python Function
    1
    ret = acl.rt.set_stream_attribute(stream, stm_attr_type, value)
    

Parameter Description

Parameter

Description

stream

Int, stream.

Products differ in their support for default streams (setting this parameter to 0):

Atlas A3 Training Series Product: supported

Atlas A2 Training Series Product/Atlas 800I A2 Inference Product: supported

Atlas 200/500 A2 Inference Product: not supported

Atlas Inference Series Product: not supported

Atlas Training Series Product: not supported

stm_attr_type

Int, attribute type. For details, see aclrtStreamAttr.

value

Dict, attribute value. For details, see aclrtStreamAttrValue.

Return Value Description

Return Value

Description

ret

Int, 0 on success; else, failure.

Restrictions

  • Overflow/underflow detection attribute: The setting takes effect only for tasks created after this API call.
  • Failure mode: The failure mode cannot be set for the default stream of a context.
  • When stm_attr_type is set to ACL_STREAM_ATTR_FAILURE_MODE, the following product models are supported:
    • Atlas inference products
    • Atlas 200I/500 A2 inference product
    • Atlas training product
    • Atlas A2 training product/Atlas A2 inference product
    • Atlas A3 training product/Atlas A3 inference product
  • When stm_attr_type is set to ACL_STREAM_ATTR_FLOAT_OVERFLOW_CHECK or ACL_STREAM_ATTR_USER_CUSTOM_TAG, the following product models are supported:
    • Atlas A2 training product/Atlas A2 inference product
    • Atlas A3 training product/Atlas A3 inference product