Commit graph

72 commits

Author SHA1 Message Date
Michael Butler
d6f6d01499 Handle case where NN AIDL callback is null in IDevice::prepareModel*
Prior to this change, if IDevice::prepareModel* was passed a null
callback, the code would still attempt to call "notify" on the callback
to return the error to the client. This CL ensures the "notify" method
will not be invoked if the callback is null.

Bug: N/A
Test: mma
Test: presubmit
Change-Id: I4a15d02c4879a0261ec26cc0e7a47d0a4da86b8b
2022-04-21 16:40:09 -07:00
Michael Butler
d65dc06ddc Make NN canonical->HIDL adapter execute* methods synchronous
This change alters the asynchronous execute* methods to be handled
synchronously (from the same thread) for three reasons:
1) To remove the need to use IPreparedModel::getUnderlyingResource
2) To simplify the code
3) To make the code more performant

Bug: N/A
Test: mma
Test: presubmit
Change-Id: I2c37deb03d1b1c34b0173bd741e55fce4de757f7
2022-03-01 16:16:26 -08:00
Chih-hung Hsieh
ff54f73b4f Merge "Add timed out test files to tidy_timeout_srcs" 2022-02-24 00:21:18 +00:00
Chih-Hung Hsieh
ad1bf31b78 Add timed out test files to tidy_timeout_srcs
* Timed out runs do not show any warning messages.
* These test files cannot finish clang-tidy runs with
  the following settings:
    TIDY_TIMEOUT=90
    WITH_TIDY=1
    CLANG_ANALYZER_CHECKS=1
* When TIDY_TIMEOUT is set, in Android continuous builds,
  tidy_timeout_srcs files will not be compiled by clang-tidy.
  When developers build locally without TIDY_TIMEOUT,
  tidy_timeout_srcs files will be compiled.
* Some of these test modules may be split into smaller ones,
  or disable some time consuming checks, and then
  enable clang-tidy to run within limited time.

Bug: 201099167
Test: make droid tidy-hardware-interfaces_subset
Change-Id: I1de28f1572fff368f67eab512fffec9f2e5c2a9b
2022-02-18 17:25:41 -08:00
Michael Butler
73e470235d Remove isUpdatable query from NNAPI -- hal
The NNAPI originally planned to have updated platform drivers delivered
through GMSCore. These updatable drivers would be retrieved through the
NN sAIDL utility code, and were known to be updatable through
Manager.cpp's Device::isUpdatable query.

However, the NNAPI ultimately did not move forward with its updatability
plans. This CL removes the updatability check in the NN AIDL utility
code.

Bug: N/A
Test: mma
Test: CtsNNAPITestCases
Test: NeuralNetworksTest_static
Change-Id: I6f9c1eac3af8cb54565bfaaeab7ddd382a85e3bd
2022-02-14 19:21:38 -08:00
Michael Butler
6f497d1833 Clamp NNAPI HAL Version to runtime version -- hal
The NNAPI is a Mainline Module, and its runtime version is determined by
an Android Feature Flag to remotely rollout and rollback Feature Levels
as needed. This change propagates the maximum feature level version
allowed by the runtime to the HAL utility code, and clamps the utility
code's version to the version allowed by the runtime.

Bug: N/A
Test: mma
Test: CtsNNAPITestCases
Test: NeuralNetworksTest_static
Test: logged driver version, set current_feature_level, and verified the
      driver version was clamped by current_feature_level
Change-Id: Ibaa895f8e35d36b2ddf9432b3ef9468e5886075f
2022-02-14 19:21:09 -08:00
Xusong Wang
8805b2d67c Address ANAPIC review comments -- hal.
- Document that IPreparedModel::execute*WithConfig are for single-time
  usages, and IPreparedModel::createReusableExecution is for reusable
  usages.
- Make PrepareModelConfig::cacheToken a fixed sized array.

