Commit Graph

1038 Commits

Author SHA1 Message Date
Pechetty Sravani (xWF)
c322dc4976 Merge "Revert^2 "Workaround Clang hangs indefinitely"" into main am: 9c904707ef
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3175419

Change-Id: Ic253e6aad1d46965042d62464cc54a7446192540
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-16 09:52:23 +00:00
Pechetty Sravani (xWF)
9c904707ef Merge "Revert^2 "Workaround Clang hangs indefinitely"" into main 2024-07-16 09:35:19 +00:00
Pechetty Sravani
facd91c1d6 Revert^2 "Workaround Clang hangs indefinitely"
This reverts commit 64a1b6a57d.

Reason for revert: Droidmonitor triggered revert due to build breakage in b/353410480. Will be verifying through ABTD before submission.

Change-Id: Iec3b4303b4f16943c163b36ced0166fb06a51d8f
2024-07-16 05:11:57 +00:00
Liana Kazanova
4d30584416 Merge "Revert "Workaround Clang hangs indefinitely"" into main am: 0480a2e8a2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3174243

Change-Id: I027538b6c6cd3c88546f3e55fd815abdd24713c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-15 21:22:19 +00:00
Liana Kazanova
0480a2e8a2 Merge "Revert "Workaround Clang hangs indefinitely"" into main 2024-07-15 20:53:34 +00:00
Liana Kazanova
64a1b6a57d Revert "Workaround Clang hangs indefinitely"
This reverts commit 38f082f041.

Reason for revert: Droidmonitor triggered revert due to build breakage in b/353213981. Will be verifying through ABTD before submission.

Change-Id: I43482457d1f1ca4bd5cf0812d82b9df91ebc98d4
2024-07-15 18:50:09 +00:00
Yi Kong
2fd1bd2945 Merge "Workaround Clang hangs indefinitely" into main am: 0309dddb6c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2720955

Change-Id: Ia653f44e1c6729555db53cba52f28499b496b01f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-15 08:37:22 +00:00
Yi Kong
0309dddb6c Merge "Workaround Clang hangs indefinitely" into main 2024-07-15 08:11:54 +00:00
Devin Moore
def7a3cf59 Keep track of DeathMonitor cookies
This change keeps track of the objects that the cookies points to so the
serviceDied callback knows when it can use the cookie.

Test: atest neuralnetworks_utils_hal_aidl_test
Tets: atest NeuralNetworksTest_static
Bug: 319210610

Change-Id: I418cbc6baa19aa702d9fd2e7d8096fe1a02b7794
2024-04-18 19:36:17 +00:00
Pawan Wagh
a4a73461c2 Downgrade fatal log on host to error
Fuzzer is breaking due to fatal log for host. Downgrade it to error.

Test: m android.hardware.neuralnetworks-service.example_fuzzer &&
out/host/linux-x86/fuzz/x86_64/android.hardware.neuralnetworks-service.example_fuzzer/android.hardware.neuralnetworks-service.example_fuzzer
Bug: 312902296

Change-Id: I7013ed14f6644d0459929380202de45f92575cf9
2024-02-12 18:47:08 +00:00
sergiuferentz
7d7a24d5f6 Bump android.hardware.graphics.common V4->V5
Test: Build
Bug: 291142745
Change-Id: Ib0002feb982ffcc37fa7b69493c644b7a835cf4f
2023-10-03 16:14:03 +00:00
Yi Kong
38f082f041 Workaround Clang hangs indefinitely
When building the function under -O1, Clang hangs indefinitely. It works
fine under either -O0 or -O2. Workaround by turning off optimization for
just the offending function.

Test: presubmit
Bug: 296850773
Bug: 294796809
Change-Id: Ia72a9e9e56183d71296cd5d8628461197cb5b2a4
2023-08-22 16:00:24 +09:00
Treehugger Robot
260e398b45 Merge "Make apex_available of nn hidl interfaces explicit in Android.bp" am: fd48e195bb am: 1156f7c564 am: b0e2887437
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2580936

Change-Id: I887099ea1d0c2d0e6226c757a2e80d807a79b1e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-06 18:24:14 +00:00
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
Xusong Wang
21dcba5fa9 Merge "Fix VTS generated test with reusable execution." am: c2f025e250 am: c6d9dfa6df am: 3917606102
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2490967

