Skip to content

Commit d8bf7d2

Browse files
shiltiantru
authored andcommitted
[OpenMP][NVPTX] Added __tgt_rtl_launch_kernel in old CUDA plugin
Fix #60248. Reviewed By: jhuber6 Differential Revision: https://reviews.llvm.org/D142819
1 parent f9a2fba commit d8bf7d2

File tree

1 file changed

+15
-0
lines changed
  • openmp/libomptarget/plugins/cuda/src

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,6 +1901,21 @@ int32_t __tgt_rtl_init_device_info(int32_t DeviceId,
19011901
return DeviceRTL.initDeviceInfo(DeviceId, DeviceInfoPtr, ErrStr);
19021902
}
19031903

1904+
int32_t __tgt_rtl_launch_kernel(int32_t DeviceId, void *TgtEntryPtr,
1905+
void **TgtArgs, ptrdiff_t *TgtOffsets,
1906+
KernelArgsTy *KernelArgs,
1907+
__tgt_async_info *AsyncInfo) {
1908+
assert(DeviceRTL.isValidDeviceId(DeviceId) && "device_id is invalid");
1909+
1910+
if (DeviceRTL.setContext(DeviceId) != OFFLOAD_SUCCESS)
1911+
return OFFLOAD_FAIL;
1912+
1913+
return DeviceRTL.runTargetTeamRegion(
1914+
DeviceId, TgtEntryPtr, TgtArgs, TgtOffsets, KernelArgs->NumArgs,
1915+
KernelArgs->NumTeams[0], KernelArgs->ThreadLimit[0],
1916+
KernelArgs->Tripcount, AsyncInfo);
1917+
}
1918+
19041919
#ifdef __cplusplus
19051920
}
19061921
#endif

0 commit comments

Comments
 (0)