summaryrefslogtreecommitdiff
path: root/nn/runtime
diff options
context:
space:
mode:
authorSlava Shklyaev <slavash@google.com>2020-05-13 14:19:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-05-13 14:19:55 +0000
commite87eb356123eca6200e3a58eda82df38b0a68b02 (patch)
tree5ccd8bc427695dfc2ba4f7564de6822078a31e7d /nn/runtime
parentcff45e6f2726a552bddf2a62ed3b1b94528798dc (diff)
parent5529caefe11203d99de92a718b830ea6d8ae39fb (diff)
downloadml-e87eb356123eca6200e3a58eda82df38b0a68b02.tar.gz
Merge "Avoid compiling ExecutionPlan::SimpleBody multiple times" into rvc-dev
Diffstat (limited to 'nn/runtime')
-rw-r--r--nn/runtime/ExecutionPlan.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/nn/runtime/ExecutionPlan.cpp b/nn/runtime/ExecutionPlan.cpp
index 5e618825f..e955cd5e1 100644
--- a/nn/runtime/ExecutionPlan.cpp
+++ b/nn/runtime/ExecutionPlan.cpp
@@ -607,6 +607,7 @@ void LogicalStep::dump() const {
int ExecutionPlan::CompoundBody::finish(const SourceModels* sourceModels,
int32_t executionPreference, int32_t priority,
const std::optional<Deadline>& deadline) {
+ CHECK(!mSuccessfulFinish);
CHECK(!deadline.has_value());
const ModelBuilder* mainModel = sourceModels->getModel(kMainModelInSourceModels);
@@ -700,6 +701,7 @@ void ExecutionPlan::CompoundBody::findControlFlowBoundaryConstants(
int ExecutionPlan::SimpleBody::finish(const SourceModels*, int32_t executionPreference,
int32_t priority, const std::optional<Deadline>& deadline) {
+ CHECK(!mSuccessfulFinish);
CHECK(mDevice != nullptr);
VLOG(COMPILATION) << "ExecutionPlan::SimpleBody::finish, compilation";
const int n = compile(*mDevice, *mModel, executionPreference, priority, deadline, *mCacheDir,
@@ -1638,7 +1640,7 @@ int ModelBuilder::partitionTheWorkInternal(uint32_t sourceModelIndex,
VLOG(COMPILATION) << "ModelBuilder::partitionTheWork: only one best device: "
<< bestDeviceIndex << " = " << devices[bestDeviceIndex]->getName();
plan->becomeSingleStep(devices[bestDeviceIndex], this);
- return plan->finish(preference, priority, deadline);
+ return ANEURALNETWORKS_NO_ERROR;
}
}