Function: get_device

C Prototype

aclError aclrtGetDevice(int32_t *deviceId)

Python Function

device_id, ret = acl.rt.get_device()

Function Usage

Obtains the IDs of the devices in use.

Input Description

None

Return Value

device_id: int, ID of the device in use.

ret: int, error code.

Restrictions

If neither acl.rt.set_device nor acl.rt.create_context is called to specify a device, an error is returned when acl.rt.get_device is called.