[Openmp-commits] [llvm] [openmp] [Offload] Allow to record kernel launch stack traces (PR #100472)

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 30 15:00:17 PDT 2024


================
@@ -216,6 +216,90 @@ class ErrorReporter {
                        getAllocTyName(ATI->Kind).data(), DevicePtr);
 #undef DEALLOCATION_ERROR
   }
+
+  /// Report that a kernel encountered a trap instruction.
+  static void reportTrapInKernel(
+      GenericDeviceTy &Device, KernelTraceInfoRecordTy &KTIR,
+      std::function<bool(__tgt_async_info &)> AsyncInfoWrapperMatcher) {
+    assert(AsyncInfoWrapperMatcher && "A matcher is required");
+
+    uint32_t Idx = 0;
+    for (uint32_t I = 0, E = KTIR.size(); I < E; ++I) {
+      auto KTI = KTIR.getKernelTraceInfo(I);
----------------
jdoerfert wrote:

Likely, is that better? It has no precedent in Offload rn, maybe worth introducing in one swoop, if it is preferred.

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


More information about the Openmp-commits mailing list