Commit graph

216 commits

Author SHA1 Message Date
Spandan Das
2d7c55d23f Make apex_available of nn hidl interfaces explicit in Android.bp
These are available to com.android.neuralnetworks via the baseline
apexAvailable map in build/soong/apex/apex.go. This CL makes this
explicit in Android.bp

Test: m nothing #passes
Bug: 281077552
Change-Id: I9f08db0dba6b155c6f25393a5d4baf6de27110da
2023-05-05 23:52:38 +00:00
Yabin Cui
1c4ad4f9ad Remove neuralnetworks_float16.
Bug: 254708969
Test: build
Change-Id: Ibf7dba54b61938cae5f9a84d0047a1078978c3ff
2022-11-30 10:17:10 -08:00
Treehugger Robot
73754429ee Merge "Make VtsHalNeuralnetworks* tests more binder-friendly." into android12-tests-dev am: 2a04b4462f am: 2a3972288c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2194136

Change-Id: I1ebf39592d323ef2e4b394c360fe0774da1f6347
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 17:24:25 +00:00
David Gross
79324920f7 Make VtsHalNeuralnetworks* tests more binder-friendly.
Certain mutation testing -- mutateOperandLifeTimeTest and
mutateOperandInputOutputTest -- can introduce potentially very large
CONSTANT_COPY operands, which can in turn create potentially very
large Models which must be passed across binder.  To avoid overflowing
the binder buffer, we estimate the size of the mutated Model, and skip
the test if that size is too high.  The old logic recognizes that our
tests only have a single active binder transaction at a time, and
assumes that there are no other clients using the same service at the
same time, and so we should have the binder buffer to ourselves; to be
conservative, we reject any Model whose estimated size exceeds half
the binder buffer size.  Unfortunately, sometimes the binder buffer
still overflows, because it unexpectedly contains an allocation from
some other transaction: It appears that binder buffer memory
management is not serialized with respect to transactions from our
tests, and therefore depending on scheduler behavior, there may be a
sizeable allocation still in the buffer when we attempt to pass the
large Model.  To fix this problem we become even more conservative,
and instead of limiting the Model to half the binder buffer size, we
limit it to half IBinder.MAX_IPC_SIZE (the recommended transaction
size limit).  To confirm that this change does not exclude too many
tests, I checked how may times the size filter function
exceedsBinderSizeLimit is called, how many times it rejects a model
under the new logic (modelsExceedHalfMaxIPCSize), and how many times
it rejects a model under the old logic (modelsExceedHalfMaxIPCSize).

Test: VtsHalNeuralnetworksV1_0TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models =  3592, modelsExceedHalfMaxIPCSize = 212, modelsExceedHalfBufferSize = 18
Test: VtsHalNeuralnetworksV1_1TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models =  7228, modelsExceedHalfMaxIPCSize = 330, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksV1_2TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models = 52072, modelsExceedHalfMaxIPCSize = 506, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksV1_3TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models = 73342, modelsExceedHalfMaxIPCSize = 568, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksTargetTest

Bug: 227719657
Bug: 227719752
Bug: 231928847
Bug: 238777741
Bug: 242271308

Change-Id: I3f81d71ca3c0ad4c639096b1dc034a8909bc8971
2022-08-25 23:11:41 +00:00
Michael Butler
e8e7a1018c Disable TEST_MAPPING for VtsHalNeuralnetworksV1_*TargetTest
A sibling change removes the NN HIDL sample drivers from cuttlefish. In
response, this change removes the VtsHalNeuralnetworksV1_*TargetTest
tests from the TEST_MAPPING because they do not test anything without
the NN HIDL sample drivers present.

Note that the NN AIDL sample drivers and NN AIDL VTS test
(VtsHalNeuralnetworksTargetTest) are still present.

Bug: 233665601
Test: mma
Test: croot && cd hardware/interfaces/neuralnetworks && atest
Change-Id: I90bccd843ba9296c27d3010cec652be55a13a225
2022-06-08 10:47:22 -07:00
Michael Butler
ad643b608c Move NN_TRY macro out of struct initialization
NNAPI NN_TRY macros use Statement Expressions (a GNU extension) to
propagate errors. However, a "return" statement in a Statement
Expression can lead to memory leaks when the Statement Expression is
being used to initialize a member of a struct. Specifically, when one
member of a struct is already initialized, and a Statement Expression
used to initialize a subsequent member early-returns, the previously
initialized members will not have their destructors called.

This CL moves any NN_TRY macro out of struct initialization to avoid any
potential memory leaks.

Bug: 230500484
Test: mma
Test: presubmit
Change-Id: I3493fd4764f8eacc86750e6414e62bc891abaccd
Merged-In: I3493fd4764f8eacc86750e6414e62bc891abaccd
2022-04-29 14:32:10 -07: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
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
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
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
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
2551b76bb7 Merge "Backfill owner information for VTS module VtsHalNeuralnetworksV1_0TargetTest." 2021-09-10 17:47:44 +00:00
Yiming Pan
31a675d43c Backfill owner information for VTS module VtsHalNeuralnetworksV1_0TargetTest.
Each VTS module is required to have OWNERS file. The ownership is based on
go/vts-owners. For more information about ownership policy, please visit
go/xts-owners-policy.

Test: Tree Hugger
Bug: 143903671
Change-Id: I9f163c163077c25ae88565df778aa26dd81b0947
2021-09-09 14:48:37 -07:00
Michael Butler
8472d91b57 Quickly exit VtsHalNeuralnetworks*TargetTest on failure
This change adds the AndroidTest.xml flag --gtest_break_on_failure to
cause the gtest to terminate after an error has been reached. This early
termination is important in the case where an NN HAL service crashes
mid-test, and all remaining tests would otherwise continue to run.

