Function: get_primary_ctx_state

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 status of the default context.

Prototype

  • C Prototype
    aclError aclrtGetPrimaryCtxState(int32_t deviceId, uint32_t *flags, int32_t *active)
  • Python Function
    1
    active, flags, ret = acl.rt.get_primary_ctx_state(device_id)
    

Parameters

Parameter

Description

device_id

Int, device ID.

Return Values

Return Value

Description

active

Int, pointer to the status of the default context. 0: deactivated; 1: activated.

flags

Int, reserved value. Currently, the value is fixed at 0.

ret

Int, 0 on success; else, failure.