Change-Id: I963f463ea56fb8880a7cf073ecfc036e98cdf956
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-24 02:24:35 +00:00
Xusong Wang
6b84616fd8 Fix VTS generated test with reusable execution.
Fixes: 273819843
Bug: 273885128
Test: NNAPI VTS
Change-Id: Ib684cea0686659a96afa6d181900edf7508da12b
2023-03-16 16:54:08 +00:00
Xin Li
c96ae7d7f5 Merge TQ1A.230205.002
Bug: 263898609
Merged-In: I6bfb02a5cd76258284cc4d797a4508b21e672c4b
Change-Id: I9b4a1a6d0b6ba2e731737b5b731254a92dc4605e
2023-02-06 21:05:29 -08:00
Michael Butler
07df4f22df Add additional bounds checks to NNAPI FMQ deserialize utility functions
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 9b17e6485b)
Merged-In: I6bfb02a5cd76258284cc4d797a4508b21e672c4b
2022-12-14 02:25:23 +00:00
Marc Kassis
9c428fe3ed graphics.common V3 -> V4
Bug: 251177105
Test: m
Change-Id: I816b8e14a0741402090cdc4732c2a904e830ff4e
Merged-In: I1cb84ec85f98789d0737207a1661b39a25538c96
Merged-In: I2e1561f4ccb59a2a833af9a7afd07840ab2ebfa4
2022-12-07 10:53:12 +00:00
Michael Butler
5154e5f53f Merge "Add additional bounds checks to NNAPI FMQ deserialize utility functions" 2022-12-07 00:48:09 +00:00
Michael Butler
611648f7a0 Add additional bounds checks to NNAPI FMQ deserialize utility functions
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
2022-12-05 20:24:19 +00:00
Treehugger Robot
73a19e5bf1 Merge "Remove neuralnetworks_float16." am: 05d30e7246 am: 3a534ad808 am: 10d5c29574
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2322753

Change-Id: I0f1c3084bc4fcf62e12cd54682226390d5e77540
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 22:39:56 +00:00
Yabin Cui
1c4ad4f9ad Remove neuralnetworks_float16.
Bug: 254708969
Test: build
Change-Id: Ibf7dba54b61938cae5f9a84d0047a1078978c3ff
2022-11-30 10:17:10 -08:00
Steven Moreland
ed27779d14 graphics.common V3 -> V4
Bug: 251177105
Test: builds
Change-Id: I1cb84ec85f98789d0737207a1661b39a25538c96
2022-10-29 00:51:21 +00:00
Sally Qi
cb8583adad Merge "Add cc_defaults as wrapper for graphics composer/common AIDL interfaces." 2022-08-30 20:52:44 +00:00
Sally Qi
784c253a05 Add cc_defaults as wrapper for graphics composer/common AIDL
interfaces.

- Add new Android.bp in graphics folder and wrap composer and common
  AIDL in to separate cc_defaults.
- remove composer3 dependency from allocator's VTS .bp file.

Bug: 243429120
Test: builds
Change-Id: Ia91e4ab87b7ac86248094317185b317d5604e654
2022-08-26 15:18:42 -07: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
Treehugger Robot
2a3972288c Merge "Make VtsHalNeuralnetworks* tests more binder-friendly." into android12-tests-dev am: 2a04b4462f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2194136

Change-Id: I651a99927a137c7401750274b505e30e548e7858
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 17:05:34 +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
68c8b4cb5d Merge "Disable TEST_MAPPING for VtsHalNeuralnetworksV1_*TargetTest" am: bc24c9b37a am: 184e6dcebd
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2118707

Change-Id: Ib81ecc387650f8eadd559fd17956ee023c62b92d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-16 01:18:25 +00:00
Michael Butler
bc24c9b37a Merge "Disable TEST_MAPPING for VtsHalNeuralnetworksV1_*TargetTest" 2022-06-15 23:47:08 +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
Jordan Abrahams-Whitehead
bb2afde687 Merge "vts: Upsize 8bit uniform_int_distribution" am: 13a42ed14d am: c7e13d9244
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2110725

Change-Id: Ibf6a3bc540b5dd06a24330b506a98e2f3bca2ad5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-31 23:08:56 +00:00
Jordan R Abrahams-Whitehead
745c351b8b vts: Upsize 8bit uniform_int_distribution
uniform_int_distribution<a> for types sizeof(a) < 2 are
not valid by the C++ library standard. Newer versions of LLVM
(particularly spurred on by ChromeOS toolchain changes)
require at least std::uniform_int_distribution<uint16_t>.

This is a required change for rolling LLVM to r458507.
This is necessary, but may not be sufficient to resolve
the issue.

Bug: 231351802
Test: mma
Change-Id: I04c3cc91507f3467c432b9a25effdac3f5fb56f3
2022-05-30 22:30:54 +00:00
David Gross
96e9eeb19d Freeze neuralnetworks AIDL version as v2 for FL6
$ m android.hardware.neuralnetworks-update-api
$ m android.hardware.neuralnetworks-freeze-api

