Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "GPUArrays"
uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
version = "11.4.1"
version = "11.5.0"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
12 changes: 0 additions & 12 deletions lib/JLArrays/src/JLArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -539,18 +539,6 @@ end

using Random

const GLOBAL_RNG = Ref{Union{Nothing,GPUArrays.RNG}}(nothing)
function GPUArrays.default_rng(::Type{<:JLArray})
if GLOBAL_RNG[] === nothing
N = MAXTHREADS
state = JLArray{NTuple{4, UInt32}}(undef, N)
rng = GPUArrays.RNG(state)
Random.seed!(rng)
GLOBAL_RNG[] = rng
end
GLOBAL_RNG[]
end


## GPUArrays interfaces

Expand Down
1 change: 1 addition & 0 deletions src/GPUArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ include("host/statistics.jl")
include("host/sparse.jl")
include("host/alloc_cache.jl")

include("deprecated.jl")

end # module
18 changes: 18 additions & 0 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# RNG: the old RNG took a GPU state array and Vector{UInt32} seeds.
# The new stateless Philox4x32 RNG doesn't need either.

function RNG(state::AbstractGPUArray)
AT = Base.typename(typeof(state)).wrapper
Base.depwarn("RNG(state::AbstractGPUArray) is deprecated, use RNG{$AT}() instead", :RNG)
RNG{AT}()
end

function Random.seed!(rng::RNG, seed::Vector{UInt32})
Base.depwarn("seed!(rng::RNG, seed::Vector{UInt32}) is deprecated, use seed!(rng, seed::Integer) instead", :seed!)
Random.seed!(rng, isempty(seed) ? rand(Random.RandomDevice(), UInt64) : first(seed))
end

# Stub kept so downstream packages that still extend `GPUArrays.default_rng`
# (Metal.jl, etc.) continue to load. The interface itself is gone — `RNG{AT}()`
# is now constructed directly — so any extension of this is dead code.
function default_rng end
Loading
Loading