[OpenMP] Account for dynamic shared memory in the AMDGPU nextgen plugin
authorJohannes Doerfert <johannes@jdoerfert.de>
Tue, 20 Dec 2022 03:09:07 +0000 (19:09 -0800)
committerJohannes Doerfert <johannes@jdoerfert.de>
Tue, 20 Dec 2022 03:09:44 +0000 (19:09 -0800)
openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp

index b9c3877..901b997 100644 (file)
@@ -400,6 +400,10 @@ struct AMDGPUKernelTy : public GenericKernelTy {
         return Err;
     }
 
+    // Account for user requested dynamic shared memory.
+    // TODO: This should be read from a per-kernel state flag.
+    GroupSize += Device.getDynamicMemorySize();
+
     // Make sure it is a kernel symbol.
     if (SymbolType != HSA_SYMBOL_KIND_KERNEL)
       return Plugin::error("Symbol %s is not a kernel function");