Function: get_res_in_current_thread

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

Obtains the device resources that can be used by the current thread.

The value is returned based on the following priorities: stream-level device resource limit (set by acl.rt.set_stream_res_limit) > device resource limit of the current process (set by acl.rt.set_device_res_limit) > default hardware resource limit of the AI processor.

Prototype

  • C Prototype
    aclError aclrtGetResInCurrentThread(aclrtDevResLimitType type, uint32_t *value)
  • Python Function
    1
    value, ret = acl.rt.get_res_in_current_thread(type)
    

Parameters

Parameter

Description

type

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

Return Values

Return Value

Description

value

Int, resource limit of the current thread.

ret

Int, 0 on success; else, failure.