[Openmp-commits] [openmp] ad95b0e - [OpenMP][NVPTX] Added `__tgt_rtl_launch_kernel` in old CUDA plugin

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


Author: Shilei Tian
Date: 2023-01-28T18:56:07-05:00
New Revision: ad95b0e977506228155a3fd4f97635f56341800f

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

LOG: [OpenMP][NVPTX] Added `__tgt_rtl_launch_kernel` in old CUDA plugin

Fix #60248.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D142819

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp
index 67d1b2a2acfd1..f797011c80ea7 100644
--- a/openmp/libomptarget/plugins/cuda/src/rtl.cpp
+++ b/openmp/libomptarget/plugins/cuda/src/rtl.cpp
@@ -1901,6 +1901,21 @@ int32_t __tgt_rtl_init_device_info(int32_t DeviceId,
   return DeviceRTL.initDeviceInfo(DeviceId, DeviceInfoPtr, ErrStr);
 }
 
+int32_t __tgt_rtl_launch_kernel(int32_t DeviceId, void *TgtEntryPtr,
+                                void **TgtArgs, ptr
diff _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


        


More information about the Openmp-commits mailing list