Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion CUDACore/lib/cudadrv/state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,12 @@ function Base.get!(constructor::F, x::PerDevice{T}, dev::CuDevice) where {F <: B
if y[id] === nothing || (y[id]::Tuple)[1] !== ctx
Base.@lock x.lock begin
if y[id] === nothing || (y[id]::Tuple)[1] !== ctx
y[id] = (context(), constructor())
# store the device's own context (it may be created during `constructor()`),
# so subsequent lookups — which compare against `device_context(id)`, not
# the currently-active context — hit the cache regardless of which context
# was active when the value was constructed.
value = constructor()
y[id] = (context(dev), value)
end
end
end
Expand Down
9 changes: 5 additions & 4 deletions CUDACore/src/memory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -604,10 +604,11 @@ function Base.convert(::Type{CuPtr{T}}, managed::Managed{M}) where {T,M}
end

# set pool visibility
if stream_ordered(source_device)
pool = pool_create(source_device)
access!(pool, state.device, ACCESS_FLAGS_PROT_READWRITE)
end
# XXX: disabled because of NVIDIA bug #6098762
#if stream_ordered(source_device)
# pool = pool_create(source_device)
# access!(pool, state.device, ACCESS_FLAGS_PROT_READWRITE)
#end
end

# accessing memory on another stream: ensure the data is ready and take ownership
Expand Down