[Openmp-commits] [openmp] 1637c07 - [openmp][amdgpu] Add DynamicLdsSize to AMDGPUImplicitArgsTy (#65325)

via Openmp-commits openmp-commits at lists.llvm.org
Fri Jan 5 20:04:52 PST 2024


Author: Chaitanya
Date: 2024-01-06T09:34:48+05:30
New Revision: 1637c0792550f70e4b2ef42b3d08aa91dd27f4a9

URL: https://github.com/llvm/llvm-project/commit/1637c0792550f70e4b2ef42b3d08aa91dd27f4a9
DIFF: https://github.com/llvm/llvm-project/commit/1637c0792550f70e4b2ef42b3d08aa91dd27f4a9.diff

LOG: [openmp][amdgpu] Add DynamicLdsSize to AMDGPUImplicitArgsTy (#65325)

#65273 "hidden_dynamic_lds_size" argument will be added in the reserved
section at offset 120 of the implicit argument layout
Add DynamicLdsSize to AMDGPUImplicitArgsTy struct at offset 120 and fill
the dynamic LDS size before kernel launch.

Added: 
    

Modified: 
    openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
    openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
index 0411c670133422..18076f8082d0f6 100644
--- a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -3203,6 +3203,7 @@ Error AMDGPUKernelTy::launchImpl(GenericDeviceTy &GenericDevice,
     ImplArgs->GroupSizeY = 1;
     ImplArgs->GroupSizeZ = 1;
     ImplArgs->GridDims = 1;
+    ImplArgs->DynamicLdsSize = KernelArgs.DynCGroupMem;
   }
 
   // Push the kernel launch into the stream.

diff  --git a/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h b/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
index 2471590c27b376..58a3b5df00fac6 100644
--- a/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
+++ b/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
@@ -45,7 +45,9 @@ struct AMDGPUImplicitArgsTy {
   uint16_t GroupSizeZ;
   uint8_t Unused0[46]; // 46 byte offset.
   uint16_t GridDims;
-  uint8_t Unused1[190]; // 190 byte offset.
+  uint8_t Unused1[54]; // 54 byte offset.
+  uint32_t DynamicLdsSize;
+  uint8_t Unused2[132]; // 132 byte offset.
 };
 
 // Dummy struct for COV4 implicitargs.


        


More information about the Openmp-commits mailing list