Function: get_primary_ctx_state

Applicability

Product

Supported (√/x)

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

Function Usage

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)
    

Parameter Description

Parameter

Description

device_id

Int, device ID.

Return Value Description

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 to 0.

ret

Int, 0 on success; else, failure.