Browse Source

fix error when graph and pynative mode mixed excution

tags/v1.1.0
chujinjin 5 years ago
parent
commit
3357181d72
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      mindspore/ccsrc/runtime/device/kernel_runtime.cc

+ 9
- 0
mindspore/ccsrc/runtime/device/kernel_runtime.cc 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;
}



Loading…
Cancel
Save