Bug: 197035200
Test: m vts -j
Test: vts-tradefed
Change-Id: I0b9a14345475e432b93f92c23010a8b39712443a
Merged-In: I0b9a14345475e432b93f92c23010a8b39712443a
(cherry picked from commit ac45a5d77e)
2021-08-25 18:07:20 +00:00
Michael Butler
ac45a5d77e Quickly exit VtsHalNeuralnetworks*TargetTest on failure
This change adds the AndroidTest.xml flag --gtest_break_on_failure to
cause the gtest to terminate after an error has been reached. This early
termination is important in the case where an NN HAL service crashes
mid-test, and all remaining tests would otherwise continue to run.

Bug: 197035200
Test: m vts -j
Test: vts-tradefed
Change-Id: I0b9a14345475e432b93f92c23010a8b39712443a
2021-08-24 23:44:57 -07:00
Michael Butler
77c1b62362 Quick-fail NNAPI VTS test case if driver is dead
This CL adds a check during SetUp that an NNAPI driver service is still
alive by pinging the driver service. If it is not alive, the test will
fail during SetUp. Without this quick-fail, the test case would continue
as if the driver were still active, which would result in multiple
EXPECT_* and ASSERT_* statements failing instead of a single, clear
failure message.

Bug: 197035200
Test: mma
Test: presubmit: VtsHalNeuralnetworks*TargetTest
Change-Id: Ib1b75ed20f764055699590581d5ad4e5aff4baae
Merged-In: Ib1b75ed20f764055699590581d5ad4e5aff4baae
(cherry picked from commit 9c3c8642fb)
2021-08-24 18:53:08 +00:00
Michael Butler
9c3c8642fb Quick-fail NNAPI VTS test case if driver is dead
This CL adds a check during SetUp that an NNAPI driver service is still
alive by pinging the driver service. If it is not alive, the test will
fail during SetUp. Without this quick-fail, the test case would continue
as if the driver were still active, which would result in multiple
EXPECT_* and ASSERT_* statements failing instead of a single, clear
failure message.

Bug: 197035200
Test: mma
Test: presubmit: VtsHalNeuralnetworks*TargetTest
Change-Id: Ib1b75ed20f764055699590581d5ad4e5aff4baae
2021-08-23 18:27:49 -07: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
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
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
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
Xusong Wang
8bfa243972 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
2021-05-07 14:13:22 -07:00
Xusong Wang
ead6d37ae9 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
2021-05-06 13:56:52 -07:00
Xusong Wang
727a7b2104 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
2021-05-06 13:56:32 -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
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
Michael Butler
388bcebc8f Add missing validation for NN canonical types
Bug: 177669661
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Ic05c177f61a906a69bf82ff9c4d5bb8b0556d5ca
Merged-In: Ic05c177f61a906a69bf82ff9c4d5bb8b0556d5ca
(cherry picked from commit 08ee3f9287)
2021-04-02 22:02:02 -07:00
Slava Shklyaev
6910bec12f Move NNAPI type information to types.spec
See change Ic31ed957.

The changes to the *.t files in this CL do not introduce any changes to
the generated *.hal files.

Bug: 160667417
Test: generate_api.sh
Change-Id: Ie2dbbc0fc92e52b08adc807a7f514bd8945a055f
Merged-In: Ie2dbbc0fc92e52b08adc807a7f514bd8945a055f
(cherry picked from commit 14c1f985b0)
2021-03-17 13:32:50 +00:00
Michael Butler
65de531533 Merge changes from topic "nnapi-numberOfConsumers"
* changes:
  Create NNAPI adapter interface
  Make NNAPI countNumberOfConsumers return GeneralResult -- hal
2021-02-23 20:01:01 +00:00
Przemysław Szczepaniak
a02e5e517f Non ABI changes to neuralnetworks HAL
NNAPI HAL comment strings were reformated due to
template changes for new versioning scheme.

