Index: libomptarget/include/omptarget.h =================================================================== --- libomptarget/include/omptarget.h +++ libomptarget/include/omptarget.h @@ -52,6 +52,8 @@ }; enum OpenMPOffloadingDeclareTargetFlags { + /// Mark the entry as having a 'to' attribute. + OMP_DECLARE_TARGET_TO = 0x00, /// Mark the entry as having a 'link' attribute. OMP_DECLARE_TARGET_LINK = 0x01, /// Mark the entry as being a global constructor. Index: libomptarget/plugins/cuda/src/rtl.cpp =================================================================== --- libomptarget/plugins/cuda/src/rtl.cpp +++ libomptarget/plugins/cuda/src/rtl.cpp @@ -449,7 +449,8 @@ entry.addr = (void *)cuptr; if (DeviceInfo.RequiresFlags & OMP_REQ_UNIFIED_SHARED_MEMORY && - e->flags & OMP_DECLARE_TARGET_LINK) { + (e->flags & OMP_DECLARE_TARGET_LINK || + e->flags == OMP_DECLARE_TARGET_TO)) { // If unified memory is present any target link variables // can access host addresses directly. There is no longer a // need for device copies.