diff options
author | Michael Butler <butlermichael@google.com> | 2021-02-09 15:36:11 -0800 |
---|---|---|
committer | Michael Butler <butlermichael@google.com> | 2021-02-19 17:34:32 -0800 |
commit | 68b6926e3c936f31e6dbec96ffb88a18d2312f27 (patch) | |
tree | d9702bb53826e16a0d16bfd64917718a9b9c3577 /neuralnetworks/aidl/vts/functional/ValidateModel.cpp | |
parent | 8548f574eec2fd65aa56c5fbbcb01b78dfb07cc9 (diff) |
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 c4d98007fd2ff50031b270801274ee4c498afd87)
Diffstat (limited to 'neuralnetworks/aidl/vts/functional/ValidateModel.cpp')
-rw-r--r-- | neuralnetworks/aidl/vts/functional/ValidateModel.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp index b84d981abd..6d84e1ed7b 100644 --- a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp +++ b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp @@ -1310,8 +1310,10 @@ static void mutateExecutionPriorityTest(const std::shared_ptr<IDevice>& device, ////////////////////////// ENTRY POINT ////////////////////////////// void validateModel(const std::shared_ptr<IDevice>& device, const Model& model) { - const auto numberOfConsumers = nn::countNumberOfConsumers( - model.main.operands.size(), nn::convert(model.main.operations).value()); + const auto numberOfConsumers = + nn::countNumberOfConsumers(model.main.operands.size(), + nn::convert(model.main.operations).value()) + .value(); mutateExecutionOrderTest(device, model, numberOfConsumers); mutateOperandTypeTest(device, model); mutateOperandRankTest(device, model); |