Page MenuHomePhabricator

[OpenMP] Use IsHostPtr where needed in rest of omptarget.cpp

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



As started in D107925, this patch replaces the remaining occurrences of
UNIFIED_SHARED_MEMORY && TgtPtrBegin == HstPtrBegin in
omptarget.cpp with IsHostPtr. The former condition is broken in
the rare case that the device and host happen to use the same address
for their mapped allocations. I don't know how to write a test that's
likely to reveal this case.

Diff Detail

Event Timeline

jdenny created this revision.Aug 11 2021, 1:06 PM
jdenny requested review of this revision.Aug 11 2021, 1:07 PM
grokos accepted this revision.Aug 27 2021, 3:54 PM

I don't think it is at all possible to write a test emulating this rare case of TgtPtr in GPU memory having the same value as HstPtr in host memory, so this is good to go even without a test. LGTM.

This revision is now accepted and ready to land.Aug 27 2021, 3:54 PM