From 5fa035dbd41847beab2a42f00777cede6e2ac723 Mon Sep 17 00:00:00 2001 From: pghafari Date: Tue, 17 Jan 2023 10:54:14 -0500 Subject: [PATCH] SWDEV-369551 - invalid stream check in hipMemcpy Change-Id: I6762af93cd566a38f7d04994b87a76e744b19043 [ROCm/clr commit: 76b0b4d635682bf41a6eddcf0b05464b6e262b91] --- projects/clr/hipamd/src/hip_memory.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/clr/hipamd/src/hip_memory.cpp b/projects/clr/hipamd/src/hip_memory.cpp index 681b07860a..f3fcf68f1e 100644 --- a/projects/clr/hipamd/src/hip_memory.cpp +++ b/projects/clr/hipamd/src/hip_memory.cpp @@ -622,6 +622,10 @@ hipError_t hipMemcpyWithStream(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream) { HIP_INIT_API(hipMemcpyWithStream, dst, src, sizeBytes, kind, stream); STREAM_CAPTURE(hipMemcpyAsync, stream, dst, src, sizeBytes, kind); + if (!hip::isValid(stream)) { + HIP_RETURN(hipErrorContextIsDestroyed); + } + amd::HostQueue* queue = hip::getQueue(stream); if (queue == nullptr) { HIP_RETURN(hipErrorInvalidValue);