!10838 Fix Segmentation fault on Ascend

From: @jojobugfree
Reviewed-by: @kisnwang,@chujinjin
Signed-off-by: @kisnwang
This commit is contained in:
mindspore-ci-bot 2020-12-30 20:11:57 +08:00 committed by Gitee
commit b1ca1fbdb9
1 changed files with 4 additions and 0 deletions

View File

@ -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;