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;