Skip to content

Commit

Permalink
[OpenMP][NVPTX] Added __tgt_rtl_launch_kernel in old CUDA plugin
Browse files Browse the repository at this point in the history
Fix #60248.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D142819
  • Loading branch information
shiltian authored and tru committed Feb 2, 2023
1 parent f9a2fba commit d8bf7d2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions openmp/libomptarget/plugins/cuda/src/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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

0 comments on commit d8bf7d2

Please sign in to comment.