未验证 提交 43752047 编写于 作者: C chengduo 提交者: GitHub

fix DropLocalExeScopes (#17829)

test=develop
上级 50326563
...@@ -65,11 +65,14 @@ void ScopeBufferedSSAGraphExecutor::DropLocalExeScopes() { ...@@ -65,11 +65,14 @@ void ScopeBufferedSSAGraphExecutor::DropLocalExeScopes() {
for (auto p : places_) { for (auto p : places_) {
platform::DeviceContextPool::Instance().Get(p)->Wait(); platform::DeviceContextPool::Instance().Get(p)->Wait();
} }
for (auto &scope : local_scopes_) { for (auto &scope : local_scopes_) {
auto &local_scope = auto *local_scope_var = scope->FindLocalVar(details::kLocalExecScopeName);
*scope->Var(details::kLocalExecScopeName)->GetMutable<Scope *>(); if (local_scope_var != nullptr) {
scope->DeleteScope(local_scope); auto &local_scope = *local_scope_var->GetMutable<Scope *>();
VLOG(3) << "Drop local execution scope: " << local_scope; scope->DeleteScope(local_scope);
VLOG(3) << "Drop local execution scope: " << local_scope;
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册