Function: set_stream_res_limit

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

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

√

Description

Sets the device resource limits of a specified stream.

This API must be called after the acl.rt.set_device API is called and before the operator is executed. If you set device resource limits for the same stream multiple times, the last setting takes effect.

After this API is called to set the device resource limit of a specified stream, the acl.rt.use_stream_res_in_current_thread API needs to be called to set the device resource limit of the specified stream used in the current thread. You can call acl.rt.get_stream_res_limit to query the default resource limits.

Prototype

  • C Prototype
    aclError aclrtSetStreamResLimit(aclrtStream stream, aclrtDevResLimitType type, uint32_t value)
  • Python Function
    1
    ret = acl.rt.set_stream_res_limit(stream,  type , value)
    

Parameters

Parameter

Description

stream

Int, specified stream. If 0 is passed, it indicates the default stream.

type

Int, resource type. Currently, Cube Core and Vector Core are supported. For details, see the new data structure by calling aclrtDevResLimitType.

value

Int, resource limit.

Return Values

Return Value

Description

ret

Int, 0 on success; else, failure.