From 73698479a9d85539fdff105b8757e228c61882d7 Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Tue, 11 Apr 2023 17:16:49 -0400 Subject: [PATCH] SWDEV-382359 - Workaround a non-uniform launch in MIOpen Change-Id: I0abff25fb20143225739e771c4d3bae5c2a054b9 --- hipamd/src/hip_module.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hipamd/src/hip_module.cpp b/hipamd/src/hip_module.cpp index 83bd08be50..b6606fce87 100644 --- a/hipamd/src/hip_module.cpp +++ b/hipamd/src/hip_module.cpp @@ -370,6 +370,11 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX, if (status != hipSuccess) { return status; } + // Make sure the app doesn't launch a workgroup bigger than the global size + if (globalWorkSizeX < blockDimX) blockDimX = globalWorkSizeX; + if (globalWorkSizeY < blockDimY) blockDimY = globalWorkSizeY; + if (globalWorkSizeZ < blockDimZ) blockDimZ = globalWorkSizeZ; + amd::Command* command = nullptr; hip::Stream* hip_stream = hip::getStream(hStream); status = ihipLaunchKernelCommand(command, f, globalWorkSizeX, globalWorkSizeY, globalWorkSizeZ, @@ -531,7 +536,7 @@ hipError_t ihipModuleLaunchCooperativeKernelMultiDevice(hipFunctionLaunchParams* return hipErrorInvalidValue; } - if (flags > (hipCooperativeLaunchMultiDeviceNoPostSync + + if (flags > (hipCooperativeLaunchMultiDeviceNoPostSync + hipCooperativeLaunchMultiDeviceNoPreSync)) { return hipErrorInvalidValue; }