Fixes: 215566186
Test: VtsHalNeuralnetworksTargetTest
Test: NNT_static
Change-Id: I9c5a49c46a3eac2828b9eb666f3d742038493121
2022-02-07 14:02:41 -08:00
Michael Butler
6b0905cb69 Move NNAPI HAL CommonUtils to nnapi/SharedMemory -- hal
This CL relocates utility code that transfers data between pointer-based
memory and shared memory for Request objects and Model objects, moving
it from nnapi/hal/CommonUtils.h (hal utilities) to nnapi/SharedMemory.h
(canonical library).

This change also adds a check for whether Model and Requests have
pointer-based data in neuralnetworks/aidl/utils/src/Conversions.cpp to
make it consistent with the HIDL utility conversions.

Bug: 217217023
Test: mma
Test: presubmit
Change-Id: I55a0fea186708d806bc709681e10027a9e4b0ffb
2022-01-31 19:26:57 +00:00
Michael Butler
d3e413e759 Merge "Cleanup NN utility libraries' dependencies" 2022-01-20 23:36:09 +00:00
Michael Butler
9257d6d06d Cleanup NN utility libraries' dependencies
Bug: N/A
Test: mma
Change-Id: I0243c477098d9a2de28ca78bfde155d3ecb5acb6
2022-01-20 12:31:38 -08:00
Miao Wang
b5c8a82f25 HAL interface for compilation and execution hints
The following AIDL types are added:
 - TokenValuePair
 - PrepareModelConfig
 - ExecutionConfig

The following AIDL methods are added:
 - IDevice::prepareModelWithConfig
 - IPreparedModel::executeSynchronouslyWithConfig
 - IPreparedModel::executeFencedWithConfig
 - IBurst::executeSynchronouslyWithConfig

The compilation and execution hints are being stored as a list of
token-value pairs as part of the PrepareModelConfig / ExecutionConfig.
And the PrepareModelConfig / ExecutionConfig parcelables are created in
order to make future extensions to the execution related interfaces
easier.

It is the drivers responsibility to verify the hints, and it is allowed
for the driver to ignore them.

Bug: 203248587
Test: neuralnetworks_utils_hal_aidl_test
Change-Id: I98240fd75089fc85cdfcaa0be28aab8a6f0dfca5
Merged-In: I98240fd75089fc85cdfcaa0be28aab8a6f0dfca5
(cherry picked from commit 0e671f3edb)
2022-01-20 16:48:40 +00:00
Xusong Wang
11f30c81ef Reusable execution at HAL level -- HAL.
This CL modifies the canonical/AIDL adapter to use IExecution object
if available.

Bug: 202405342
Bug: 202431255
Test: NNT_static
Test: CtsNNAPITestCases
Test: VtsHalNeuralnetworksTargetTest
Change-Id: I6aac3c57f97ac87a5ba3f78cfd843fcc403decff
Merged-In: I6aac3c57f97ac87a5ba3f78cfd843fcc403decff
(cherry picked from commit 7f5c7d293c)
2022-01-18 10:51:29 -08:00
Michael Butler
594cc78a7b Remove uid from NN HIDL adapter
Having the adapter retrieve the uid is redundant because the implementor
is already able to get the uid directly themselves with
IPCThreadState::self()->getCallingUid().

Bug: N/A
Test: mma
Change-Id: Ifeffea053cb92556be1aae8b17a94fafa1ac98e0
2022-01-11 22:59:11 -08:00
Michael Butler
534556391a Create NN AIDL adapter
This change adds the following adapters:
* nn::IDevice -> BnDevice
* nn::IPreparedModel -> BnPreparedModel
* nn::IBurst -> BnBurst
* nn::IBuffer -> BnBuffer

Bug: N/A
Test: mma
Test: locally created a binderized service with this adapter code,
      which passed VtsHalNeuralnetworksTargetTest
