From e5a9c5b85b91e2f53dbb2edefce65fa8cf798b35 Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Tue, 20 Dec 2022 12:43:58 +0000 Subject: [PATCH] SWDEV-374394 - Correct hip error for invalid stream. Change-Id: I96949c58e050cb3149ab8434aebe0f1a97a6e857 [ROCm/clr commit: 148f67a36d525dc678a6978525d110a3b0e68af5] --- projects/clr/hipamd/src/hip_memory.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_memory.cpp b/projects/clr/hipamd/src/hip_memory.cpp index 2b2cf24272..13584c2ef3 100644 --- a/projects/clr/hipamd/src/hip_memory.cpp +++ b/projects/clr/hipamd/src/hip_memory.cpp @@ -2083,9 +2083,12 @@ inline hipError_t ihipMemcpyCmdEnqueue(amd::Command* command, bool isAsync = fal hipError_t ihipMemcpyParam3D(const HIP_MEMCPY3D* pCopy, hipStream_t stream, bool isAsync = false) { hipError_t status; - if (pCopy == nullptr || !hip::isValid(stream)) { + if (pCopy == nullptr) { return hipErrorInvalidValue; } + if (!hip::isValid(stream)) { + return hipErrorContextIsDestroyed; + } if (pCopy->WidthInBytes == 0 || pCopy->Height == 0 || pCopy->Depth == 0) { LogPrintfInfo("Either Width :%d or Height: %d and Depth: %d is zero", pCopy->WidthInBytes, pCopy->Height, pCopy->Depth);