aclrtGetDevice

Description

Obtains the IDs of the devices in use.

Restrictions

If no device is specified in advance, an error is returned when aclrtGetDevice is called. You can specify a device by enabling default device using aclInit, explicitly specifying a device by calling aclrtSetDevice, or implicitly specifying a device by calling aclrtCreateContext.

Prototype

aclError aclrtGetDevice(int32_t *deviceId)

Parameters

Parameter

Input/Output

Description

deviceId

Output

Pointer to the device ID.

Returns

The value 0 indicates success, and other values indicate failure. For details, see aclError.