Change-Id: I966f65a1e4d75284c050b77f3f40c515e4970130
2022-01-11 22:23:31 -08:00
Michael Butler
60a7b86cf0 Rename Version::ANDROID_* to kVersionFeatureLevel* -- hal
Prior to this change, version constants (e.g., Version::ANDROID_S) were
public static constants to make the version constants look as if they
were enum values. However, this method prevented versions from being
constexpr, because the Version type was incomplete by that point in
time. This change moves these version constants outside of the Version
struct, and makes them constexpr. They have the new names:
* Version::ANDROID_OC_MR1 -> kVersionFeatureLevel1
* Version::ANDROID_P -> kVersionFeatureLevel2
* Version::ANDROID_Q -> kVersionFeatureLevel3
* Version::ANDROID_R -> kVersionFeatureLevel4
* Version::ANDROID_S -> kVersionFeatureLevel5
* Version::FEATURE_LEVEL_6 -> kVersionFeatureLevel6
* Version::EXPERIMENTAL -> kVersionFeatureLevelExperimental

Bug: 206975939
Test: mma
Change-Id: Ibf5f2fdb1459a69c51865aa5fdcd0cb0c3a88ade
2021-11-18 23:56:54 +00:00
Michael Butler
34f0a8f418 Make NNAPI Version more structured -- hal
Prior to this topic, NNAPI Versions were linear and represented by an
enumeration. However, this did not properly account for the
non-linearity of runtime-specific features such as a control flow
operations with operands of dynamic sizes. This topic alters Version to
be a struct containing a feature level enumeration as well as a boolean
which indicates whether there are runtime-specific features.

Bug: 206975939
Test: mma
Test: NeuralNetworksTests_static
Change-Id: I78c54ef597bf269b137f2835332bdedac49883d4
2021-11-18 23:56:15 +00:00
Michael Butler
acd7955b21 Consolidate NNAPI OWNERS files
This change deletes all existing OWNERS files under
hardware/interfaces/neuralnetworks and creates a new OWNERS file with
the current NNAPI team members.

This change also updates the NNAPI project path in
hardware/interfaces/neuralnetworks/README.

Bug: 179510251
Test: N/A
Change-Id: Iaca69505c8449ae7d93be0db99205f5f56556e86
2021-11-15 20:22:41 +00:00
Michael Butler
ee7a476090 Merge changes from topic "libneuralnetworks_common-cleanup"
* changes:
  Move Aidl utility code to aidl/utils -- hal 2/2
  Move Aidl utility code to aidl/utils -- hal 1/2
2021-11-03 18:14:06 +00:00
Michael Butler
c331067aac Move Aidl utility code to aidl/utils -- hal 2/2
This change is part of an effort to remove HAL types from
libneuralnetworks_common*. This change:
* Updates the header guard names for the new directory
* Removes the "Aidl" prefix from the files
* Adds temporary "Aidl" header files under include/ that redirect to
   their corresponding files in include/nnapi/hal/aidl/
* Changes references of libneuralnetworks_common_hidl to
   libneuralnetworks_common

Bug: 191442336
Test: mma
Change-Id: Icbcc04e0a49a9adf8d8826fd5735028ea26de0ca
2021-11-01 21:34:53 -07:00
Michael Butler
137ee99a16 Re-organize NNAPI Burst utility classes
This change:
* Renames ExecutionBurstController to Burst in 1.2/utils
* Renames ExecutionBurstUtils to BurstUtils in 1.2/utils
* Renames ExecutionBurstServer to Burst in common/adapter

Bug: N/A
Test: mma
Change-Id: Ibd460229887c8c9cd23ebc6ee61da37c7c820288
2021-11-01 16:40:31 -07:00
Michael Butler
cfc16f94b2 Change NN adapter to use ExecutionBurstServer utility
Bug: 180492058
Bug: 177267324
Test: mma, presubmit
Change-Id: I589668efe187641a67934463bcdea8d19f095bb4
2021-11-01 14:48:48 -07:00
Michael Butler
abc86918ae Revert^2 "Provide explicitly versioned NNAPI AIDL utils libs -- HAL."
Reason for revert: rollforward fix of this topic

This change is a revert of I3d3ac4745, which itself is a revert of
I74f1798e8.

