[Openmp-commits] [openmp] 726ee40 - [OpenMP] Move the recording code to account for KernelLaunchEnvironment
Johannes Doerfert via Openmp-commits
openmp-commits at lists.llvm.org
Mon Nov 6 12:30:48 PST 2023
Author: Johannes Doerfert
Date: 2023-11-06T12:30:40-08:00
New Revision: 726ee40f524918f9a6a6bba5a73e4d88c02a2cc3
URL: https://github.com/llvm/llvm-project/commit/726ee40f524918f9a6a6bba5a73e4d88c02a2cc3
DIFF: https://github.com/llvm/llvm-project/commit/726ee40f524918f9a6a6bba5a73e4d88c02a2cc3.diff
LOG: [OpenMP] Move the recording code to account for KernelLaunchEnvironment
We need to record late to account for the kernel launch environment as
well as the potential changes in block and thread count.
Added:
Modified:
openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
Removed:
################################################################################
diff --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
index a47481104430f36..117ed94a1da6ffa 100644
--- a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
+++ b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
@@ -504,6 +504,12 @@ Error GenericKernelTy::launch(GenericDeviceTy &GenericDevice, void **ArgPtrs,
printLaunchInfo(GenericDevice, KernelArgs, NumThreads, NumBlocks))
return Err;
+ if (RecordReplay.isRecording())
+ RecordReplay.saveKernelInputInfo(
+ getName(), getImage(), ArgPtrs, ArgOffsets,
+ KernelArgs.NumArgs - /* KernelLaunchEnvironment */ 1, NumBlocks,
+ NumThreads, KernelArgs.Tripcount);
+
return launchImpl(GenericDevice, NumThreads, NumBlocks, KernelArgs,
KernelArgsPtr, AsyncInfoWrapper);
}
@@ -1405,12 +1411,6 @@ Error GenericDeviceTy::launchKernel(void *EntryPtr, void **ArgPtrs,
GenericKernelTy &GenericKernel =
*reinterpret_cast<GenericKernelTy *>(EntryPtr);
- if (RecordReplay.isRecording())
- RecordReplay.saveKernelInputInfo(
- GenericKernel.getName(), GenericKernel.getImage(), ArgPtrs, ArgOffsets,
- KernelArgs.NumArgs, KernelArgs.NumTeams[0], KernelArgs.ThreadLimit[0],
- KernelArgs.Tripcount);
-
if (RecordReplay.isRecording())
RecordReplay.saveImage(GenericKernel.getName(), GenericKernel.getImage());
More information about the Openmp-commits
mailing list