Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try VectorizedRNG.jl #304

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
VectorizedRNG = "33b4df10-0173-11e9-2a0c-851a7edac40e"

[compat]
ArrayInterface = "2.4"
Expand Down
2 changes: 2 additions & 0 deletions src/StochasticDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ module StochasticDiffEq

import RecursiveArrayTools: chain

import VectorizedRNG

using Logging, SparseArrays

using LinearAlgebra, Random, FillArrays
Expand Down
18 changes: 7 additions & 11 deletions src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,13 @@ function DiffEqBase.__init(
if typeof(prob) <: DiffEqBase.AbstractRODEProblem && prob.noise === nothing
rswm = isadaptive(alg) ? RSWM(adaptivealg=:RSwM3) : RSWM(adaptivealg=:RSwM1)
if isinplace(prob)
#if isadaptive(alg) || callback !== nothing
if alg_needs_extra_process(alg)
W = WienerProcess!(t,rand_prototype,rand_prototype,
save_everystep=save_noise,
rng = Xorshifts.Xoroshiro128Plus(_seed))
else
W = WienerProcess!(t,rand_prototype,
save_everystep=save_noise,
rng = Xorshifts.Xoroshiro128Plus(_seed))
end
#=
_rng = typeof(prob.u0) <: Array{Float64} && seed !== nothing ?
VectorizedRNG.local_rng() :
Xorshifts.Xoroshiro128Plus(_seed)
if alg_needs_extra_process(alg)
W = constructor(t,rand_prototype,rand_prototype,
save_everystep=save_noise,
rng = _rng)
else
if alg_needs_extra_process(alg)
W = SimpleWienerProcess!(t,rand_prototype,rand_prototype,
Expand Down