This CL modifies the AIDL utils libraries to be explicitly
versioned. Currently, we only have two versions: v1 and "current".
Specifically, the following changes are made:
- Remove AIDL dependencies from neuralnetworks_utils_hal_common
- Create explicitly versioned libs of neuralnetworks_utils_hal_aidl*

This is needed because it is not allowed for a build target to
link against multiple versions of the same AIDL lirary.

The canonical driver will report ANDROID_S for AIDL v1, and FL6 for v2.

Reverted Changes:
I2aefa0023:Revert "Use explicitly versioned NNAPI HAL util li...
Ia7df07ab9:Revert "Add neuralnetworks_utils_hal_aidl_v2 to al...
Iadd823460:Revert "Provide explicitly version NNAPI AIDL util...
I3d3ac4745:Revert "Provide explicitly versioned NNAPI AIDL ut...

Bug: 202405342
Test: NNT_static
Test: CtsNNAPITestCases
Test: VtsHalNeuralnetworksTargetTest
Change-Id: Ib3b732aa406f6d37e8f941082807c9232720c909
Merged-In: Ib3b732aa406f6d37e8f941082807c9232720c909
(cherry picked from commit 478a78ea77)
2021-10-29 14:28:45 -07:00
Michael Butler
49d95e0457 Move NN HandleError from utils/common to 1.0/utils
This change is part of a larger chain of changes to remove HIDL and AIDL
libraries from neuralnetworks_utils_hal_common.

Bug: N/A
Test: mma
Change-Id: Iae9f692ffc72700294aae694c256e75c7e353fef
2021-10-26 21:18:33 +00:00
Michael Butler
e8645c3b8d Relocate NN ProtectCallback to 1.0/utils
This change is part of a larger chain of changes to remove HIDL and AIDL
libraries from neuralnetworks_utils_hal_common.

Bug: N/A
Test: mma
Change-Id: Ib43f1cb683a09ae5c9116a6dea4d269c9c2c78b4
2021-10-26 21:18:09 +00:00
Michael Butler
15965821e8 Move NN memory utils from utils/common to 1.0/utils
This change is part of a larger chain of changes to remove HIDL and AIDL
libraries from neuralnetworks_utils_hal_common.

Bug: N/A
Test: mma
Change-Id: I9d4f0c30932fad7ccb6231aa03e57f7227af4880
2021-10-26 21:17:53 +00:00
Michael Butler
301ef060e9 Remove hal::utils::countNumberOfConsumers
This CL removes hal::utils::countNumberOfConsumers and uses the existing
nn::countNumberOfConsumers.

This change is part of a larger chain of changes to remove HIDL and AIDL
libraries from neuralnetworks_utils_hal_common.

Bug: N/A
Test: mma
Change-Id: I7d06ea355eae7aa80b94b09a23d606bbb2322120
2021-10-26 21:17:10 +00:00
Michael Butler
68e98f40dc Merge "Allow implicit conversions for NN errors -- hal" 2021-10-18 22:45:51 +00:00
Ian Hua
068df81ab6 AIDL interface changes for NNAPI feature level 6.
- Add BATCH_MATMUL operation
- Support TENSOR_INT32 for RESHAPE operation.

Also update "current" version snapshot and use
android.hardware.neuralnetworks-V2-ndk since AIDL v1 has been frozen.

Bug: 193012662
Bug: 200281183
Test: mm
Change-Id: Iabe45c57e2306d61055f711eda03b80b9cbe906d
Merged-In: Iabe45c57e2306d61055f711eda03b80b9cbe906d
2021-10-18 11:38:55 +01:00
Michael Butler
ff9a5a527a Allow implicit conversions for NN errors -- hal
This change allows GeneralErrors to be created from a string and allows
ExecutionErrors to be created from a string or a GeneralError.
This makes error handling more terse, removing the need for helper
functions such as makeGeneralFailure or makeExecutionFailure.

