Function: set_device_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 for the current process.

Prototype

  • C Prototype
    aclError aclrtSetDeviceResLimit(int32_t deviceId, aclrtDevResLimitType type, uint32_t value)
  • Python Function
    1
    ret = acl.rt.set_device_res_limit(device_id, type, value)
    

Parameters

Parameter

Description

device_id

Int, device ID.

type

Int, enumerated value. For details, see aclrtDevResLimitType.

value

Int, resource limit.

Return Values

Return Value

Description

ret

Int, error code. 0 on success; else, failure.

Restrictions

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