From 2c173c6da4765ab5b2fcd9ff2fb95a1532b05dbb Mon Sep 17 00:00:00 2001 From: "Dittakavi, Satyanvesh" Date: Thu, 22 May 2025 13:24:49 +0530 Subject: [PATCH] SWDEV-512756 - SWDEV-510954 - Add appropriate checks during active stream capture (#375) - hipStreamAddCallback is not permitted during stream capture for all modes - hipModuleUnload is permitted only for relaxed mode during stream capture Change-Id: I79ca5d2f6b61bd2e169fee7c13da4cd46e472a10 --- hipamd/src/hip_module.cpp | 1 + hipamd/src/hip_stream.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hipamd/src/hip_module.cpp b/hipamd/src/hip_module.cpp index 7213b315f0..9886685efd 100644 --- a/hipamd/src/hip_module.cpp +++ b/hipamd/src/hip_module.cpp @@ -48,6 +48,7 @@ hipError_t hipModuleUnload(hipModule_t hmod) { if (hmod == nullptr) { HIP_RETURN(hipErrorInvalidResourceHandle); } + CHECK_STREAM_CAPTURE_SUPPORTED(); HIP_RETURN(PlatformState::instance().unloadModule(hmod)); } diff --git a/hipamd/src/hip_stream.cpp b/hipamd/src/hip_stream.cpp index 6fbd15a86c..a2196cb83a 100644 --- a/hipamd/src/hip_stream.cpp +++ b/hipamd/src/hip_stream.cpp @@ -559,6 +559,8 @@ hipError_t hipStreamQuery_spt(hipStream_t stream) { hipError_t streamCallback_common(hipStream_t stream, StreamCallback* cbo, void* userData) { getStreamPerThread(stream); + + CHECK_SUPPORTED_DURING_CAPTURE(); hip::Stream* hip_stream = hip::getStream(stream); amd::Command* last_command = hip_stream->getLastQueuedCommand(true); amd::Command::EventWaitList eventWaitList;