Bug: N/A
Test: mma
Change-Id: I8c5e80a2eb4f399fad64aab763fe6fa08cf8d1db
2021-10-15 16:37:09 -07:00
Treehugger Robot
2cac932fef Merge "Revert^2 "Making NN hardware interface libs "host supported""" 2021-08-12 16:01:47 +00:00
Ray Hernandez
338d6f8b86 Revert^2 "Making NN hardware interface libs "host supported""
This is a revert of I6f657743, which is a revert of I1d7c66516.

Changing static libraries in hardware/interfaces/neuralnetworks to be
"host supported", meaning that the libraries within this directory
will be available on the host/linux build to make integration and
debugging more efficient.

Host Supported Libs:
* neuralnetworks_utils_hal_1_0
* neuralnetworks_utils_hal_1_1
* neuralnetworks_utils_hal_1_2
* neuralnetworks_utils_hal_1_3
* neuralnetworks_utils_hal_aidl
* neuralnetworks_utils_hal_common

Host Supported Tests:
* neuralnetworks_utils_hal_1_0_test
* neuralnetworks_utils_hal_1_1_test
* neuralnetworks_utils_hal_1_2_test
* neuralnetworks_utils_hal_1_3_test
* neuralnetworks_utils_hal_aidl_test
* neuralnetworks_utils_hal_common_test

Bug: 146324523
Test: neuralnetworks_utils_hal_*_test
Change-Id: I6c3cc00cd1ceefe4ae4ca5e40a8f3062d3251ff1
2021-08-11 21:54:44 +00:00
Michael Butler
e0b2d17cbf Merge "Revert "Making NN hardware interface libs "host supported""" 2021-08-05 00:00:07 +00:00
Ray Hernandez
ea89e30439 Revert "Making NN hardware interface libs "host supported""
Revert "Making NNAPI libraries and tests host supported"

Revert submission 1769046-neuralnetworks_host_build

Reason for revert: New Build Breakage
Reverted Changes:
Ib54d5c274:Making NNAPI libraries and tests host supported
I1d7c66516:Making NN hardware interface libs "host supported"...

Change-Id: I6f65774325889c50b9f8bbab13b557705419b6cf
2021-08-04 23:46:41 +00:00
Treehugger Robot
7519960237 Merge "Making NN hardware interface libs "host supported"" 2021-08-04 22:27:11 +00:00
rayhdez
a6d6002431 Making NN hardware interface libs "host supported"
Changing static libraries in hardware/interfaces/neuralnetworks to be
"host supported", meaning that the libraries within this directory
will be available on the host/linux build to make integration and
debugging more efficient.

Host Supported Libs:
* neuralnetworks_utils_hal_1_0
* neuralnetworks_utils_hal_1_1
* neuralnetworks_utils_hal_1_2
* neuralnetworks_utils_hal_1_3
* neuralnetworks_utils_hal_aidl
* neuralnetworks_utils_hal_common

Host Supported Tests:
* neuralnetworks_utils_hal_1_0_test
* neuralnetworks_utils_hal_1_1_test
* neuralnetworks_utils_hal_1_2_test
* neuralnetworks_utils_hal_1_3_test
* neuralnetworks_utils_hal_aidl_test
* neuralnetworks_utils_hal_common_test

Bug: 146324523
Test: neuralnetworks_utils_hal_*_test
Change-Id: I1d7c665169d2ce0c978b1e510e71f1371402a950
2021-07-27 22:14:05 +00:00
Jiyong Park
27f77fefd7 Remove ndk_platform backend. Use the ndk backend.
The ndk_platform backend will soon be deprecated because the ndk backend
can serve the same purpose. This is to eliminate the confusion about
having two variants (ndk and ndk_platform) for the same 'ndk' backend.

Bug: 161456198
Test: m
Change-Id: Ibe8beeaf0d1b33968fb782f1f70c17ae9e9bf871
2021-07-27 14:44:47 +09:00
rayhdez
5d3fcb2c57 Correct grammatical error in README.md
Bug: 175887156
Test: N/A
Change-Id: Ic89de4ac17ac5d67ff4d4c634c444f167878b7eb
2021-06-22 00:20:07 +00:00
Michael Butler
e52a77efaa Simplify NNAPI SharedHandle -- hal
Prior to this CL, the NNAPI represented SharedHandle as a collection of
file descriptors and a vector of ints to act as metadata. This struct
mirrored Android's native_handle_t. However, the NNAPI only uses
SharedHandle to hold a single file descriptor to hold a single cache
file.

