aclrtGetDevice

Description

Obtains the ID of the compute device. This API is synchronous.

Restrictions

If neither aclrtSetDevice nor aclrtCreateContext is called to specify a device, an error is returned when aclrtGetDevice is called.

Prototype

aclError aclrtGetDevice(int32_t *deviceId)

Parameters

Parameter

Input/Output

Description

deviceId

Output

Pointer to the device ID.

Returns

0 on success; else, failure.