aclrtGetDevice
Applicable Products
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function
Obtains the ID of the device currently in use.
Prototype
1 | aclError aclrtGetDevice(int32_t *deviceId) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
deviceId |
Output |
Pointer to the device ID. |
Returns
0 on success; otherwise, failure. For details, see aclError.
Restrictions
If no compute device is specified in advance (for example, by calling aclrtSetDevice), an error is returned when aclrtGetDevice is called.
Parent topic: Device Management