[Openmp-commits] [PATCH] D142819: [OpenMP][NVPTX] Added `__tgt_rtl_launch_kernel` in old CUDA plugin

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sat Jan 28 15:56:12 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGad95b0e97750: [OpenMP][NVPTX] Added `__tgt_rtl_launch_kernel` in old CUDA plugin (authored by tianshilei1992).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142819/new/

https://reviews.llvm.org/D142819

Files:
  openmp/libomptarget/plugins/cuda/src/rtl.cpp


Index: openmp/libomptarget/plugins/cuda/src/rtl.cpp
===================================================================
--- openmp/libomptarget/plugins/cuda/src/rtl.cpp
+++ openmp/libomptarget/plugins/cuda/src/rtl.cpp
@@ -1901,6 +1901,21 @@
   return DeviceRTL.initDeviceInfo(DeviceId, DeviceInfoPtr, ErrStr);
 }
 
+int32_t __tgt_rtl_launch_kernel(int32_t DeviceId, void *TgtEntryPtr,
+                                void **TgtArgs, ptrdiff_t *TgtOffsets,
+                                KernelArgsTy *KernelArgs,
+                                __tgt_async_info *AsyncInfo) {
+  assert(DeviceRTL.isValidDeviceId(DeviceId) && "device_id is invalid");
+
+  if (DeviceRTL.setContext(DeviceId) != OFFLOAD_SUCCESS)
+    return OFFLOAD_FAIL;
+
+  return DeviceRTL.runTargetTeamRegion(
+      DeviceId, TgtEntryPtr, TgtArgs, TgtOffsets, KernelArgs->NumArgs,
+      KernelArgs->NumTeams[0], KernelArgs->ThreadLimit[0],
+      KernelArgs->Tripcount, AsyncInfo);
+}
+
 #ifdef __cplusplus
 }
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142819.493041.patch
Type: text/x-patch
Size: 993 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230128/3561d475/attachment.bin>


More information about the Openmp-commits mailing list