Skip to content

Commit ddec74c

Browse files
[Flang][OpenMP] Fix GenASiS failure for HSA_XNACK=1 (llvm#2308)
The previous downstream fix ( https://github.com/AMD-Lightning-Internal/llvm-project/pull/2114 ) enabled the GenASiS benchmark for HSA_XNACK=1 if it is compiled with the -fopenmp-force-usm mode. This downstream fix supports zero-copy for the GenASiS benchmark without the need for recompilation.
1 parent 321c81f commit ddec74c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

offload/libomptarget/omptarget.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,8 @@ postProcessingTargetDataEnd(DeviceTy *Device,
600600
// TODO/FIXME: Look into a better longterm solution, such as a different
601601
// mapping combination for descriptors or performing a similar base
602602
// address skip that we've done elsewhere in the omptarget runtime.
603-
bool isUSMMode = PM->getRequirements() & OMP_REQ_UNIFIED_SHARED_MEMORY;
604-
if ((*ShadowPtr.HstPtrAddr == nullptr || isUSMMode) &&
603+
bool isZeroCopy = PM->getRequirements() & OMPX_REQ_AUTO_ZERO_COPY;
604+
if ((*ShadowPtr.HstPtrAddr == nullptr || isZeroCopy) &&
605605
ShadowPtr.IsDescriptorBaseAddr)
606606
return OFFLOAD_SUCCESS;
607607
*ShadowPtr.HstPtrAddr = ShadowPtr.HstPtrVal;
@@ -854,9 +854,9 @@ static int targetDataContiguous(ident_t *Loc, DeviceTy &Device, void *ArgsBase,
854854
// different mapping combination for descriptors or performing a
855855
// similar base address skip that we've done elsewhere in the
856856
// omptarget runtime.
857-
bool isUSMMode =
858-
PM->getRequirements() & OMP_REQ_UNIFIED_SHARED_MEMORY;
859-
if ((*ShadowPtr.HstPtrAddr == nullptr || isUSMMode) &&
857+
bool isZeroCopy =
858+
PM->getRequirements() & OMPX_REQ_AUTO_ZERO_COPY;
859+
if ((*ShadowPtr.HstPtrAddr == nullptr || isZeroCopy) &&
860860
ShadowPtr.IsDescriptorBaseAddr)
861861
return OFFLOAD_SUCCESS;
862862
*ShadowPtr.HstPtrAddr = ShadowPtr.HstPtrVal;

0 commit comments

Comments
 (0)