Function: set_stream_attribute

Applicable Products

  • Ascend 950PR&950DT products: Supported
  • Atlas A3 products: Supported
  • Atlas A2 products: Supported
  • Atlas 200I/500 A2 inference products: Supported
  • Atlas inference products: Supported
  • Atlas training products: Supported

Function

Sets attributes of a stream.

Prototype

  • C Prototype

    aclError aclrtSetStreamAttribute(aclrtStream stream, aclrtStreamAttr stmAttrType, aclrtStreamAttrValue *value)
    
  • Python Function

    ret = acl.rt.set_stream_attribute(stream, stm_attr_type, value)
    

Parameters

Parameter Description
stream Int, stream.
stm_attr_type Int, attribute type. For details, see aclrtStreamAttr.
value Dict, attribute value. For details, see aclrtStreamAttrValue.

Return Values

Return Value Description
ret Int. If 0 is returned, the operation is successful. If other values are returned, the operation fails.

Constraints

  • Overflow detection attribute: The setting takes effect only for tasks created after this API call.
  • For Ascend 950PR&950DT, Atlas A3, and Atlas A2 products, the default stream can be specified (that is, the stream parameter is set to 0).
  • For Atlas 200I/500 A2 inference products, Atlas inference products, and Atlas training products, the default stream cannot be specified (that is, the stream parameter cannot be set to 0).
  • 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 products
    • Atlas training products
    • Atlas A2 products
    • Atlas A3 products
  • 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 products
    • Atlas A3 products