Merge "Removed WIP tag from Neuralnetworks HAL" into oc-mr1-dev

am: e9a134b868

Change-Id: I1f69c9efc02421d40e5d2ef7de97f5ebfb1542d2
This commit is contained in:
Michael Butler 2017-09-23 03:44:44 +00:00 committed by android-build-merger
commit d970a9edcf
4 changed files with 47 additions and 18 deletions

View 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);
};

View 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);
};

View 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);
};

View 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;
};