From 7bfc2a3143ef61d4e4bbc043b4b5deb3e0935627 Mon Sep 17 00:00:00 2001 From: caifubi Date: Wed, 30 Dec 2020 15:34:19 +0800 Subject: [PATCH] Fix Segmentation fault on Ascend --- .../ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc b/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc index 89838d8f3f..890fad9b74 100644 --- a/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc +++ b/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc @@ -710,6 +710,10 @@ bool AscendKernelRuntime::RunTask(const session::KernelGraph *graph) { bool AscendKernelRuntime::SyncStream() { InnerSetContext(); + if (stream_ == nullptr) { + MS_LOG(ERROR) << "SyncStream failed. stream_ is nullptr"; + return false; + } if (RT_ERROR_NONE != rtStreamSynchronize(stream_)) { // o for switch stream MS_LOG(ERROR) << "Call runtime rtStreamSynchronize error."; return false;