summaryrefslogtreecommitdiff
path: root/neuralnetworks
AgeCommit message (Collapse)Author
2023-01-04Merge t-mpr-2023-01Matt Lee
Change-Id: I6b3acf023780524076585f8c581f258d2635093a
2022-12-14Add additional bounds checks to NNAPI FMQ deserialize utility functionsMichael Butler
This CL adds the following additional bounds checks: * Adds additional checks of the index of the std::vector before accessing the element at the index * Changes the array index operator [] to the checked std::vector::at method Bug: 256589724 Test: mma Merged-In: I6bfb02a5cd76258284cc4d797a4508b21e672c4b Change-Id: I6bfb02a5cd76258284cc4d797a4508b21e672c4b (cherry picked from commit 9b17e6485b12e20cd73c4b0b71e5798e608a177a) Merged-In: I6bfb02a5cd76258284cc4d797a4508b21e672c4b
2022-05-15Merge TP1A.220507.001Brian Orr
Change-Id: Ifd94c5f23194526eeb62cfe29ad19207671380ad
2022-04-29Handle case where NN AIDL callback is null in IDevice::prepareModel*Michael Butler
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: 230914930 Test: mma Test: presubmit Change-Id: I4a15d02c4879a0261ec26cc0e7a47d0a4da86b8b Merged-In: I4a15d02c4879a0261ec26cc0e7a47d0a4da86b8b (cherry picked from commit d6f6d01499d84d0186114262a5bd190aa09e99fa)
2022-04-29Merge "Move NN_TRY macro out of struct initialization" into tm-devMichael Butler
2022-04-28Move NN_TRY macro out of struct initializationMichael Butler
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
2022-04-27Do not call releaseMemoryResource on ignored slot in NN VTSMichael Butler
For IBurst, a slot value of -1 indicates the slot should be ignored. However, GeneratedTestHarness still attempts to call IBurst::releaseMemoryResource on ignored slots. Instead, we should skip releasing any ignored slots. Bug: 230103381 Test: mma Test: VtsHalNeuralnetworksTargetTest Test: presubmit Change-Id: I82e538aa0fd9e8ecc077df1c1ceece46a6166e67
2022-04-08Merge TP1A.220404.001Scott Lobdell
Change-Id: I3bce78ab5d441ef9e6c038cf7ebea0adcc41d47e
2022-03-31Freeze AIDL APIs for TMJiyong Park
Bug: 225941299 Test: m Change-Id: Ie41cc0797710f813f92c65c387f247c7806d8394
2022-03-17Merge TP1A.220310.002Daniel Norman
Change-Id: Ic15874018152ca90e6f51bdb1be1b24eb32d57dd
2022-03-11Merge TP1A.220225.003Scott Lobdell
Change-Id: Iad9e960e034127e3320f78d2eadd23e36300b10c
2022-03-07Merge TP1A.220209.001Deyao Ren
Change-Id: Ia39c40c82efb5b7c7d2ad4c464b75e6fd4e073aa
2022-03-04Merge "Make NN canonical->HIDL adapter execute* methods synchronous" am: ↵Michael Butler
f955569c8a am: c7d8c19823 am: 277e31957b Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2005130 Change-Id: Ic8e1f71731ef3f429ec363a0730c0baafdf751b0
2022-03-01Make NN canonical->HIDL adapter execute* methods synchronousMichael Butler
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-01Merge "Cast to the underlying type for union tags" am: 6cd0d474b2 am: ↵Treehugger Robot
5eb895c047 am: bbd66d27a0 Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1999055 Change-Id: Ie0a38cc29d50c65b8168435c70786321fc9de199
2022-02-26Cast to the underlying type for union tagsJooyung Han
Union tags are of enum type. Streaming it would make more sense by casting to underlying types. For now casting is not required since tags are defined as `enum Tag`. But we're going to change it to `enum class Tag` which won't work with operator<< without casting. Bug: 218912230 Test: m Change-Id: Ia5e8a5c38fe23c72dffbdca320a32abdfa0eb38e
2022-02-24Merge "Remove NN host specific build defines" am: fe9368b729 am: 13a6d16614 ↵Michael Butler
am: 6d588b7cd9 Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1997731 Change-Id: I2bfc9dbc8c7fbc0940eed48968dc5df89314b08c
2022-02-24Merge "Add timed out test files to tidy_timeout_srcs" am: ff54f73b4f am: ↵Chih-hung Hsieh
fa83970b3a am: 581616e658 Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1992232 Change-Id: I2eac13fe3b5ab0b4f15d6ceadf376e5e74124a81
2022-02-24Merge "Remove NN host specific build defines"Michael Butler
2022-02-24Merge "Add timed out test files to tidy_timeout_srcs"Chih-hung Hsieh
2022-02-23Remove NN host specific build definesMichael Butler
These defines are redundant because they are already defined in neuralnetworks_utils_defaults. Bug: N/A Test: mma Change-Id: I1c5c44e9e61da19bc10dd8ed2e38099f7c4baccd
2022-02-18Add timed out test files to tidy_timeout_srcsChih-Hung Hsieh
* 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-18Merge "Remove isUpdatable query from NNAPI -- hal" am: 82d36078b9 am: ↵Michael Butler
3d9540d5ed am: 7c858f2ae4 Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1985407 Change-Id: I25779bbd5701bb1a3c0c6c3dcc2e82a5e50ec271
2022-02-15Merge "Clamp NNAPI HAL Version to runtime version -- hal" am: b66f1308ac am: ↵Michael Butler
27e3ce4cf6 am: 9c4d73c39d Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1985406 Change-Id: I6b5669f02cf59128acb218d0baf1a2ea3cc99b39
2022-02-14Remove isUpdatable query from NNAPI -- halMichael Butler
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-14Clamp NNAPI HAL Version to runtime version -- halMichael Butler
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-09Merge TP1A.220126.001Haamed Gheibi
Change-Id: Ibf6bd2c20d9927fde8b2a05dde2b58bd8faea20f
2022-02-09Merge "Address ANAPIC review comments -- hal." am: 8b389e1123 am: 706652c817 ↵Xusong Wang
am: cfa3838085 am: aba49d0512 Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1957303 Change-Id: I88834c87adc1958cfd6cc68929d38eaad43c2d93
2022-02-07Address ANAPIC review comments -- hal.Xusong Wang
- 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-04Merge TP1A.220120.003Haamed Gheibi
Change-Id: Ie5eba313ee102e452f5f96942ed2f3a7bb4e8f01
2022-02-01Merge "Move NNAPI HAL CommonUtils to nnapi/SharedMemory -- hal" am: ↵Michael Butler
ea3e90c1f1 am: 0d612d723b am: f288828f8e am: 67a0cba6b5 Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1966388 Change-Id: Ie8eccccc4d97287b776cf786d146f4cf80f1edc5
2022-01-31Move NNAPI HAL CommonUtils to nnapi/SharedMemory -- halMichael Butler
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-30Merge TP1A.220107.002Scott Lobdell
Change-Id: I655d5412ccd734059dfb19075bb9abc810396975
2022-01-24Merge TP1A.211214.001Scott Lobdell
Change-Id: Ib12bd53bdfdf84dde7b986f5e2ae5392cd672882
2022-01-22Merge "Make VtsHalNeuralnetworksTargetTest run on the host" am: 8f255182ec ↵Michael Butler
am: ca13a2b719 am: c5699bca62 am: b81e3f351c Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1946651 Change-Id: I34ce4c7d79fe86d57399daf363178d436e227fc2
2022-01-21Make VtsHalNeuralnetworksTargetTest run on the hostMichael Butler
This change adds a host build of VtsHalNeuralnetworksTargetTest. In the existing device build of VtsHalNeuralnetworksTargetTest, the drivers run out-of-process. In the host build of VtsHalNeuralnetworkaTargetTest, the driver runs in-process. The in-process driver that runs on the host is the canonical sample driver (which is just the CPU "driver", located in packages/modules/NeuralNetworks/driver/sample) adapted to an AIDL interface (by the adapter code in hardware/interfaces/neuralnetworks/utils/adapter/aidl). Bug: N/A Test: mma Test: VtsHalNeuralnetworksTargetTest on host Change-Id: Ia30dd3a7db8e0592b9f13d69c9831f8ffe10c371
2022-01-21Merge TP1A.211206.001Scott Lobdell
Change-Id: I8b3a43021a3328cf6afb4e7e157339d8e214ddbe
2022-01-21Merge "Cleanup NN utility libraries' dependencies" am: d3e413e759 am: ↵Michael Butler
fd0636d14b am: b3d989c805 am: 2dddfa7d4a Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1950217 Change-Id: Ibf979c129b008a94d1b729e84cc2e338624e176b
2022-01-20Merge "Cleanup NN utility libraries' dependencies"Michael Butler
2022-01-20Cleanup NN utility libraries' dependenciesMichael Butler
Bug: N/A Test: mma Change-Id: I0243c477098d9a2de28ca78bfde155d3ecb5acb6
2022-01-20HAL interface for compilation and execution hintsMiao Wang
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 0e671f3edb9d2c78658a4ef4169e3211e3f9bb00)
2022-01-20HAL interface for compilation and execution hintsMiao Wang
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
2022-01-19Add VTS tests for reusable execution.Xusong Wang
- Modified generated tests and validation tests to exercise reusable execution. - Add a scoped trace to print the test config when an error occurs Bug: 202405342 Bug: 202431255 Test: VtsHalNeuralnetworksTargetTest Change-Id: I3e2346903e430080ec4d926bf08daf6825ea4dce Merged-In: I3e2346903e430080ec4d926bf08daf6825ea4dce (cherry picked from commit 859200800c70a5780931abc8db40b7ade99eef12)
2022-01-18Reusable execution at HAL level -- HAL.Xusong Wang
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 7f5c7d293c2dad462dc9c0f1f1a160fb2c2c9a9b)
2022-01-18Define AIDL reusable execution interface.Xusong Wang
This CL defines the AIDL interface for reusable execution. This CL also fixes a stale statement in IBurst about deadlineNs: boot_clock should be used rather than steady_clock. Bug: 202405342 Bug: 202431255 Test: NNT_static Test: VtsHalNeuralnetworksTargetTest Change-Id: I07d26909081018ffd92264d76109a66d4a0de3bd Merged-In: I07d26909081018ffd92264d76109a66d4a0de3bd (cherry picked from commit 0d9b1a9d287d3751c305742af81850b7ceea0c6b)
2022-01-18Add VTS tests for reusable execution.Xusong Wang
- Modified generated tests and validation tests to exercise reusable execution. - Add a scoped trace to print the test config when an error occurs Bug: 202405342 Bug: 202431255 Test: VtsHalNeuralnetworksTargetTest Change-Id: I3e2346903e430080ec4d926bf08daf6825ea4dce
2022-01-14Reusable execution at HAL level -- HAL.Xusong Wang
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
2022-01-14Define AIDL reusable execution interface.Xusong Wang
This CL defines the AIDL interface for reusable execution. This CL also fixes a stale statement in IBurst about deadlineNs: boot_clock should be used rather than steady_clock. Bug: 202405342 Bug: 202431255 Test: NNT_static Test: VtsHalNeuralnetworksTargetTest Change-Id: I07d26909081018ffd92264d76109a66d4a0de3bd
2022-01-14Merge TP1A.211116.001Scott Lobdell
Change-Id: Iba540947aa34084b7ef3210f93332bb757b4bb43
2022-01-13Merge "Freeze neuralnetworks AIDL version as v3 for FL7" am: 3e6d04f6df am: ↵David Gross
b81359e293 am: 9894d5625f am: 112d1a22f1 Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1947667 Change-Id: Ia846557ffc6b8a0b5e897690e75aed2950bfbd23