]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/platform-hardware-interfaces.git/commitdiff
Removed WIP tag from Neuralnetworks HAL
authorMichael Butler <butlermichael@google.com>
Tue, 19 Sep 2017 23:26:47 +0000 (16:26 -0700)
committerMichael Butler <butlermichael@google.com>
Fri, 22 Sep 2017 22:53:03 +0000 (15:53 -0700)
Additionally cleaned up some comments and formatting.

Bug: 63905942
Test: not needed
Change-Id: I0306f6d37f3c9ce9b365b5f838c27e81fa001ccd

neuralnetworks/1.0/IDevice.hal
neuralnetworks/1.0/IEvent.hal
neuralnetworks/1.0/IPreparedModel.hal
neuralnetworks/1.0/types.hal

index b6f94330a29ecaecf54a63dd6304bf3d2c429396..91a9555b6d56a21484c1332681ae0d552c259fdf 100644 (file)
@@ -14,8 +14,6 @@
  * limitations under the License.
  */
 
-/* This HAL is a work in progress */
-
 package android.hardware.neuralnetworks@1.0;
 
 import IEvent;
@@ -28,7 +26,10 @@ interface IDevice {
     /**
      * Gets the capabilities of a driver.
      *
-     * @return status ErrorStatus::NONE if successful.
+     * @return status Error status of the call, must be:
+     *                - NONE if successful
+     *                - DEVICE_UNAVAILABLE if driver is offline or busy
+     *                - GENERAL_FAILURE if there is an unspecified error
      * @return capabilities Capabilities of the driver.
      */
     getCapabilities() generates (ErrorStatus status, Capabilities capabilities);
@@ -43,7 +44,11 @@ interface IDevice {
      *
      * @param model A model whose operations--and their corresponding
      *              operands--are to be verified by the driver.
-     * @return status ErrorStatus::NONE if successful.
+     * @return status Error status of the call, must be:
+     *                - NONE if successful
+     *                - DEVICE_UNAVAILABLE if driver is offline or busy
+     *                - GENERAL_FAILURE if there is an unspecified error
+     *                - INVALID_ARGUMENT when provided model is invalid
      * @return supportedOperations A list of supported operations, where true
      *                             indicates the operation is supported and
      *                             false indicates the operation is not
@@ -52,7 +57,7 @@ interface IDevice {
      *                             it is describing.
      */
     getSupportedOperations(Model model)
-            generates (ErrorStatus status, vec<bool> supportedOperations);
+                generates (ErrorStatus status, vec<bool> supportedOperations);
 
     /**
      * Prepares a model for execution.
@@ -60,7 +65,7 @@ interface IDevice {
      * prepareModel is used to make any necessary transformations or alternative
      * representations to a model for execution, possible including
      * transformations on the constant data, optimization on the model's graph,
-     * or compilation into the device's native binary.
+     * or compilation into the device's native binary format.
      *
      * The only information that may be unknown to the model at this stage is
      * the shape of the tensors, which may only be known at execution time.
@@ -68,16 +73,25 @@ interface IDevice {
      * @param model The model to be prepared for execution.
      * @param event A synchronization callback that must be signaled once the
      *              execution has finished.
-     * @return status ErrorStatus::NONE if successful.
+     * @return status Error status of the call, must be:
+     *                - NONE if preparation task is successfully launched
+     *                - DEVICE_UNAVAILABLE if driver is offline or busy
+     *                - GENERAL_FAILURE if there is an unspecified error
+     *                - INVALID_ARGUMENT when one of the input arguments is
+     *                  invalid
      * @return preparedModel A handle to the resultant prepared model.
      */
     prepareModel(Model model, IEvent event)
-            generates (ErrorStatus status, IPreparedModel preparedModel);
+      generates (ErrorStatus status, IPreparedModel preparedModel);
 
     /**
      * Returns the current status of a driver.
      *
-     * @return status Status of the driver.
+     * @return status Status of the driver, one of:
+     *                - DeviceStatus::AVAILABLE
+     *                - DeviceStatus::BUSY
+     *                - DeviceStatus::OFFLINE
+     *                - DeviceStatus::UNKNOWN
      */
     getStatus() generates (DeviceStatus status);
 };
index 2ebda58948b102903ab530349f2202340acb842e..2fe454c1cd5496b2e3a6a0296b808c30ab7fa5a2 100644 (file)
@@ -14,8 +14,6 @@
  * limitations under the License.
  */
 
-/* This HAL is a work in progress */
-
 package android.hardware.neuralnetworks@1.0;
 
 /**
@@ -37,7 +35,11 @@ interface IEvent {
      * the work) to mark the event as completed so that any threads requiring
      * the corresponding output can continue executing.
      *
-     * @param status ErrorStatus::NONE if successful.
+     * @param status Error status returned from the asynchronous task, must be:
+     *               - NONE if asynchronous task was successful
+     *               - DEVICE_UNAVAILABLE if driver is offline or busy
+     *               - GENERAL_FAILURE if the asynchronous task resulted in an
+     *                 unspecified error
      */
     oneway notify(ErrorStatus status);
 };
index a7c33420932c09435e6ab4b5f302d13041fb5e69..5df883e1d2b3fabdbd906a41df4af3867046bdec 100644 (file)
@@ -36,11 +36,16 @@ interface IPreparedModel {
      *
      * @param request The input and output information on which the prepared
      *                model is to be executed.
-     *                prepared model.
      * @param event A callback used for synchronization that must be signaled
      *              once the execution has finished.
-     * @return status ErrorStatus::NONE if the asynchronous task was
-     *                successfully launched.
+     * @return status Error status of the call, must be:
+     *                - NONE if task is successfully launched
+     *                - DEVICE_UNAVAILABLE if driver is offline or busy
+     *                - GENERAL_FAILURE if there is an unspecified error
+     *                - OUTPUT_INSUFFICIENT_SIZE if provided output buffer is
+     *                  not large enough to store the resultant values
+     *                - INVALID_ARGUMENT when one of the input arguments is
+     *                  invalid
      */
     execute(Request request, IEvent event) generates (ErrorStatus status);
 };
index 39e3d345c07d7e3aa8f29bb51c0e8104dd312a6f..537331bb88167d940a98da6d3073cfb1d542283d 100644 (file)
@@ -218,7 +218,7 @@ enum OperationType : int32_t {
      *
      * Inputs:
      * 0: A 4-D tensor, of shape [batches, height, width, depth_in], specifying the input.
-     * 1: A 4-D tensor, of shape [depth_out, filter_height, filter_width, depth_in],
+     * 1: A 4-D tensor, of shape [1, filter_height, filter_width, depth_out],
      *    specifying the filter.
      * 2: A 1-D tensor, of shape [depth_out], specifying the bias.
      *    For input tensor of {@link OperandType::TENSOR_FLOAT32} type, the bias should
@@ -1105,14 +1105,16 @@ struct Operand {
     /**
      * Quantized scale of the operand.
      *
-     * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM.
+     * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM or
+     * TENSOR_INT32.
      */
     float scale;
 
     /**
      * Quantized zero-point offset of the operand.
      *
-     * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM.
+     * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM or
+     * TENSOR_INT32.
      */
     int32_t zeroPoint;
 
@@ -1195,12 +1197,18 @@ struct Model {
 
     /**
      * A byte buffer containing operand data that were copied into the model.
+     *
+     * An operand's value must be located here if and only if Operand::lifetime
+     * equals OperandLifeTime::CONSTANT_COPY.
      */
     vec<uint8_t> operandValues;
 
     /**
      * A collection of shared memory pools containing operand data that were
      * registered by the model.
+     *
+     * An operand's value must be located here if and only if Operand::lifetime
+     * equals OperandLifeTime::CONSTANT_REFERENCE.
      */
     vec<memory> pools;
 };