From fb7f0a07942eea212dc538b119f2cb26aa0aa559 Mon Sep 17 00:00:00 2001 From: "Li, Todd tiantuo" Date: Wed, 28 May 2025 01:14:24 -0700 Subject: [PATCH] SWDEV-504307 SWDEV-504308 - fix hipDeviceSetCacheConfig and hipDeviceSetSharedMemConfig when capturing stream (#411) [ROCm/clr commit: c7f3ae6d2f1828336e5611e728685bfad8628fd1] --- projects/clr/hipamd/src/hip_device_runtime.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/projects/clr/hipamd/src/hip_device_runtime.cpp b/projects/clr/hipamd/src/hip_device_runtime.cpp index 3832ea63c0..b53824a423 100644 --- a/projects/clr/hipamd/src/hip_device_runtime.cpp +++ b/projects/clr/hipamd/src/hip_device_runtime.cpp @@ -591,6 +591,10 @@ hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig) { HIP_RETURN(hipErrorInvalidValue); } + if (!hip::tls.capture_streams_.empty() || !g_captureStreams.empty()) { + HIP_RETURN(hipErrorStreamCaptureUnsupported); + } + // No way to set cache config yet. HIP_RETURN(hipSuccess); @@ -631,6 +635,11 @@ hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config) { config != hipSharedMemBankSizeEightByte) { HIP_RETURN(hipErrorInvalidValue); } + + if (!hip::tls.capture_streams_.empty() || !g_captureStreams.empty()) { + HIP_RETURN(hipErrorStreamCaptureUnsupported); + } + // No way to set cache config yet. HIP_RETURN(hipSuccess);