Function: get_primary_ctx_state

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 Value

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.