From 9124b2e758a4972ba7306815a8d2ed7b68135022 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Mon, 20 Jan 2025 14:51:03 +0100 Subject: [PATCH] Don't prefetch on multi-device systems --- src/compiler/execution.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/execution.jl b/src/compiler/execution.jl index 82a940db60..ca690d31cc 100644 --- a/src/compiler/execution.jl +++ b/src/compiler/execution.jl @@ -151,6 +151,8 @@ function Adapt.adapt_storage(::KernelAdaptor, xs::DenseCuArray{T,N}) where {T,N} can_prefetch &= !__pinned(convert(Ptr{T}, mem), mem.ctx) ## pageable memory needs to be accessible concurrently can_prefetch &= attribute(device(), DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS) == 1 + ## don't prefetch on multi device systems. + can_prefetch &= ndevices() == 1 if can_prefetch # TODO: `view` on buffers?