diff options
author | TreeHugger Robot | 2017-10-05 01:15:59 -0500 |
---|---|---|
committer | Android (Google) Code Review | 2017-10-05 01:15:59 -0500 |
commit | 0c7d0a9d0dba6f8d879b8b61cbc1c5b56a5cfd99 (patch) | |
tree | a8870fa5fcbbf273a6f619ac650111071c216d0d | |
parent | 13cbc53a65dd84a95a96e852f2cd7a5348cf4762 (diff) | |
parent | 959cd78e6766626d4cd9c52f7cdc156fd7880169 (diff) | |
download | platform-hardware-interfaces-0c7d0a9d0dba6f8d879b8b61cbc1c5b56a5cfd99.tar.gz platform-hardware-interfaces-0c7d0a9d0dba6f8d879b8b61cbc1c5b56a5cfd99.tar.xz platform-hardware-interfaces-0c7d0a9d0dba6f8d879b8b61cbc1c5b56a5cfd99.zip |
Merge "Fix VTS failures on tests with optional inputs" into oc-mr1-dev
-rw-r--r-- | neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp index fc8cc6dc..735528b9 100644 --- a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp +++ b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp | |||
@@ -131,14 +131,17 @@ void Execute(const sp<IDevice>& device, std::function<Model(void)> create_model, | |||
131 | .location = {.poolIndex = INPUT, .offset = 0, .length = static_cast<uint32_t>(s)}, | 131 | .location = {.poolIndex = INPUT, .offset = 0, .length = static_cast<uint32_t>(s)}, |
132 | .dimensions = {}, | 132 | .dimensions = {}, |
133 | }; | 133 | }; |
134 | inputs_info[index] = arg; | 134 | RequestArgument arg_empty = { |
135 | .hasNoValue = true, | ||
136 | }; | ||
137 | inputs_info[index] = s ? arg : arg_empty; | ||
135 | inputSize += s; | 138 | inputSize += s; |
136 | }); | 139 | }); |
137 | // Compute offset for inputs 1 and so on | 140 | // Compute offset for inputs 1 and so on |
138 | { | 141 | { |
139 | size_t offset = 0; | 142 | size_t offset = 0; |
140 | for (auto& i : inputs_info) { | 143 | for (auto& i : inputs_info) { |
141 | i.location.offset = offset; | 144 | if (!i.hasNoValue) i.location.offset = offset; |
142 | offset += i.location.length; | 145 | offset += i.location.length; |
143 | } | 146 | } |
144 | } | 147 | } |