From 2e60edbe0e97d1d95cf696358c1c29f73636487a Mon Sep 17 00:00:00 2001 From: pghafari Date: Tue, 10 Jan 2023 12:50:48 -0500 Subject: [PATCH] SWDEV-369570 - MaxSharedMemoryPerBloc check Change-Id: I74d216a5d9316758bb611eb241ba85222194ce8b --- hipamd/src/hip_module.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hipamd/src/hip_module.cpp b/hipamd/src/hip_module.cpp index 01adeab472..f3ae26113f 100644 --- a/hipamd/src/hip_module.cpp +++ b/hipamd/src/hip_module.cpp @@ -224,6 +224,10 @@ hipError_t ihipLaunchKernel_validate(hipFunction_t f, uint32_t globalWorkSizeX, } const amd::Device* device = g_devices[deviceId]->devices()[0]; + const auto& info = device->info(); + if (sharedMemBytes > info.localMemSizePerCU_) { //sharedMemPerBlock + return hipErrorInvalidValue; + } // Make sure dispatch doesn't exceed max workgroup size limit if (blockDimX * blockDimY * blockDimZ > device->info().maxWorkGroupSize_) { return hipErrorInvalidValue;