A sibling CL simplifies the SharedHandle by changing it to be a single
ref-counted file descriptor. This CL makes changes to the HAL utility
code in response to the SharedHandle change.

Bug: N/A
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Ib390ad76bcdadffd85f8c2c502189aaa7da483e4
2021-06-08 20:14:52 -07:00
Xusong Wang
e3d0dad8d5 Use proper alignment and padding for pointer arguments -- HAL.
This CL modifies the shared memory allocation for pointer arguments to
use proper alignment and padding. We use default alignment (64) and
min padding (1) for HIDL drivers, and default alignment (64) and default
padding (64) for sAIDL drivers.

Bug: 184164929
Test: NNT_static
Change-Id: I22591640fa047d5f75d437edac1a7645d3b05526
Merged-In: I22591640fa047d5f75d437edac1a7645d3b05526
(cherry picked from commit 8bfa243972)
2021-05-11 09:17:34 -07:00
Xusong Wang
b2e8085ce2 Introduce reusable burst to canonical interface -- HAL.
This CL modifies the canonical interface for reusable burst executions:
- Add new method IBurst::createExecution

The reusable burst execution will not fallback to another execution path
if sending request packet fails. The behavior of single-time burst
execution remains unchanged.

Additionally, this CL enables pointer -> shared memory conversion in
1.2/1.3 burst implementation.

Bug: 184073769
Test: NNT_static
Test: neuralnetworks_utils_hal_1_0_test
Test: neuralnetworks_utils_hal_1_1_test
Test: neuralnetworks_utils_hal_1_2_test
Test: neuralnetworks_utils_hal_1_3_test
Test: neuralnetworks_utils_hal_common_test
Change-Id: Iaac81668d247c2cb76d70e6abbd10f00b397b19f
Merged-In: Iaac81668d247c2cb76d70e6abbd10f00b397b19f
(cherry picked from commit ead6d37ae9)
2021-05-10 15:22:08 -07:00
Xusong Wang
5f6bedb43a Introduce reusable execution to canonical interface -- HAL.
This CL modifies the canonical interface for reusable executions:
- Add new interface: IExecution with compute and computeFenced methods
- Add new method IPreparedModel::createExecution

In NNAPI runtime, the new interface IExecution is used to
memoize request-specific execution resources (e.g. converted HAL
request). The expected usage is that, IPreparedModel::createExecution
will be invoked in the first computation of a reusable NDK ANNExecution
object, and IExecution::compute* will be invoked repeatedly.

The IPreparedModel::execute* methods are preserved to avoid redundant
object creation and memoization overhead for a single-time
(non-reusable) execution.

For a vendor implementing the canonical interfaces, only the
IPreparedModel::execute* methods will be called because there is
currently no reusable execution at HAL interface. A DefaultExecution
implementation is provided to reduce the work needed on the vendor side.

Bug: 184073769
Test: NNT_static
Test: neuralnetworks_utils_hal_1_0_test
Test: neuralnetworks_utils_hal_1_1_test
Test: neuralnetworks_utils_hal_1_2_test
Test: neuralnetworks_utils_hal_1_3_test
Test: neuralnetworks_utils_hal_common_test
Test: neuralnetworks_utils_hal_aidl_test
Change-Id: I91790bb5ccf5ae648687fe603f88ffda2c9fd2b2
Merged-In: I91790bb5ccf5ae648687fe603f88ffda2c9fd2b2
(cherry picked from commit 727a7b2104)
2021-05-10 15:21:36 -07:00
Michael Butler
3e9720b83f Remove NN canonical IDevice::isUpdatable -- hal
This CL alters the AIDL utility "getDevices" to return whether or not a
service is updatable. This CL additional removes IDevice::isUpdatable
because it is now redundant with the changes to "getDevices".

