Page MenuHomePhabricator

[OpenMP] Use IsHostPtr where needed for targetDataBegin
ClosedPublic

Authored by jdenny on Aug 11 2021, 1:05 PM.

Details

Summary

As discussed in D105990, without this patch, targetDataBegin
determines whether to transfer data (as opposed to assuming it's in
shared memory) using the condition !UseUSM || HasCloseModifier.
However, this condition is broken if use of discrete memory was forced
by omp_target_associate_ptr. This patch extends
unified_shared_memory/associate_ptr.c to reveal this case, and it
fixes it using !IsHostPtr in DeviceTy::getTargetPointer to replace
this condition.

Diff Detail

Event Timeline

jdenny created this revision.Aug 11 2021, 1:05 PM
jdenny requested review of this revision.Aug 11 2021, 1:05 PM
jdenny added inline comments.Aug 11 2021, 2:11 PM
openmp/libomptarget/src/device.h
264–265

Ah, I overlooked this documentation. I'll update it later.

grokos accepted this revision.Aug 27 2021, 3:51 PM

LG, just update the documentation in device.h:lookupMapping().

This revision is now accepted and ready to land.Aug 27 2021, 3:51 PM
This revision was landed with ongoing or failed builds.Sep 1 2021, 2:38 PM
This revision was automatically updated to reflect the committed changes.