[llvm] [OFFLOAD][OMP] Move OpenMP kernel argument processing from plugins (PR #213867)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 01:11:55 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Alex Duran (adurang)

<details>
<summary>Changes</summary>

This PR moves part of the OpenMP specific code that is inside the common code of the plugins that converts the kernel arguments from the OpenMP ABI to the expected format by the plugins. Also it handles the additional argument for the KernelLaunch environment.

It also decouples the plugin interface structs from the OpenMP specific ABI (KernelArgsTy) so changes to this interface do not require changes to the OpenMP ABI anymore. This also allows to merge what was KernelArgsTy and LaunchParamsTy into a single struct with all the information. Because of this there's a number of small changes scattered through the plugin infrastructure.

There is still some more OpenMP specific code that should be moved out eventually (and because of this we had to retain some of that informationt in the new KernelLaunchArgsTy for now) but I didn't want to complicate this PR further.

---

Patch is 49.36 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/213867.diff


12 Files Affected:

- (modified) offload/liboffload/src/OffloadImpl.cpp (+6-7) 
- (modified) offload/libomptarget/device.cpp (+70-2) 
- (modified) offload/plugins-nextgen/amdgpu/src/rtl.cpp (+18-20) 
- (modified) offload/plugins-nextgen/common/include/PluginInterface.h (+58-25) 
- (modified) offload/plugins-nextgen/common/include/RecordReplay.h (+13-15) 
- (modified) offload/plugins-nextgen/common/src/PluginInterface.cpp (+47-97) 
- (modified) offload/plugins-nextgen/common/src/RecordReplay.cpp (+13-15) 
- (modified) offload/plugins-nextgen/cuda/src/rtl.cpp (+8-9) 
- (modified) offload/plugins-nextgen/host/src/rtl.cpp (+4-4) 
- (modified) offload/plugins-nextgen/level_zero/include/L0Kernel.h (+5-5) 
- (modified) offload/plugins-nextgen/level_zero/src/L0Device.cpp (+2-2) 
- (modified) offload/plugins-nextgen/level_zero/src/L0Kernel.cpp (+6-6) 


``````````diff
diff --git a/offload/liboffload/src/OffloadImpl.cpp b/offload/liboffload/src/OffloadImpl.cpp
index 63fe726fbe544..277df26fbce8a 100644
--- a/offload/liboffload/src/OffloadImpl.cpp
+++ b/offload/liboffload/src/OffloadImpl.cpp
@@ -1239,8 +1239,11 @@ Error olLaunchKernel_impl(ol_queue_handle_t Queue, ol_device_handle_t Device,
                               "provided symbol is not a kernel");
 
   auto *QueueImpl = Queue ? Queue->AsyncInfo : nullptr;
-  KernelArgsTy LaunchArgs{};
+  KernelLaunchArgsTy LaunchArgs{};
   LaunchArgs.NumArgs = static_cast<uint32_t>(NumArgs);
+  LaunchArgs.Args = ArgPtrs;
+  LaunchArgs.ArgSizes =
+      reinterpret_cast<int64_t *>(const_cast<size_t *>(ArgSizes));
   LaunchArgs.UserNumBlocks[0] = LaunchSizeArgs->NumGroups.x;
   LaunchArgs.UserNumBlocks[1] = LaunchSizeArgs->NumGroups.y;
   LaunchArgs.UserNumBlocks[2] = LaunchSizeArgs->NumGroups.z;
@@ -1265,14 +1268,10 @@ Error olLaunchKernel_impl(ol_queue_handle_t Queue, ol_device_handle_t Device,
   }
 
   AsyncInfoWrapperTy AsyncInfoWrapper(*DeviceImpl, QueueImpl);
-  LaunchArgs.ArgPtrs = ArgPtrs;
-  LaunchArgs.ArgSizes =
-      reinterpret_cast<int64_t *>(const_cast<size_t *>(ArgSizes));
-  LaunchArgs.Flags.IsPtrArgs = true;
 
   auto *KernelImpl = std::get<GenericKernelTy *>(Kernel->PluginImpl);
-  auto Err = KernelImpl->launch(*DeviceImpl, LaunchArgs.ArgPtrs, nullptr,
-                                LaunchArgs, nullptr, AsyncInfoWrapper);
+  auto Err =
+      KernelImpl->launch(*DeviceImpl, LaunchArgs, nullptr, AsyncInfoWrapper);
 
   AsyncInfoWrapper.finalize(Err);
   if (Err)
diff --git a/offload/libomptarget/device.cpp b/offload/libomptarget/device.cpp
index 18339e9afe975..8bdde45dfc494 100644
--- a/offload/libomptarget/device.cpp
+++ b/offload/libomptarget/device.cpp
@@ -23,8 +23,10 @@
 #include "rtl.h"
 
 #include "Shared/EnvironmentVar.h"
+#include "llvm/Frontend/OpenMP/OMPConstants.h"
 #include "llvm/Support/Error.h"
 
+#include <algorithm>
 #include <cassert>
 #include <climits>
 #include <cstdint>
@@ -354,13 +356,79 @@ int32_t DeviceTy::notifyDataUnmapped(void *HstPtr) {
   return OFFLOAD_SUCCESS;
 }
 
+/// Resolve \p NumArgs (base pointer, offset) pairs into a flattened array of
+/// argument-value pointers suitable for a kernel launch, writing the result
+/// into \p LaunchArgs.NumArgs/Args. 
+static void resolveKernelLaunchParams(void **TgtArgs, ptrdiff_t *TgtOffsets,
+                                      uint32_t NumArgs,
+                                      llvm::SmallVector<void *> &Args,
+                                      llvm::SmallVector<void *> &Ptrs,
+                                      KernelLaunchArgsTy &LaunchArgs) {
+  LaunchArgs.NumArgs = NumArgs;
+  if (NumArgs == 0)
+    return;
+
+  Args.resize(NumArgs);
+  Ptrs.resize(NumArgs);
+
+  for (uint32_t I = 0; I < NumArgs; ++I)
+    Args[I] = reinterpret_cast<void *>(reinterpret_cast<intptr_t>(TgtArgs[I]) +
+                                       TgtOffsets[I]);
+  for (uint32_t I = 0; I < NumArgs; ++I)
+    Ptrs[I] = &Args[I];
+
+  LaunchArgs.Args = &Ptrs[0];
+}
+
 // Run region on device
 int32_t DeviceTy::launchKernel(void *TgtEntryPtr, void **TgtVarsPtr,
                                ptrdiff_t *TgtOffsets, KernelArgsTy &KernelArgs,
                                KernelExtraArgsTy *KernelExtraArgs,
                                AsyncInfoTy &AsyncInfo) {
-  return RTL->launch_kernel(RTLDeviceID, TgtEntryPtr, TgtVarsPtr, TgtOffsets,
-                            &KernelArgs, KernelExtraArgs, AsyncInfo);
+  llvm::SmallVector<void *> Args, Ptrs;
+
+  KernelLaunchArgsTy LaunchArgs;
+  LaunchArgs.OmpABIVersion = KernelArgs.Version;
+  LaunchArgs.ArgSizes = KernelArgs.ArgSizes;
+  LaunchArgs.Tripcount = KernelArgs.Tripcount;
+  LaunchArgs.DynCGroupMem = KernelArgs.DynCGroupMem;
+  std::copy(std::begin(KernelArgs.UserNumBlocks),
+            std::end(KernelArgs.UserNumBlocks), LaunchArgs.UserNumBlocks);
+  std::copy(std::begin(KernelArgs.UserThreadLimit),
+            std::end(KernelArgs.UserThreadLimit), LaunchArgs.UserThreadLimit);
+  LaunchArgs.Flags.Cooperative = KernelArgs.Flags.Cooperative;
+  LaunchArgs.Flags.StrictBlocksAndThreads =
+      KernelArgs.Flags.StrictBlocksAndThreads;
+  LaunchArgs.Flags.DynCGroupMemFallback = KernelArgs.Flags.DynCGroupMemFallback;
+
+  if (KernelArgs.Flags.IsCUDA) {
+    // Kernel languages (CUDA/HIP) pass an already-flattened argument-pointer
+    // array through KernelArgs.ArgPtrs instead of using the OpenMP
+    // base-pointer/offset argument scheme.
+    auto *LaunchParams =
+        reinterpret_cast<KernelLaunchParamsTy *>(KernelArgs.ArgPtrs);
+    LaunchArgs.NumArgs = LaunchParams->NumArgs;
+    LaunchArgs.Args = LaunchParams->Args;
+  } else {
+    resolveKernelLaunchParams(TgtVarsPtr, TgtOffsets, KernelArgs.NumArgs, Args,
+                              Ptrs, LaunchArgs);
+    // The dyn_ptr slot is reserved by the host (version >= 4) or by
+    // upgradeKernelArgs (version 3) as the last element of the argument
+    // array. Version 3 device kernels expect it first instead, so rotate it
+    // to the front to match that ABI.
+    if (KernelArgs.NumArgs > 0 &&
+        KernelArgs.Version >= OMP_KERNEL_ARG_MIN_VERSION_WITH_DYN_PTR) {
+      if (KernelArgs.Version == OMP_KERNEL_ARG_MIN_VERSION_WITH_DYN_PTR) {
+        std::rotate(Args.begin(), Args.end() - 1, Args.end());
+        LaunchArgs.DynPtrSlot = &Args[0];
+      } else {
+        LaunchArgs.DynPtrSlot = &Args[KernelArgs.NumArgs - 1];
+      }
+    }
+  }
+
+  return RTL->launch_kernel(RTLDeviceID, TgtEntryPtr, LaunchArgs,
+                            KernelExtraArgs, AsyncInfo);
 }
 
 // Run region on device
diff --git a/offload/plugins-nextgen/amdgpu/src/rtl.cpp b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
index 65ef83c394f6a..53bd150732887 100644
--- a/offload/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -648,7 +648,7 @@ struct AMDGPUKernelTy : public GenericKernelTy {
   /// Launch the AMDGPU kernel function.
   Error launchImpl(GenericDeviceTy &GenericDevice, uint32_t NumThreads[3],
                    uint32_t NumBlocks[3], uint32_t DynBlockMemSize,
-                   KernelArgsTy &KernelArgs, KernelLaunchParamsTy LaunchParams,
+                   KernelLaunchArgsTy &LaunchArgs,
                    AsyncInfoWrapperTy &AsyncInfoWrapper) const override;
 
   /// Return maximum block size for maximum occupancy
@@ -663,7 +663,8 @@ struct AMDGPUKernelTy : public GenericKernelTy {
 
   /// Print more elaborate kernel launch info for AMDGPU
   Error printLaunchInfoDetails(GenericDeviceTy &GenericDevice,
-                               KernelArgsTy &KernelArgs, uint32_t NumThreads[3],
+                               const KernelLaunchArgsTy &LaunchArgs,
+                               uint32_t NumThreads[3],
                                uint32_t NumBlocks[3]) const override;
 
   /// Get group and private segment kernel size.
@@ -3561,11 +3562,11 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
 
     AsyncInfoWrapperTy AsyncInfoWrapper(*this, nullptr);
 
-    KernelArgsTy KernelArgs = {};
+    KernelLaunchArgsTy LaunchArgs = {};
     uint32_t NumBlocksAndThreads[3] = {1u, 1u, 1u};
-    auto Err = AMDGPUKernel.launchImpl(
-        *this, NumBlocksAndThreads, NumBlocksAndThreads, 0, KernelArgs,
-        KernelLaunchParamsTy{}, AsyncInfoWrapper);
+    auto Err =
+        AMDGPUKernel.launchImpl(*this, NumBlocksAndThreads, NumBlocksAndThreads,
+                                0, LaunchArgs, AsyncInfoWrapper);
 
     AsyncInfoWrapper.finalize(Err);
     return Err;
@@ -4227,11 +4228,10 @@ struct AMDGPUPluginTy final : public GenericPluginTy {
 Error AMDGPUKernelTy::launchImpl(GenericDeviceTy &GenericDevice,
                                  uint32_t NumThreads[3], uint32_t NumBlocks[3],
                                  uint32_t DynBlockMemSize,
-                                 KernelArgsTy &KernelArgs,
-                                 KernelLaunchParamsTy LaunchParams,
+                                 KernelLaunchArgsTy &LaunchArgs,
                                  AsyncInfoWrapperTy &AsyncInfoWrapper) const {
   // Cooperative kernel launch is not yet supported for AMDGPU
-  if (KernelArgs.Flags.Cooperative)
+  if (LaunchArgs.Flags.Cooperative)
     return Plugin::error(ErrorCode::UNSUPPORTED,
                          "cooperative kernel launch not supported for AMDGPU");
 
@@ -4250,9 +4250,9 @@ Error AMDGPUKernelTy::launchImpl(GenericDeviceTy &GenericDevice,
 
   // Copy explicit arguments.
   size_t ExplicitEnd = 0;
-  if (LaunchParams.Args) {
+  if (LaunchArgs.Args) {
     const auto &ArgMDs = KernelInfo.ArgMDs;
-    uint32_t NumArgs = LaunchParams.NumArgs;
+    uint32_t NumArgs = LaunchArgs.NumArgs;
 
     if (NumArgs > ArgMDs.size())
       return Plugin::error(
@@ -4263,8 +4263,7 @@ Error AMDGPUKernelTy::launchImpl(GenericDeviceTy &GenericDevice,
 
     for (size_t I = 0; I < NumArgs; I++) {
       auto [Offset, Size] = ArgMDs[I];
-      std::memcpy(utils::advancePtr(AllArgs, Offset), LaunchParams.Args[I],
-                  Size);
+      std::memcpy(utils::advancePtr(AllArgs, Offset), LaunchArgs.Args[I], Size);
     }
 
     auto [Offset, Size] = ArgMDs[NumArgs - 1];
@@ -4309,7 +4308,7 @@ Error AMDGPUKernelTy::launchImpl(GenericDeviceTy &GenericDevice,
                                : 1 + (NumBlocks[1] * NumThreads[1] != 1));
 
     hsa_utils::initImplArg(ImplArgs, &ImplArgsTy::DynamicLdsSize, ImplArgsSize,
-                           KernelArgs.DynCGroupMem);
+                           LaunchArgs.DynCGroupMem);
   }
 
   // HSA requires the group segment size to include both static and dynamic.
@@ -4321,10 +4320,9 @@ Error AMDGPUKernelTy::launchImpl(GenericDeviceTy &GenericDevice,
                                   ArgsMemoryManager);
 }
 
-Error AMDGPUKernelTy::printLaunchInfoDetails(GenericDeviceTy &GenericDevice,
-                                             KernelArgsTy &KernelArgs,
-                                             uint32_t NumThreads[3],
-                                             uint32_t NumBlocks[3]) const {
+Error AMDGPUKernelTy::printLaunchInfoDetails(
+    GenericDeviceTy &GenericDevice, const KernelLaunchArgsTy &LaunchArgs,
+    uint32_t NumThreads[3], uint32_t NumBlocks[3]) const {
   // Only do all this when the output is requested
   if (!(getInfoLevel() & OMP_INFOTYPE_PLUGIN_KERNEL))
     return Plugin::success();
@@ -4334,8 +4332,8 @@ Error AMDGPUKernelTy::printLaunchInfoDetails(GenericDeviceTy &GenericDevice,
   auto *ThreadsPerGroup = NumThreads;
 
   // Kernel Arguments Info
-  auto ArgNum = KernelArgs.NumArgs;
-  auto LoopTripCount = KernelArgs.Tripcount;
+  auto ArgNum = LaunchArgs.NumArgs;
+  auto LoopTripCount = LaunchArgs.Tripcount;
 
   // Details for AMDGPU kernels (read from image)
   // https://www.llvm.org/docs/AMDGPUUsage.html#code-object-v4-metadata
diff --git a/offload/plugins-nextgen/common/include/PluginInterface.h b/offload/plugins-nextgen/common/include/PluginInterface.h
index 67ebfbc943fdc..a669cddd0b76e 100644
--- a/offload/plugins-nextgen/common/include/PluginInterface.h
+++ b/offload/plugins-nextgen/common/include/PluginInterface.h
@@ -424,6 +424,45 @@ class DeviceImageTy {
   }
 };
 
+/// The subset of KernelArgsTy fields the plugin interface needs to launch a
+/// kernel, plus the resolved argument-pointer array. Unlike KernelArgsTy,
+/// this struct is populated by libomptarget on the stack for every launch,
+/// so it is never aliased onto compiler-emitted memory and may be extended
+/// freely.
+struct KernelLaunchArgsTy {
+  /// Version of KernelArgsTy this launch was built from, for ABI
+  /// compatibility checks.
+  uint32_t OmpABIVersion = 0;
+  /// Number of kernel arguments in \p Args.
+  uint32_t NumArgs = 0;
+  /// Array of \p NumArgs pointers, each pointing at one argument's value,
+  /// with any offsets already resolved.
+  void **Args = nullptr;
+  /// Size of the argument data in bytes, one entry per \p Args element,
+  /// possibly null.
+  int64_t *ArgSizes = nullptr;
+  /// Address of the element of \p Args reserved for the kernel launch
+  /// environment (dyn_ptr), or null if this launch has no such slot. The
+  /// caller owns the storage it points into; the plugin fills it in once it
+  /// has computed the actual (device-side) value.
+  void **DynPtrSlot = nullptr;
+  /// Tripcount for the teams / distribute loop, 0 otherwise.
+  uint64_t Tripcount = 0;
+  /// Amount of dynamic cgroup memory requested.
+  uint32_t DynCGroupMem = 0;
+  /// User-requested number of blocks (for x,y,z dimension).
+  uint32_t UserNumBlocks[3] = {0, 0, 0};
+  /// User-requested number of threads (for x,y,z dimension).
+  uint32_t UserThreadLimit[3] = {0, 0, 0};
+  struct {
+    uint64_t Cooperative : 1; // Was this kernel spawned as cooperative.
+    uint64_t StrictBlocksAndThreads
+        : 1; // The user-requested number of blocks and threads are strict.
+    uint64_t DynCGroupMemFallback : 2; // The fallback for dynamic cgroup mem.
+    uint64_t Unused : 60;
+  } Flags = {0, 0, 0, 0};
+};
+
 /// Class implementing common functionalities of offload kernels. Each plugin
 /// should define the specific kernel class, derive from this generic one, and
 /// implement the necessary virtual function members.
@@ -440,15 +479,18 @@ struct GenericKernelTy {
                          DeviceImageTy &Image) = 0;
 
   /// Launch the kernel on the specific device. The device must be the same
-  /// one used to initialize the kernel.
-  Error launch(GenericDeviceTy &GenericDevice, void **ArgPtrs,
-               ptrdiff_t *ArgOffsets, KernelArgsTy &KernelArgs,
+  /// one used to initialize the kernel. \p LaunchArgs.Args is the flattened
+  /// argument-pointer array to pass to the kernel, with any offsets already
+  /// resolved. \p LaunchArgs.DynPtrSlot, if non-null, points at the element
+  /// of it reserved for the kernel launch environment (dyn_ptr); the caller
+  /// owns the storage it points into.
+  Error launch(GenericDeviceTy &GenericDevice, KernelLaunchArgsTy &LaunchArgs,
                KernelExtraArgsTy *KernelExtraArgs,
                AsyncInfoWrapperTy &AsyncInfoWrapper) const;
   virtual Error launchImpl(GenericDeviceTy &GenericDevice,
                            uint32_t NumThreads[3], uint32_t NumBlocks[3],
-                           uint32_t DynBlockMemSize, KernelArgsTy &KernelArgs,
-                           KernelLaunchParamsTy LaunchParams,
+                           uint32_t DynBlockMemSize,
+                           KernelLaunchArgsTy &LaunchArgs,
                            AsyncInfoWrapperTy &AsyncInfoWrapper) const = 0;
 
   virtual Expected<uint64_t> maxGroupSize(GenericDeviceTy &GenericDevice,
@@ -488,7 +530,7 @@ struct GenericKernelTy {
   /// \p NumBlocks0 is the number of blocks for this launch and is used to size
   /// the reduction buffer.
   Expected<KernelLaunchEnvironmentTy *> getKernelLaunchEnvironment(
-      GenericDeviceTy &GenericDevice, const KernelArgsTy &KernelArgs,
+      GenericDeviceTy &GenericDevice, const KernelLaunchArgsTy &LaunchArgs,
       const DynBlockMemConfTy &DynBlockMemConf,
       AsyncInfoWrapperTy &AsyncInfoWrapper, uint32_t NumBlocks0) const;
 
@@ -525,31 +567,23 @@ struct GenericKernelTy {
 
   /// Prints generic kernel launch information.
   Error printLaunchInfo(GenericDeviceTy &GenericDevice,
-                        KernelArgsTy &KernelArgs, uint32_t NumThreads[3],
-                        uint32_t NumBlocks[3]) const;
+                        const KernelLaunchArgsTy &LaunchArgs,
+                        uint32_t NumThreads[3], uint32_t NumBlocks[3]) const;
 
   /// Prints plugin-specific kernel launch information after generic kernel
   /// launch information
   virtual Error printLaunchInfoDetails(GenericDeviceTy &GenericDevice,
-                                       KernelArgsTy &KernelArgs,
+                                       const KernelLaunchArgsTy &LaunchArgs,
                                        uint32_t NumThreads[3],
                                        uint32_t NumBlocks[3]) const;
 
 private:
   /// Prepare the block memory buffer requested for the kernel and execute the
   /// specified fallback if necessary.
-  Expected<DynBlockMemConfTy> prepareBlockMemory(GenericDeviceTy &GenericDevice,
-                                                 KernelArgsTy &KernelArgs,
-                                                 uint32_t NumBlocks) const;
-
-  /// Prepare the arguments before launching the kernel.
-  KernelLaunchParamsTy
-  prepareArgs(GenericDeviceTy &GenericDevice, void **ArgPtrs,
-              ptrdiff_t *ArgOffsets, uint32_t &NumArgs,
-              llvm::SmallVectorImpl<void *> &Args,
-              llvm::SmallVectorImpl<void *> &Ptrs,
-              KernelLaunchEnvironmentTy *KernelLaunchEnvironment,
-              uint32_t Version) const;
+  Expected<DynBlockMemConfTy>
+  prepareBlockMemory(GenericDeviceTy &GenericDevice,
+                     const KernelLaunchArgsTy &LaunchArgs,
+                     uint32_t NumBlocks) const;
 
   /// Get the effective number of threads for the kernel based on the
   /// user-defined number of threads.
@@ -1099,8 +1133,7 @@ struct GenericDeviceTy : public DeviceAllocatorTy {
   }
 
   /// Run the kernel associated with \p EntryPtr
-  Error launchKernel(void *EntryPtr, void **ArgPtrs, ptrdiff_t *ArgOffsets,
-                     KernelArgsTy &KernelArgs,
+  Error launchKernel(void *EntryPtr, KernelLaunchArgsTy &LaunchArgs,
                      KernelExtraArgsTy *KernelExtraArgs,
                      __tgt_async_info *AsyncInfo);
 
@@ -1714,8 +1747,8 @@ struct GenericPluginTy {
   int32_t data_fence(int32_t DeviceId, __tgt_async_info *AsyncInfo);
 
   /// Begin executing a kernel on the given device.
-  int32_t launch_kernel(int32_t DeviceId, void *TgtEntryPtr, void **TgtArgs,
-                        ptrdiff_t *TgtOffsets, KernelArgsTy *KernelArgs,
+  int32_t launch_kernel(int32_t DeviceId, void *TgtEntryPtr,
+                        KernelLaunchArgsTy &LaunchArgs,
                         KernelExtraArgsTy *KernelExtraArgs,
                         __tgt_async_info *AsyncInfoPtr);
 
diff --git a/offload/plugins-nextgen/common/include/RecordReplay.h b/offload/plugins-nextgen/common/include/RecordReplay.h
index 4c81f64620f32..5402bb64d8b24 100644
--- a/offload/plugins-nextgen/common/include/RecordReplay.h
+++ b/offload/plugins-nextgen/common/include/RecordReplay.h
@@ -39,6 +39,7 @@ namespace plugin {
 
 struct GenericKernelTy;
 struct GenericDeviceTy;
+struct KernelLaunchArgsTy;
 
 struct RecordReplayTy {
 protected:
@@ -204,11 +205,12 @@ struct RecordReplayTy {
   /// executing the kernel. This phase can include the recording of memory
   /// snapshot, the record descriptor and the globals. When replaying, only the
   /// instance is registered.
-  Expected<HandleTy>
-  recordPrologue(const GenericKernelTy &Kernel, const KernelArgsTy &KernelArgs,
-                 const KernelExtraArgsTy *KernelExtraArgs,
-                 const KernelLaunchParamsTy &LaunchParams, uint32_t NumTeams[3],
-                 uint32_t NumThreads[3], uint32_t SharedMemorySize);
+  Expected<HandleTy> recordPrologue(const GenericKernelTy &Kernel,
+                                    const KernelLaunchArgsTy &LaunchArgs,
+                                    const KernelExtraArgsTy *KernelExtraArgs,
+                                    uint32_t NumTeams[3],
+                                    uint32_t NumThreads[3],
+                                    uint32_t SharedMemorySize);
 
   /// Record the epilogue if necessary, which can include the memory snapshot
   /// when recording or replaying.
@@ -242,10 +244,9 @@ struct RecordReplayTy {
                              KernelReplayOutcomeTy &Outcome);
 
   /// Record the prologue data.
-  virtual Error
-  recordPrologueImpl(const GenericKernelTy &Kernel, const InstanceTy &Instance,
-                     const KernelArgsTy &KernelArgs,
-                     const KernelLaunchParamsTy &LaunchParams) = 0;
+  virtual Error recordPrologueImpl(const GenericKernelTy &Kernel,
+                                   const InstanceTy &Instance,
+                                   const KernelLaunchArgsTy &LaunchArgs) = 0;
 
   /// Record the epilogue data.
   virtual Error recordEpilogueImpl(const GenericKernelTy &Kernel,
@@ -254,8 +255,7 @@...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/213867


More information about the llvm-commits mailing list