aclrtGetPrimaryCtxState

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

Function

Obtains the status of the default context.

Prototype

1
aclError aclrtGetPrimaryCtxState(int32_t deviceId, uint32_t *flags, int32_t *active)

Parameters

Parameter

Input/Output

Description

deviceId

Input

ID of the device whose default context is to be obtained.

The value must be in the range of [0, (Available device count – 1)]. Call aclrtGetDeviceCount to obtain the device count.

flags

Output

Reserved. Currently, the value is fixed at NULL.

active

Output

Pointer to the status of the default context.

The status values are as follows:

  • 0: not activated
  • 1: activated

Returns

0 on success; otherwise, failure. For details, see aclError.