summaryrefslogtreecommitdiff
path: root/nn/driver
diff options
context:
space:
mode:
authorSlava Shklyaev <slavash@google.com>2020-03-27 16:46:49 +0000
committerSlava Shklyaev <slavash@google.com>2020-04-14 16:31:51 +0100
commitc186f368b84962dac2c82f499573d5e5eca7a1c6 (patch)
treee9951ee1cd2a76916f58e164d645e953090b8bdb /nn/driver
parent12b152d947fe47bb9ab7ea8f75a2de2e09ffbf92 (diff)
downloadml-c186f368b84962dac2c82f499573d5e5eca7a1c6.tar.gz
Fix control flow partial CPU fallback bug
Before this change, ExecutionPlan::Controller::mLastStepIndex is only updated at the beginning of the ExecutionPlan::next() call. When interpreted control flow is involved, this call might result in several logical steps being processed until an ExecutionStep is reached. When an interpreted CF loop terminates successfully but the next step is an ExecutionStep that fails, ExecutionPlan::fallback() restarts from mLastStepIndex, which happens to be the index of the WhileStep. This results in the loop being executed again. This happens forever. This change fixes the bug by updating mLastStepIndex when nextCompound(const ExecutionStep* ...) is called. This change renames mLastStepIndex to mFallbackNextStepIndex to reflect its usage. Fix: 152623151 Test: NNT_static Change-Id: Iff3b68f541adb8facf078e968abac2a6ae8e74c1 Merged-In: Iff3b68f541adb8facf078e968abac2a6ae8e74c1 (cherry picked from commit 22672efdab786bed8624e171b9e425fbb3bf6ea8)
Diffstat (limited to 'nn/driver')
-rw-r--r--nn/driver/sample/SampleDriverPartial.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/nn/driver/sample/SampleDriverPartial.h b/nn/driver/sample/SampleDriverPartial.h
index 090389ab9..17a86a311 100644
--- a/nn/driver/sample/SampleDriverPartial.h
+++ b/nn/driver/sample/SampleDriverPartial.h
@@ -35,7 +35,9 @@ namespace sample_driver {
// unsupported ops.
class SampleDriverPartial : public SampleDriver {
public:
- SampleDriverPartial(const char* name) : SampleDriver(name) {}
+ SampleDriverPartial(const char* name, const IOperationResolver* operationResolver =
+ BuiltinOperationResolver::get())
+ : SampleDriver(name, operationResolver) {}
hal::Return<void> getSupportedOperations_1_3(const hal::V1_3::Model& model,
getSupportedOperations_1_3_cb cb) override;
hal::Return<hal::ErrorStatus> prepareModel_1_3(