[llvm] [OpenMP][Offload] Update the Logic for Configuring Auto Zero-Copy (PR #143638)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 11 12:11:51 PDT 2025
================
@@ -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();
----------------
Kewen12 wrote:
>we do not have a case where one of the devices is an APU and the others could be something else. You could build it yourself perhaps, but it doesn't exist today as a product. If time comes when there will be such a case, we can revisit this.
We could have a system with mix of GPUs in theory, but we didn't see that in product in real life. Perhaps we will see a produce of that design in the future :) We could make update accordingly when it happens. Thanks for the comments!
https://github.com/llvm/llvm-project/pull/143638
More information about the llvm-commits
mailing list