Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions offload/libomptarget/omptarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ using llvm::SmallVector;
#ifdef OMPT_SUPPORT
using namespace llvm::omp::target::ompt;
#endif
static inline bool isImplicitPointerHop(int64_t MapType, int64_t Size) {
//Pointer hop entries flagged as PTR and MEMBER_OF
const bool IsPointer = (MapType & OMP_TGT_MAPTYPE_PTR) != 0;
const bool IsMemberOf = (MapType & OMP_TGT_MAPTYPE_MEMBER_OF) != 0;
const bool HasExplicit =
(MapType & (OMP_TGT_MAPTYPE_TO | OMP_TGT_MAPTYPE_FROM |
OMP_TGT_MAPTYPE_ALWAYS | OMP_TGT_MAPTYPE_DELETE)) != 0;
return IsPointer && IsMemberOf && !HasExplicit && Size == 0;
}

int AsyncInfoTy::synchronize() {
int Result = OFFLOAD_SUCCESS;
Expand Down Expand Up @@ -598,6 +607,9 @@ int targetDataBegin(ident_t *Loc, DeviceTy &Device, int32_t ArgNum,
// may be considered a hack, we could revise the scheme in the future.
bool UpdateRef =
!(ArgTypes[I] & OMP_TGT_MAPTYPE_MEMBER_OF) && !(FromMapper && I == 0);
if (IsImplicit && isImplicitPointerHop(ArgTypes[I], ArgSizes[I])) {
UpdateRef = false;
}

MappingInfoTy::HDTTMapAccessorTy HDTTMap =
Device.getMappingInfo().HostDataToTargetMap.getExclusiveAccessor();
Expand Down