Bug: 170696350
Test: mma
Test: NeuralNetworksTest_static
Change-Id: I86228763937c0dd2ee5b1d9d547c367cd7504ed4
2021-04-21 13:27:59 -07:00
Michael Butler
6594b5f1b4 Merge changes from topic "nnapi-aidl-memory"
* changes:
  Update NN utility code and VTS tests with new Memory type
  Improve the structure of NNAPI AIDL Memory
2021-04-13 16:29:33 +00:00
Przemysław Szczepaniak
3cc27f5c62 Set correct API level for NNAPI AIDL service discovery.
Use __ANDROID_API_FUTURE__ until the S version is finalized.

Bug: 183657864
Test: Build & flashed CF, run TFLite benchmark util
Change-Id: I1352aa33866487f955136c6fb8e4d0d279225f13
2021-04-09 11:30:28 +01:00
Michael Butler
f03ebd93b9 Update NN utility code and VTS tests with new Memory type
This CL fixes the compiler errors that arose of changing the Memory
representation of the NN AIDL HAL, and updates the conversion and
utility code to work with the new Memory type.

This change also makes libaidlcommonsupport available to apex modules at
min sdk level 29.

Bug: 183118727
Test: mma
Test: VtsHalNeuralnetworksTargetTest
Change-Id: Ief565473b4d82e0bb43785fc3b8275b16bd26cf6
Merged-In: Ief565473b4d82e0bb43785fc3b8275b16bd26cf6
(cherry picked from commit b0fcb3927d)
2021-04-07 12:54:45 -07:00
Michael Butler
8414a6ebf9 Add additional parameters for NN Burst -- HAL
Adds deadline and loopTimeoutDuration to nn::IBurst::execute.

This CL additionally adds a test case for
IPreparedModel::configureExecutionBurst and adds the suffix "_H" to
the header guards that were missing "_H".

Bug: 180492058
Bug: 177267324
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Ic9ba2fb9b4dee4e40d99ae91bb9555a58d0508d2
Merged-In: Ic9ba2fb9b4dee4e40d99ae91bb9555a58d0508d2
(cherry picked from commit bbbdb0d5f1)
2021-04-02 22:02:38 -07:00
Lev Proleev
2d7195fd32 NNAPI: Add AIDL drivers registration
Bug: 179015258
Test: adb shell setprop debug.nn.partition 2 && \
Test: NeuralNetworksTest_static
Change-Id: I2c8c9a49ff917b243348043df1158a8d98f131ce
Merged-In: I2c8c9a49ff917b243348043df1158a8d98f131ce
(cherry picked from commit 5f732ff683)
2021-03-17 13:32:43 +00:00
Michael Butler
76e491fa46 Implement full canonical Burst in NN util code
Bug: 180492058
Bug: 177267324
Test: mma
Test: presubmit
Change-Id: I5018f6cf2dbaf705f74f4f46318142c64433e19d
Merged-In: I5018f6cf2dbaf705f74f4f46318142c64433e19d
(cherry picked from commit acff4063b6)
2021-03-16 11:57:19 -07:00
Lev Proleev
900c28a250 Add canonical types adapters for NNAPI AIDL interface
Also:
* Add missing AIDL<->CT conversions
* Add AIDL-specific info to neuralnetworks/utils/README.md
* Add mock classes and tests AIDL adapters

Bug: 179015258
Test: neuralnetworks_utils_hal_test
Change-Id: Ifa98fadd46dca5dbf9b3ceb4da811aa8da45b6e4
Merged-In: Ifa98fadd46dca5dbf9b3ceb4da811aa8da45b6e4
(cherry picked from commit 3b93b0b56a)
2021-03-16 11:57:04 -07:00
Bob Badour
bbff7921dc [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces
Added SPDX-license-identifier-Apache-2.0 to:
  neuralnetworks/utils/adapter/Android.bp
  security/keymint/aidl/vts/performance/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I139497d894d893a405d9b16df5e23b69dc82674f
2021-02-26 03:45:46 -08:00