!8427 fix error when execute single op in Graph mode

From: @chujinjin
Reviewed-by: @kisnwang,@jjfeing
Signed-off-by: @jjfeing
This commit is contained in:
mindspore-ci-bot 2020-11-13 16:36:57 +08:00 committed by Gitee
commit c970f30db8
1 changed files with 9 additions and 0 deletions

View File

@ -845,6 +845,15 @@ bool KernelRuntime::LaunchKernel(const session::KernelGraph *graph) {
MS_LOG(ERROR) << "LaunchKernelMod failed!";
return false;
}
auto ms_context = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(ms_context);
if (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) == kGraphMode) {
if (!SyncStream()) {
MS_LOG(ERROR) << "SyncStream failed";
return false;
}
}
return true;
}