Test: Image built
Bug: 177298018
Change-Id: I67b3a38c087edf6ba3c295f5ac43ca02b8359f6a
Merged-In: I67b3a38c087edf6ba3c295f5ac43ca02b8359f6a
(cherry picked from commit 87ff8d20ae)
2021-02-22 17:24:43 +00:00
Bob Badour
b224b363de [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces
Added SPDX-license-identifier-Apache-2.0 to:
  atrace/1.0/Android.bp
  atrace/1.0/default/Android.bp
  atrace/1.0/vts/functional/Android.bp
  audio/2.0/Android.bp
  audio/2.0/config/Android.bp
  audio/4.0/Android.bp
  audio/4.0/config/Android.bp
  audio/5.0/Android.bp
  audio/5.0/config/Android.bp
  audio/6.0/Android.bp
  audio/6.0/config/Android.bp
  audio/7.0/Android.bp
  audio/7.0/config/Android.bp
  audio/common/2.0/Android.bp
  audio/common/4.0/Android.bp
  audio/common/5.0/Android.bp
  audio/common/6.0/Android.bp
  audio/common/7.0/Android.bp
  audio/common/7.0/example/Android.bp
  audio/common/all-versions/default/Android.bp
  audio/common/all-versions/default/service/Android.bp
  audio/common/all-versions/test/utility/Android.bp
  audio/common/all-versions/util/Android.bp
  audio/core/all-versions/default/Android.bp
  audio/core/all-versions/default/util/Android.bp
  audio/core/all-versions/vts/functional/Android.bp
  audio/effect/2.0/Android.bp
  audio/effect/2.0/xml/Android.bp
  audio/effect/4.0/Android.bp
  audio/effect/4.0/xml/Android.bp
  audio/effect/5.0/Android.bp
  audio/effect/5.0/xml/Android.bp
  audio/effect/6.0/Android.bp
  audio/effect/6.0/xml/Android.bp
  audio/effect/7.0/Android.bp
  audio/effect/7.0/xml/Android.bp
  audio/effect/all-versions/default/Android.bp
  audio/effect/all-versions/default/util/Android.bp
  audio/effect/all-versions/vts/functional/Android.bp
  audio/policy/1.0/vts/functional/Android.bp
  audio/policy/1.0/xml/Android.bp
  audio/policy/1.0/xml/pfw_schemas/Android.bp
  authsecret/1.0/Android.bp
  authsecret/1.0/default/Android.bp
  authsecret/1.0/vts/functional/Android.bp
  authsecret/aidl/Android.bp
  authsecret/aidl/default/Android.bp
  authsecret/aidl/vts/Android.bp
  automotive/audiocontrol/1.0/Android.bp
  automotive/audiocontrol/1.0/default/Android.bp
  automotive/audiocontrol/1.0/vts/functional/Android.bp
  automotive/audiocontrol/2.0/Android.bp
  automotive/audiocontrol/2.0/default/Android.bp
  automotive/audiocontrol/2.0/vts/functional/Android.bp
  automotive/can/1.0/default/libnetdevice/Android.bp
  automotive/can/1.0/hidl-utils/Android.bp
  automotive/can/1.0/tools/Android.bp
  automotive/can/1.0/tools/configurator/Android.bp
  automotive/can/1.0/tools/configurator/proto/Android.bp
  automotive/can/1.0/tools/libcanhaltools/Android.bp
  automotive/can/1.0/vts/functional/Android.bp
  automotive/can/1.0/vts/utils/Android.bp
  automotive/evs/1.0/Android.bp
  automotive/evs/1.0/default/Android.bp
  automotive/evs/1.0/vts/functional/Android.bp
  automotive/evs/1.1/Android.bp
  automotive/evs/1.1/default/Android.bp
  automotive/evs/1.1/vts/functional/Android.bp
  automotive/evs/1.1/vts/fuzzing/Android.bp
  automotive/evs/common/utils/default/Android.bp
  automotive/evs/common/utils/default/test/fuzz/Android.bp
  automotive/occupant_awareness/aidl/Android.bp
  automotive/occupant_awareness/aidl/default/Android.bp
  automotive/occupant_awareness/aidl/mock/Android.bp
  automotive/occupant_awareness/aidl/vts/functional/Android.bp
  automotive/sv/1.0/Android.bp
  automotive/sv/1.0/default/Android.bp
  automotive/sv/1.0/vts/functional/Android.bp
  automotive/vehicle/2.0/Android.bp
  automotive/vehicle/2.0/default/Android.bp
  automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp
  automotive/vehicle/2.0/utils/Android.bp
  biometrics/face/1.0/Android.bp
  biometrics/face/1.0/default/Android.bp
  biometrics/face/1.0/vts/functional/Android.bp
  biometrics/fingerprint/2.1/Android.bp
  biometrics/fingerprint/2.1/default/Android.bp
  biometrics/fingerprint/2.1/vts/functional/Android.bp
  biometrics/fingerprint/2.2/Android.bp
  biometrics/fingerprint/2.2/vts/functional/Android.bp
  bluetooth/1.0/Android.bp
  bluetooth/1.0/default/Android.bp
  bluetooth/1.0/vts/functional/Android.bp
  bluetooth/1.1/Android.bp
  bluetooth/1.1/default/Android.bp
  bluetooth/1.1/vts/functional/Android.bp
  bluetooth/a2dp/1.0/Android.bp
  bluetooth/a2dp/1.0/default/Android.bp
  bluetooth/a2dp/1.0/vts/functional/Android.bp
  bluetooth/audio/2.0/Android.bp
  bluetooth/audio/2.0/default/Android.bp
  bluetooth/audio/2.0/vts/functional/Android.bp
  bluetooth/audio/2.1/Android.bp
  bluetooth/audio/2.1/default/Android.bp
  bluetooth/audio/2.1/vts/functional/Android.bp
  bluetooth/audio/utils/Android.bp
  boot/1.0/Android.bp
  boot/1.0/default/Android.bp
  boot/1.0/vts/functional/Android.bp
  boot/1.1/Android.bp
  boot/1.1/default/Android.bp
  boot/1.1/default/boot_control/Android.bp
  boot/1.1/vts/functional/Android.bp
  boot/1.2/Android.bp
  boot/1.2/default/Android.bp
  boot/1.2/vts/functional/Android.bp
  broadcastradio/1.0/Android.bp
  broadcastradio/1.0/default/Android.bp
  broadcastradio/1.0/vts/functional/Android.bp
  broadcastradio/1.1/Android.bp
  broadcastradio/1.1/default/Android.bp
  broadcastradio/1.1/vts/functional/Android.bp
  broadcastradio/2.0/Android.bp
  broadcastradio/2.0/default/Android.bp
  broadcastradio/2.0/vts/functional/Android.bp
  broadcastradio/common/tests/Android.bp
  broadcastradio/common/utils/Android.bp
  broadcastradio/common/utils1x/Android.bp
  broadcastradio/common/utils2x/Android.bp
  broadcastradio/common/vts/utils/Android.bp
  camera/common/1.0/Android.bp
  camera/common/1.0/default/Android.bp
  camera/device/1.0/Android.bp
  camera/device/1.0/default/Android.bp
  camera/device/3.2/Android.bp
  camera/device/3.2/default/Android.bp
  camera/device/3.3/Android.bp
  camera/device/3.3/default/Android.bp
  camera/device/3.4/Android.bp
  camera/device/3.4/default/Android.bp
  camera/device/3.5/Android.bp
  camera/device/3.5/default/Android.bp
  camera/device/3.6/Android.bp
  camera/device/3.6/default/Android.bp
  camera/metadata/3.2/Android.bp
  camera/metadata/3.3/Android.bp
  camera/metadata/3.4/Android.bp
  camera/metadata/3.5/Android.bp
  camera/provider/2.4/Android.bp
  camera/provider/2.4/default/Android.bp
  camera/provider/2.4/vts/functional/Android.bp
  camera/provider/2.5/Android.bp
  camera/provider/2.5/default/Android.bp
  camera/provider/2.6/Android.bp
  cas/1.0/Android.bp
  cas/1.0/default/Android.bp
  cas/1.0/vts/functional/Android.bp
  cas/1.1/Android.bp
  cas/1.1/default/Android.bp
  cas/1.1/vts/functional/Android.bp
  cas/1.2/Android.bp
  cas/1.2/default/Android.bp
  cas/1.2/vts/functional/Android.bp
  cas/native/1.0/Android.bp
  common/aidl/Android.bp
  common/fmq/aidl/Android.bp
  common/support/Android.bp
  compatibility_matrices/Android.bp
  compatibility_matrices/Android.mk
  compatibility_matrices/build/Android.bp
  compatibility_matrices/exclude/Android.bp
  configstore/1.0/Android.bp
  configstore/1.0/vts/functional/Android.bp
  configstore/1.1/Android.bp
  configstore/1.1/default/Android.mk
  configstore/utils/Android.bp
  confirmationui/1.0/Android.bp
  confirmationui/1.0/default/Android.bp
  confirmationui/1.0/vts/functional/Android.bp
  confirmationui/support/Android.bp
  contexthub/1.0/Android.bp
  contexthub/1.0/default/Android.bp
  contexthub/1.0/vts/functional/Android.bp
  contexthub/1.1/Android.bp
  contexthub/1.1/default/Android.bp
  contexthub/1.1/vts/functional/Android.bp
  contexthub/common/vts/Android.bp
  drm/1.0/Android.bp
  drm/1.0/default/Android.bp
  drm/1.0/vts/functional/Android.bp
  drm/1.1/Android.bp
  drm/1.1/vts/functional/Android.bp
  drm/1.2/Android.bp
  drm/1.2/vts/functional/Android.bp
  drm/1.3/Android.bp
  drm/1.3/vts/functional/Android.bp
  dumpstate/1.0/Android.bp
  dumpstate/1.0/default/Android.bp
  dumpstate/1.0/vts/functional/Android.bp
  dumpstate/1.1/Android.bp
  dumpstate/1.1/default/Android.bp
  dumpstate/1.1/vts/functional/Android.bp
  fastboot/1.0/Android.bp
  fastboot/1.0/default/Android.bp
  fastboot/1.1/Android.bp
  fastboot/1.1/default/Android.bp
  gatekeeper/1.0/Android.bp
  gatekeeper/1.0/default/Android.bp
  gatekeeper/1.0/software/Android.bp
  gatekeeper/1.0/software/tests/Android.bp
  gatekeeper/1.0/vts/functional/Android.bp
  gnss/1.0/Android.bp
  gnss/1.0/default/Android.bp
  gnss/1.0/vts/functional/Android.bp
  gnss/1.1/Android.bp
  gnss/1.1/default/Android.bp
  gnss/1.1/vts/functional/Android.bp
  gnss/2.0/Android.bp
  gnss/2.0/default/Android.bp
  gnss/2.0/vts/functional/Android.bp
  gnss/2.1/Android.bp
  gnss/2.1/default/Android.bp
  gnss/2.1/vts/functional/Android.bp
  gnss/common/utils/default/Android.bp
  gnss/common/utils/vts/Android.bp
  gnss/measurement_corrections/1.0/Android.bp
  gnss/measurement_corrections/1.1/Android.bp
  gnss/visibility_control/1.0/Android.bp
  graphics/allocator/2.0/Android.bp
  graphics/allocator/2.0/default/Android.bp
  graphics/allocator/2.0/utils/gralloc1-adapter/Android.bp
  graphics/allocator/2.0/utils/hal/Android.bp
  graphics/allocator/2.0/utils/passthrough/Android.bp
  graphics/allocator/3.0/Android.bp
  graphics/allocator/4.0/Android.bp
  graphics/bufferqueue/1.0/Android.bp
  graphics/bufferqueue/2.0/Android.bp
  graphics/common/1.0/Android.bp
  graphics/common/1.1/Android.bp
  graphics/common/1.2/Android.bp
  graphics/common/aidl/Android.bp
  graphics/composer/2.1/Android.bp
  graphics/composer/2.1/default/Android.bp
  graphics/composer/2.1/utils/command-buffer/Android.bp
  graphics/composer/2.1/utils/hal/Android.bp
  graphics/composer/2.1/utils/hwc2on1adapter/Android.bp
  graphics/composer/2.1/utils/hwc2onfbadapter/Android.bp
  graphics/composer/2.1/utils/passthrough/Android.bp
  graphics/composer/2.1/utils/resources/Android.bp
  graphics/composer/2.1/utils/vts/Android.bp
  graphics/composer/2.1/vts/functional/Android.bp
  graphics/composer/2.2/Android.bp
  graphics/composer/2.2/default/Android.mk
  graphics/composer/2.2/utils/command-buffer/Android.bp
  graphics/composer/2.2/utils/hal/Android.bp
  graphics/composer/2.2/utils/passthrough/Android.bp
  graphics/composer/2.2/utils/resources/Android.bp
  graphics/composer/2.2/utils/vts/Android.bp
  graphics/composer/2.2/vts/functional/Android.bp
  graphics/composer/2.3/Android.bp
  graphics/composer/2.3/default/Android.bp
  graphics/composer/2.3/utils/command-buffer/Android.bp
  graphics/composer/2.3/utils/hal/Android.bp
  graphics/composer/2.3/utils/passthrough/Android.bp
  graphics/composer/2.3/utils/vts/Android.bp
  graphics/composer/2.3/vts/functional/Android.bp
  graphics/composer/2.4/Android.bp
  graphics/composer/2.4/default/Android.bp
  graphics/composer/2.4/utils/command-buffer/Android.bp
  graphics/composer/2.4/utils/hal/Android.bp
  graphics/composer/2.4/utils/passthrough/Android.bp
  graphics/composer/2.4/utils/vts/Android.bp
  graphics/composer/2.4/vts/functional/Android.bp
  graphics/mapper/2.0/Android.bp
  graphics/mapper/2.0/default/Android.bp
  graphics/mapper/2.0/utils/hal/Android.bp
  graphics/mapper/2.0/utils/passthrough/Android.bp
  graphics/mapper/2.0/utils/vts/Android.bp
  graphics/mapper/2.0/vts/functional/Android.bp
  graphics/mapper/2.1/Android.bp
  graphics/mapper/2.1/default/Android.bp
  graphics/mapper/2.1/utils/hal/Android.bp
  graphics/mapper/2.1/utils/passthrough/Android.bp
  graphics/mapper/2.1/utils/vts/Android.bp
  graphics/mapper/2.1/vts/functional/Android.bp
  graphics/mapper/3.0/Android.bp
  graphics/mapper/3.0/utils/vts/Android.bp
  graphics/mapper/3.0/vts/functional/Android.bp
  graphics/mapper/4.0/Android.bp
  graphics/mapper/4.0/utils/vts/Android.bp
  graphics/mapper/4.0/vts/functional/Android.bp
  health/1.0/Android.bp
  health/1.0/default/Android.bp
  health/2.0/Android.bp
  health/2.0/default/Android.bp
  health/2.0/utils/libhealthhalutils/Android.bp
  health/2.0/utils/libhealthservice/Android.bp
  health/2.0/utils/libhealthstoragedefault/Android.bp
  health/2.0/vts/functional/Android.bp
  health/2.1/Android.bp
  health/2.1/default/Android.bp
  health/2.1/vts/functional/Android.bp
  health/storage/1.0/Android.bp
  health/storage/1.0/default/Android.bp
  health/storage/1.0/vts/functional/Android.bp
  health/storage/aidl/Android.bp
  health/storage/aidl/default/Android.bp
  health/storage/aidl/vts/functional/Android.bp
  health/storage/impl_common/Android.bp
  health/storage/test_common/Android.bp
  health/utils/libhealth2impl/Android.bp
  health/utils/libhealthloop/Android.bp
  identity/aidl/Android.bp
  identity/aidl/default/Android.bp
  identity/aidl/vts/Android.bp
  identity/support/Android.bp
  input/classifier/1.0/Android.bp
  input/classifier/1.0/default/Android.bp
  input/classifier/1.0/vts/functional/Android.bp
  input/common/1.0/Android.bp
  ir/1.0/Android.bp
  ir/1.0/default/Android.bp
  ir/1.0/vts/functional/Android.bp
  keymaster/3.0/Android.bp
  keymaster/3.0/default/Android.mk
  keymaster/3.0/vts/functional/Android.bp
  keymaster/4.0/Android.bp
  keymaster/4.0/default/Android.bp
  keymaster/4.0/support/Android.bp
  keymaster/4.0/vts/functional/Android.bp
  keymaster/4.0/vts/performance/Android.bp
  keymaster/4.1/Android.bp
  keymaster/4.1/default/Android.bp
  keymaster/4.1/support/Android.bp
  keymaster/4.1/vts/functional/Android.bp
  keymaster/aidl/Android.bp
  light/2.0/Android.bp
  light/2.0/default/Android.bp
  light/2.0/vts/functional/Android.bp
  light/aidl/Android.bp
  light/aidl/default/Android.bp
  light/aidl/vts/functional/Android.bp
  light/utils/Android.bp
  media/1.0/Android.bp
  media/1.0/xml/Android.mk
  media/Android.bp
  media/bufferpool/1.0/Android.bp
  media/bufferpool/2.0/Android.bp
  media/c2/1.0/Android.bp
  media/c2/1.1/Android.bp
  media/omx/1.0/Android.bp
  media/omx/1.0/vts/functional/audio/Android.bp
  media/omx/1.0/vts/functional/common/Android.bp
  media/omx/1.0/vts/functional/component/Android.bp
  media/omx/1.0/vts/functional/store/Android.bp
  media/omx/1.0/vts/functional/video/Android.bp
  memtrack/1.0/Android.bp
  memtrack/1.0/default/Android.bp
  memtrack/1.0/vts/functional/Android.bp
  memtrack/aidl/Android.bp
  memtrack/aidl/default/Android.bp
  memtrack/aidl/vts/Android.bp
  neuralnetworks/1.0/Android.bp
  neuralnetworks/1.0/utils/Android.bp
  neuralnetworks/1.0/vts/functional/Android.bp
  neuralnetworks/1.1/Android.bp
  neuralnetworks/1.1/utils/Android.bp
  neuralnetworks/1.1/vts/functional/Android.bp
  neuralnetworks/1.2/Android.bp
  neuralnetworks/1.2/utils/Android.bp
  neuralnetworks/1.2/vts/functional/Android.bp
  neuralnetworks/1.3/Android.bp
  neuralnetworks/1.3/utils/Android.bp
  neuralnetworks/1.3/vts/functional/Android.bp
  neuralnetworks/aidl/Android.bp
  neuralnetworks/aidl/utils/Android.bp
  neuralnetworks/aidl/vts/functional/Android.bp
  neuralnetworks/utils/common/Android.bp
  neuralnetworks/utils/service/Android.bp
  nfc/1.0/Android.bp
  nfc/1.0/default/Android.bp
  nfc/1.0/vts/functional/Android.bp
  nfc/1.1/Android.bp
  nfc/1.1/vts/functional/Android.bp
  nfc/1.2/Android.bp
  nfc/1.2/vts/functional/Android.bp
  oemlock/1.0/Android.bp
  oemlock/1.0/vts/functional/Android.bp
  oemlock/aidl/Android.bp
  oemlock/aidl/default/Android.bp
  oemlock/aidl/vts/Android.bp
  power/1.0/Android.bp
  power/1.0/default/Android.bp
  power/1.0/vts/functional/Android.bp
  power/1.1/Android.bp
  power/1.1/vts/functional/Android.bp
  power/1.2/Android.bp
  power/1.2/vts/functional/Android.bp
  power/1.3/Android.bp
  power/1.3/vts/functional/Android.bp
  power/aidl/Android.bp
  power/aidl/default/Android.bp
  power/aidl/vts/Android.bp
  power/stats/1.0/Android.bp
  power/stats/1.0/default/Android.bp
  power/stats/1.0/vts/functional/Android.bp
  power/stats/aidl/Android.bp
  power/stats/aidl/default/Android.bp
  power/stats/aidl/vts/Android.bp
  radio/1.0/Android.bp
  radio/1.0/vts/functional/Android.bp
  radio/1.1/Android.bp
  radio/1.1/vts/functional/Android.bp
  radio/1.2/Android.bp
  radio/1.2/default/Android.bp
  radio/1.2/vts/functional/Android.bp
  radio/1.3/Android.bp
  radio/1.3/vts/functional/Android.bp
  radio/1.4/Android.bp
  radio/1.4/vts/functional/Android.bp
  radio/1.5/Android.bp
  radio/1.5/vts/functional/Android.bp
  radio/1.6/Android.bp
  radio/1.6/vts/functional/Android.bp
  radio/config/1.0/Android.bp
  radio/config/1.0/default/Android.bp
  radio/config/1.0/vts/functional/Android.bp
  radio/config/1.1/Android.bp
  radio/config/1.1/vts/functional/Android.bp
  radio/config/1.2/Android.bp
  radio/config/1.2/vts/functional/Android.bp
  radio/config/1.3/Android.bp
  radio/config/1.3/vts/functional/Android.bp
  radio/deprecated/1.0/Android.bp
  rebootescrow/aidl/Android.bp
  rebootescrow/aidl/default/Android.bp
  rebootescrow/aidl/vts/functional/Android.bp
  renderscript/1.0/Android.bp
  renderscript/1.0/default/Android.bp
  renderscript/1.0/vts/functional/Android.bp
  secure_element/1.0/Android.bp
  secure_element/1.0/vts/functional/Android.bp
  secure_element/1.1/Android.bp
  secure_element/1.1/vts/functional/Android.bp
  secure_element/1.2/Android.bp
  secure_element/1.2/vts/functional/Android.bp
  security/keymint/aidl/Android.bp
  security/keymint/aidl/default/Android.bp
  security/keymint/aidl/vts/functional/Android.bp
  security/keymint/support/Android.bp
  security/secureclock/aidl/Android.bp
  security/secureclock/aidl/vts/functional/Android.bp
  security/sharedsecret/aidl/Android.bp
  security/sharedsecret/aidl/vts/functional/Android.bp
  sensors/1.0/Android.bp
  sensors/1.0/default/Android.bp
  sensors/1.0/vts/functional/Android.bp
  sensors/2.0/Android.bp
  sensors/2.0/default/Android.bp
  sensors/2.0/multihal/Android.bp
  sensors/2.0/vts/functional/Android.bp
  sensors/2.1/Android.bp
  sensors/2.1/default/Android.bp
  sensors/2.1/multihal/Android.bp
  sensors/2.1/vts/functional/Android.bp
  sensors/common/default/2.X/Android.bp
  sensors/common/default/2.X/multihal/Android.bp
  sensors/common/default/2.X/multihal/tests/Android.bp
  sensors/common/utils/Android.bp
  sensors/common/vts/2_X/Android.bp
  sensors/common/vts/utils/Android.bp
  soundtrigger/2.0/Android.bp
  soundtrigger/2.0/default/Android.bp
  soundtrigger/2.0/default/Android.mk
  soundtrigger/2.0/vts/functional/Android.bp
  soundtrigger/2.1/Android.bp
  soundtrigger/2.1/default/Android.mk
  soundtrigger/2.1/vts/functional/Android.bp
  soundtrigger/2.2/Android.bp
  soundtrigger/2.2/default/Android.bp
  soundtrigger/2.2/vts/functional/Android.bp
  soundtrigger/2.3/Android.bp
  soundtrigger/2.3/default/Android.bp
  soundtrigger/2.3/vts/functional/Android.bp
  tests/bar/1.0/Android.bp
  tests/bar/1.0/default/Android.bp
  tests/baz/1.0/Android.bp
  tests/baz/1.0/default/Android.bp
  tests/expression/1.0/Android.bp
  tests/extension/light/2.0/Android.bp
  tests/extension/light/2.0/default/Android.bp
  tests/extension/vibrator/aidl/Android.bp
  tests/extension/vibrator/aidl/client/Android.bp
  tests/extension/vibrator/aidl/default/Android.bp
  tests/foo/1.0/Android.bp
  tests/foo/1.0/default/Android.bp
  tests/foo/1.0/default/lib/Android.bp
  tests/hash/1.0/Android.bp
  tests/hash/1.0/default/Android.bp
  tests/inheritance/1.0/Android.bp
  tests/inheritance/1.0/default/Android.bp
  tests/lazy/1.0/Android.bp
  tests/lazy/1.1/Android.bp
  tests/libhwbinder/1.0/Android.bp
  tests/libhwbinder/1.0/default/Android.bp
  tests/libhwbinder/aidl/Android.bp
  tests/memory/1.0/Android.bp
  tests/memory/1.0/default/Android.bp
  tests/memory/2.0/Android.bp
  tests/msgq/1.0/Android.bp
  tests/msgq/1.0/default/Android.bp
  tests/multithread/1.0/Android.bp
  tests/multithread/1.0/default/Android.bp
  tests/safeunion/1.0/Android.bp
  tests/safeunion/1.0/default/Android.bp
  tests/safeunion/cpp/1.0/Android.bp
  tests/safeunion/cpp/1.0/default/Android.bp
  tests/trie/1.0/Android.bp
  tests/trie/1.0/default/Android.bp
  tetheroffload/config/1.0/Android.bp
  tetheroffload/config/1.0/vts/functional/Android.bp
  tetheroffload/control/1.0/Android.bp
  tetheroffload/control/1.0/vts/functional/Android.bp
  tetheroffload/control/1.1/Android.bp
  tetheroffload/control/1.1/vts/functional/Android.bp
  thermal/1.0/Android.bp
  thermal/1.0/default/Android.bp
  thermal/1.0/vts/functional/Android.bp
  thermal/1.1/Android.bp
  thermal/1.1/vts/functional/Android.bp
  thermal/2.0/Android.bp
  thermal/2.0/default/Android.bp
  thermal/2.0/vts/functional/Android.bp
  tv/cec/1.0/Android.bp
  tv/cec/1.0/default/Android.bp
  tv/input/1.0/Android.bp
  tv/input/1.0/default/Android.bp
  tv/input/1.0/vts/functional/Android.bp
  tv/tuner/1.0/Android.bp
  tv/tuner/1.0/default/Android.bp
  tv/tuner/1.0/vts/functional/Android.bp
  usb/1.0/Android.bp
  usb/1.0/default/Android.bp
  usb/1.0/vts/functional/Android.bp
  usb/1.1/Android.bp
  usb/1.1/vts/functional/Android.bp
  usb/1.2/Android.bp
  usb/1.2/vts/functional/Android.bp
  usb/gadget/1.0/Android.bp
  usb/gadget/1.1/Android.bp
  usb/gadget/1.1/default/Android.bp
  usb/gadget/1.1/default/lib/Android.bp
  vibrator/1.0/Android.bp
  vibrator/1.0/default/Android.bp
  vibrator/1.0/vts/functional/Android.bp
  vibrator/1.1/Android.bp
  vibrator/1.1/vts/functional/Android.bp
  vibrator/1.2/Android.bp
  vibrator/1.2/vts/functional/Android.bp
  vibrator/1.3/Android.bp
  vibrator/1.3/example/Android.bp
  vibrator/1.3/vts/functional/Android.bp
  vibrator/aidl/Android.bp
  vibrator/aidl/default/Android.bp
  vibrator/aidl/vts/Android.bp
  vr/1.0/Android.bp
  vr/1.0/default/Android.bp
  vr/1.0/vts/functional/Android.bp
  weaver/1.0/Android.bp
  weaver/1.0/vts/functional/Android.bp
  weaver/aidl/Android.bp
  weaver/aidl/default/Android.bp
  weaver/aidl/vts/Android.bp
  wifi/1.0/Android.bp
  wifi/1.0/vts/functional/Android.bp
  wifi/1.1/Android.bp
  wifi/1.1/vts/functional/Android.bp
  wifi/1.2/Android.bp
  wifi/1.2/vts/functional/Android.bp
  wifi/1.3/Android.bp
  wifi/1.3/vts/functional/Android.bp
  wifi/1.4/Android.bp
  wifi/1.4/default/Android.mk
  wifi/1.4/vts/functional/Android.bp
  wifi/hostapd/1.0/Android.bp
  wifi/hostapd/1.0/vts/functional/Android.bp
  wifi/hostapd/1.1/Android.bp
  wifi/hostapd/1.1/vts/functional/Android.bp
  wifi/hostapd/1.2/Android.bp
  wifi/hostapd/1.2/vts/functional/Android.bp
  wifi/offload/1.0/Android.bp
  wifi/offload/1.0/vts/functional/Android.bp
  wifi/supplicant/1.0/Android.bp
  wifi/supplicant/1.0/vts/functional/Android.bp
  wifi/supplicant/1.1/Android.bp
  wifi/supplicant/1.1/vts/functional/Android.bp
  wifi/supplicant/1.2/Android.bp
  wifi/supplicant/1.2/vts/functional/Android.bp
  wifi/supplicant/1.3/Android.bp
  wifi/supplicant/1.3/vts/functional/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-NCSA to:
  Android.bp
  automotive/can/1.0/Android.bp
  automotive/can/1.0/default/Android.bp

Added SPDX-license-identifier-NCSA to:
  automotive/can/1.0/default/libc++fs/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: I602b072f77ff41e9eb8d3c36b6b5315d63664006
Merged-in: I602b072f77ff41e9eb8d3c36b6b5315d63664006
2021-02-21 20:36:55 -08:00
Michael Butler
68b6926e3c Make NNAPI countNumberOfConsumers return GeneralResult -- hal
Previously, countNumberOfConsumers would trigger a CHECK if the input
was invalid. This CL makes countNumberOfConsumers gracefully fail on
errors, instead returning the error through the GeneralResult.

Bug: N/A
Test: mma
Change-Id: Iee54f87768e52fdf701c22d94083c053b881733d
Merged-In: Iee54f87768e52fdf701c22d94083c053b881733d
(cherry picked from commit c4d98007fd)
2021-02-19 17:34:32 -08:00
Michael Butler
ab2f482af3 Store AHWB in NN canonical memory type -- hal
Prior to this CL, the canonical memory type only held a SharedHandle,
which mirrors the behavior of native_handle_t/hidl_handle. This means
memory types including AHardwareBuffer were stored as this SharedHandle
type. With this CL, the canonical memory type is stored directly as
AHardwareBuffer to avoid using non-NDK AHardwareBuffer calls in the NN
runtime.

Bug: 179906132
Test: mma
Test: NeuralNetworksTest_static
Test: presubmit
Change-Id: I394071c193d15ac0c90ac47e5a2a9a79c635db6c
Merged-In: I394071c193d15ac0c90ac47e5a2a9a79c635db6c
(cherry picked from commit bbe43d950e)
2021-02-17 10:15:39 -08:00
Michael Butler
fadeb8a920 Change NNAPI Memory to ref-counted SharedMemory -- hal
Bug: 179906132
Test: mma
Test: NeuralNetworksTest_static
Test: presubmit
Change-Id: I6435db906a2efe4938da18149a1fcd6d24730a95
Merged-In: I6435db906a2efe4938da18149a1fcd6d24730a95
(cherry picked from commit 79a16ebb6f)
2021-02-17 10:15:09 -08:00
Michael Butler
e5e67024c6 Add dynamic interface casting to NN utility code
Prior to this CL, the NN utility code would always use the type of
IPreparedModel provided by IPreparedModeCallback::notify*. This means
that an IPreparedModel returned as a dynamic type of V1_X but static
type of V1_Y would be used by the utility code as V1_Y. This CL adds
dynamic casting, such that an IPreparedModel returned as a dynamic type
of V1_X but static type V1_Y will be dynamically cast to V1_X and used
as a V1_X::IPreparedModel.

This CL also adds the utility functions
V1_[0123]::convertFromNonCanonical to convert from a non-canonical type
to another non-canonical type by using canonical types as an
intermediate conversion "hop."

Bug: 178180472
Test: mma
Change-Id: I709b2a8944af2cc78b089aade55df1e2ab7b40cc
Merged-In: I709b2a8944af2cc78b089aade55df1e2ab7b40cc
(cherry picked from commit 49b5e4ebea)
2021-02-09 15:28:15 +00:00
Xusong Wang
eafa06164d Merge "Increase NNAPI VTS single-test timeout to 20m." 2021-01-22 21:20:57 +00:00
Michael Butler
95331510ad Implement partial canonical Burst in NN util code
This CL adds a simple implementation of IBurst that dispatches calls to
an IPreparedModel object and changes
IPreparedModel::configureExecutionBurst to return this new object
(instead of returning an error).

This CL additionally defines an InvalidBurst class that returns errors
whenever it is used and a ResilientBurst class to recover an IBurst
object when it has died.

Bug: 177267324
Test: mma
Change-Id: I4c7e7ff4e6559aeb5e62c4fa02f2e751fef9d87d
Merged-In: I4c7e7ff4e6559aeb5e62c4fa02f2e751fef9d87d
(cherry picked from commit 44f324fb0d)
2021-01-19 16:21:17 +00:00
Michael Butler
2a8b679bba Introduce canonical IBurst object in NNAPI -- hal
A sibling change to this change introduces a canonical IBurst object and
a new method IPreparedModel::configureExecutionBurst. This CL performs
minimal changes to the NN hal utility code to make the code still
compile.

Bug: 177267324
Test: mma
Change-Id: I076067289dde7def5622a6cb25233619f80efa41
Merged-In: I076067289dde7def5622a6cb25233619f80efa41
(cherry picked from commit b6a7ed5d5f)
2021-01-19 16:21:07 +00:00
Michael Butler
9adab0cf49 Add isUpdatable to NNAPI canonical IDevice -- hal
Bug: 177284207
Test: mma
Change-Id: I580d5325be91f566ee1c591736a87a94d0a74315
Merged-In: I580d5325be91f566ee1c591736a87a94d0a74315
(cherry picked from commit 080fbf755c)
2021-01-19 16:21:01 +00:00
Michael Butler
6e492a62e1 Create unit tests for NN interface utility code
This CL introduces unit tests to validate the V1_X::utils::Device,
*PreparedModel, and *Buffer adapter classes. It does so by mocking the
underlying HIDL interface in order to simulate a driver returning bad
data, HIDL transport failures, and service crashes.

Note that the purpose of these new tests is to validate the adapter
classes themselves, not the HIDL interfaces they use. For example,
because nn::IPreparedModel does not currently define a method for
configuring a burst execution, V1_[23]::utils::PreparedModel similarly
does not use hardware::neuralnetworks::V1_[23]::IPreparedModel's
configureExecutionBurst method.

This CL also introduces unit tests to validate the utils::Resilient*
adapter classes, and mocks DEAD_OBJECT failures to ensure that the
underyling object can be recovered appropriately.

Bug: 163801800
Test: mma
Test: atest neuralnetworks_utils_hal_common_test
Test: atest neuralnetworks_utils_hal_1_[0-3]_test
Change-Id: I2c79865bf666d3f4bf53061ff5090746403583e9
Merged-In: I2c79865bf666d3f4bf53061ff5090746403583e9
(cherry picked from commit afc4d7cfe7)
2021-01-08 12:07:43 -08:00