From 78d068f15381e7e57d4f4c9e009f064db9e37be1 Mon Sep 17 00:00:00 2001 From: Sourabh Betigeri Date: Thu, 26 Sep 2024 17:35:43 -0700 Subject: [PATCH] SWDEV-450052 - Return if numDevices is more than device count on the platform Change-Id: I538106d1b02084df9cd06b41427629207312e76f [ROCm/clr commit: 64e1b15551d1917c3419a384e9d5426a065ca33d] --- projects/clr/hipamd/src/hip_module.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_module.cpp b/projects/clr/hipamd/src/hip_module.cpp index 9dfb745737..4c1b63172d 100644 --- a/projects/clr/hipamd/src/hip_module.cpp +++ b/projects/clr/hipamd/src/hip_module.cpp @@ -817,7 +817,7 @@ hipError_t hipLaunchCooperativeKernel_spt(const void* f, dim3 gridDim, dim3 bloc hipError_t ihipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList, int numDevices, unsigned int flags, uint32_t extFlags) { - if (launchParamsList == nullptr) { + if (launchParamsList == nullptr || numDevices > g_devices.size()) { return hipErrorInvalidValue; }