Add HAL entry to allow querying the device type
Bug: 111425781
Bug: 112661050
Test: mm
Test: NeuralNetworksTest_static
Change-Id: Iced35c24eb2905c10fbf86d55319fdb5c7488703
diff --git a/neuralnetworks/1.2/IDevice.hal b/neuralnetworks/1.2/IDevice.hal
index 6a77961..6c3b483 100644
--- a/neuralnetworks/1.2/IDevice.hal
+++ b/neuralnetworks/1.2/IDevice.hal
@@ -56,6 +56,26 @@
getVersionString() generates (ErrorStatus status, string version);
/**
+ * Get the type of a given device.
+ *
+ * The device type can be used to help application developers to distribute
+ * Machine Learning workloads and other workloads such as graphical rendering.
+ * E.g., for an app which renders AR scenes based on real time object detection
+ * results, the developer could choose an ACCELERATOR type device for ML
+ * workloads, and reserve GPU for graphical rendering.
+ *
+ * @param status Error status returned from querying the device type. Must be:
+ * - NONE if the query was successful
+ * - DEVICE_UNAVAILABLE if driver is offline or busy
+ * - GENERAL_FAILURE if the query resulted in an
+ * unspecified error
+ * @param type The DeviceType of the device. Please note, this is not a
+ * bitfield of DeviceTypes. Each device must only be of a
+ * single DeviceType.
+ */
+ getType() generates (ErrorStatus status, DeviceType type);
+
+ /**
* Gets the supported operations in a model.
*
* getSupportedOperations indicates which operations of a model are fully