Skip to content

Commit

Permalink
[OpenMP52][LIBOMPTARGET] Do not throw error in omp_get_mapped_ptr for…
Browse files Browse the repository at this point in the history
… the host (#80038)

OpenMP spec 5.2 specifies return value to be the host ptr
in case of device_num being same as omp_get_initial_device().
  • Loading branch information
saiislam committed Jan 30, 2024
1 parent 2e16500 commit 5f6640e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openmp/libomptarget/src/OpenMP/API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ EXTERN void *omp_get_mapped_ptr(const void *Ptr, int DeviceNum) {

size_t NumDevices = omp_get_initial_device();
if (DeviceNum == NumDevices) {
REPORT("Device %d is initial device, returning Ptr " DPxMOD ".\n",
DP("Device %d is initial device, returning Ptr " DPxMOD ".\n",
DeviceNum, DPxPTR(Ptr));
return const_cast<void *>(Ptr);
}
Expand Down

0 comments on commit 5f6640e

Please sign in to comment.