From 2e52ceca29a30c417c6fffb6cf3a1b2e97585df5 Mon Sep 17 00:00:00 2001 From: Payam Date: Fri, 12 Mar 2021 19:15:11 -0500 Subject: [PATCH] SWDEV-182753 - Throw error if launch params>bounds Change-Id: I5f9931efac37e3149894ca116a1b0c2dcc3e5bc5 --- hipamd/rocclr/hip_module.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hipamd/rocclr/hip_module.cpp b/hipamd/rocclr/hip_module.cpp index b3af64a425..dadd6d482f 100755 --- a/hipamd/rocclr/hip_module.cpp +++ b/hipamd/rocclr/hip_module.cpp @@ -252,6 +252,13 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX, return hipErrorInvalidConfiguration; } + // Make sure the launch params are not larger than if specified launch_bounds + if (blockDimX * blockDimY * blockDimZ > kernel->getDeviceKernel(device)->workGroupInfo()->size_) { + LogPrintfError("%s", "Launch params are larger than launch bounds"); + return hipErrorLaunchFailure; + } + + if (params & amd::NDRangeKernelCommand::CooperativeGroups) { if (!device.info().cooperativeGroups_) { return hipErrorLaunchFailure;