Cherrypicked from I35dbd32695acdffc552790dc7396bc8c724e9242

Bug: 206089870

Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksTargetTest
Change-Id: I35dbd32695acdffc552790dc7396bc8c724e9242
Merged-In: I35dbd32695acdffc552790dc7396bc8c724e9242
(cherry picked from commit 2a889d50b7)
2022-05-23 13:30:56 -07:00
Ian Hua
5dde02c7f6 Add FL6 spec tests to AIDL VTS.
Also skip FL6 (AIDL_V2) tests for older AIDL drivers.

Cherrypicked from I689fef0945428f6548977628e3c43628dd1e5bf7

Bug: 206089870
Test: VtsHalNeuralnetworksTargetTest
Specifically, for old driver such as AIDL_V1 sample driver, it can pass
HIDL tests and skip AIDL_V2 tests. For new driver such as AIDL_V2
sample driver, it can pass all tests.

Change-Id: I689fef0945428f6548977628e3c43628dd1e5bf7
(cherry picked from commit 23d4e5e298)
2022-05-23 13:06:30 -07:00
David Gross
a8cf3aefd8 Add PACK operation to NNAPI feature level 6.
Cherrypicked from Ic15d047b70c62437b4f0db6f2ca10127591ae07c

Bug: 206089870

Test: m -j NeuralNetworksTest_static
Test: VtsHalNeuralnetworksTargetTest

Change-Id: Ic15d047b70c62437b4f0db6f2ca10127591ae07c
Merged-In: Ic15d047b70c62437b4f0db6f2ca10127591ae07c
(cherry picked from commit 0af4ac2ec4)
2022-05-23 13:06:04 -07:00
Ian Hua
b0cf0db3b0 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.

Cherrypicked from Iabe45c57e2306d61055f711eda03b80b9cbe906d

Bug: 206089870
Test: mm
Change-Id: Iabe45c57e2306d61055f711eda03b80b9cbe906d
Merged-In: Iabe45c57e2306d61055f711eda03b80b9cbe906d
(cherry picked from commit aaeda0e84f)
2022-05-23 13:05:06 -07:00
Michael Butler
7c0353f8e4 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: 230914930
Test: mma
Test: presubmit
Change-Id: I4a15d02c4879a0261ec26cc0e7a47d0a4da86b8b
Merged-In: I4a15d02c4879a0261ec26cc0e7a47d0a4da86b8b
(cherry picked from commit d6f6d01499)
2022-04-29 23:39:27 +00: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
12adc10cfd Merge "Move NN_TRY macro out of struct initialization" into tm-dev am: 13300287b5
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/17991614

Change-Id: Ibf2ed6b11978b524307f1d4209404a32c73c6ceb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:32:20 +00:00
Michael Butler
13300287b5 Merge "Move NN_TRY macro out of struct initialization" into tm-dev 2022-04-29 18:06:29 +00:00
Michael Butler
7ecc290745 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
2022-04-28 22:05:37 +00:00
Michael Butler
39dac4dee4 Do not call releaseMemoryResource on ignored slot in NN VTS
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
Merged-In: I82e538aa0fd9e8ecc077df1c1ceece46a6166e67
2022-04-28 18:58:46 +00:00
Michael Butler
7840b95dd6 Merge "Do not call releaseMemoryResource on ignored slot in NN VTS" into tm-dev am: cb2e758c92
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/17970068

Change-Id: I58d0f4dffda3ffac6f9fe81f08b0bec27454c04d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-28 01:06:41 +00:00
Michael Butler
d468abed9b Do not call releaseMemoryResource on ignored slot in NN VTS
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-27 00:08:40 +00:00
Michael Butler
aa9f97a0e2 Merge "Handle case where NN AIDL callback is null in IDevice::prepareModel*" am: 5d4f1b70c2 am: 84ec222eb5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2072333

Change-Id: If046a013f58c839e3b01b0774c070d6a8b1fbc3c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-22 18:53:01 +00:00
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
Jiyong Park
703e97920e Freeze AIDL APIs for TM
Bug: 225941299
Test: m
Change-Id: Ie41cc0797710f813f92c65c387f247c7806d8394
2022-03-31 12:01:39 +09:00
Michael Butler
4981b60f7f Merge "Make NN canonical->HIDL adapter execute* methods synchronous" am: f955569c8a am: c7d8c19823 am: 277e31957b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2005130

Change-Id: Ic8e1f71731ef3f429ec363a0730c0baafdf751b0
2022-03-04 01:44:00 +00:00