Skip to content

Commit bcf51ad

Browse files
committed
[flang-rt] Use omp_get_mapped_ptr to get device ptrs.
1 parent 26c83e4 commit bcf51ad

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

flang-rt/lib/runtime/assign_omp.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ template <typename T> static T *getDevicePtr(T *anyPtr, OMPDeviceTy ompDevice) {
2727
// If not present on the device it should already be a device ptr
2828
if (!omp_target_is_present(voidAnyPtr, ompDevice))
2929
return anyPtr;
30-
T *device_ptr = nullptr;
31-
#pragma omp target data use_device_ptr(anyPtr) device(ompDevice)
32-
device_ptr = anyPtr;
30+
T *device_ptr = omp_get_mapped_ptr(anyPtr, ompDevice);
3331
return device_ptr;
3432
}
3533

0 commit comments

Comments
 (0)