diff --git a/offload/libomptarget/PluginManager.cpp b/offload/libomptarget/PluginManager.cpp index 93589960a426d..c4d99dfa9f10c 100644 --- a/offload/libomptarget/PluginManager.cpp +++ b/offload/libomptarget/PluginManager.cpp @@ -286,16 +286,16 @@ void PluginManager::registerLib(__tgt_bin_desc *Desc) { } PM->RTLsMtx.unlock(); - bool UseAutoZeroCopy = Plugins.size() > 0; + bool UseAutoZeroCopy = false; auto ExclusiveDevicesAccessor = getExclusiveDevicesAccessor(); - for (const auto &Device : *ExclusiveDevicesAccessor) - UseAutoZeroCopy &= Device->useAutoZeroCopy(); + // APUs are homogeneous set of GPUs. Check the first device for + // configuring Auto Zero-Copy. + if (ExclusiveDevicesAccessor->size() > 0) { + auto &Device = *(*ExclusiveDevicesAccessor)[0]; + UseAutoZeroCopy = Device.useAutoZeroCopy(); + } - // Auto Zero-Copy can only be currently triggered when the system is an - // homogeneous APU architecture without attached discrete GPUs. - // If all devices suggest to use it, change requirement flags to trigger - // zero-copy behavior when mapping memory. if (UseAutoZeroCopy) addRequirements(OMPX_REQ_AUTO_ZERO_COPY);