From e940beb4599f92e713e374acad891be5abba28d7 Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Fri, 3 Feb 2023 11:45:07 +0000 Subject: [PATCH] SWDEV-380405 - Check for invalid stream for hipMemcpyPeerAsync. Change-Id: I6dfccb4d20bb638bd596c071030c68889743d706 --- hipamd/src/hip_peer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hipamd/src/hip_peer.cpp b/hipamd/src/hip_peer.cpp index fb6b332942..d5255103a6 100644 --- a/hipamd/src/hip_peer.cpp +++ b/hipamd/src/hip_peer.cpp @@ -232,7 +232,9 @@ hipError_t hipMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int src srcDevice < 0 || dstDevice < 0) { HIP_RETURN(hipErrorInvalidDevice); } - + if (!hip::isValid(stream)) { + return hipErrorContextIsDestroyed; + } HIP_RETURN(hipMemcpyAsync(dst, src, sizeBytes, hipMemcpyDeviceToDevice, stream)); }