Function: get_device
Applicable Products
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Description
Obtains the IDs of the devices in use.
Prototype
- C Prototype
1aclError aclrtGetDevice(int32_t *deviceId)
- Python Function
1device_id, ret = acl.rt.get_device()
Parameters
Parameter |
Description |
|---|---|
device_id |
Pointer to the device ID. |
Return Values
Return Value |
Description |
|---|---|
ret |
Int, error code. 0 on success; else, failure. |
Restrictions
If no device is specified in advance, an error is returned when acl.rt.get_device is called. You can specify a device by enabling the default device using init, explicitly specifying a device using acl.rt.set_device, or implicitly specifying a device using acl.rt.create_context.
Parent topic: Device Management