Skip to content

Commit

Permalink
update to CUDA.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jul 7, 2020
1 parent ff0c555 commit 9787de4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 21 deletions.
8 changes: 2 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ authors = ["Chris Rackauckas", "JuliaDiffEq"]
version = "1.3.0"

[deps]
CUDAdrv = "c5f51814-7f29-56b8-a69c-e4d8f6be1fde"
CUDAnative = "be33ccc6-a3ff-5ff2-a52e-74243cff1e17"
CuArrays = "3a865a2d-5b23-5a0f-bc46-62713ec82fae"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[compat]
CUDAdrv = "4.0, 5.0, 6.0"
CUDAnative = "2.5, 3.0"
CuArrays = "1.4, 2.0"
CUDA = "1"
DiffEqBase = "6.5"
KernelAbstractions = "0.2, 0.3"
julia = "1"
Expand Down
6 changes: 3 additions & 3 deletions src/DiffEqGPU.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module DiffEqGPU

using KernelAbstractions, CuArrays, CUDAnative, DiffEqBase, LinearAlgebra, Distributed
using CUDAdrv: CuPtr, CU_NULL, Mem, CuDefaultStream
using CuArrays: CUBLAS
using KernelAbstractions, CUDA, DiffEqBase, LinearAlgebra, Distributed
using CUDA: CuPtr, CU_NULL, Mem, CuDefaultStream
using CUDA: CUBLAS

@kernel function gpu_kernel(f,du,u,p,t)
i = @index(Global, Linear)
Expand Down
4 changes: 2 additions & 2 deletions test/distributed_multi_gpu.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Distributed
addprocs(2)
@everywhere using DiffEqGPU, CuArrays, OrdinaryDiffEq, Test, Random
@everywhere using DiffEqGPU, CUDA, OrdinaryDiffEq, Test, Random

@everywhere begin
function lorenz_distributed(du,u,p,t)
Expand All @@ -11,7 +11,7 @@ addprocs(2)
end
nothing
end
CuArrays.allowscalar(false)
CUDA.allowscalar(false)
u0 = Float32[1.0;0.0;0.0]
tspan = (0.0f0,100.0f0)
p = (10.0f0,28.0f0,8/3f0)
Expand Down
4 changes: 2 additions & 2 deletions test/ensemblegpuarray.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DiffEqGPU, CuArrays, OrdinaryDiffEq, Test
using DiffEqGPU, CUDA, OrdinaryDiffEq, Test

function lorenz(du,u,p,t)
@inbounds begin
Expand All @@ -9,7 +9,7 @@ function lorenz(du,u,p,t)
nothing
end

CuArrays.allowscalar(false)
CUDA.allowscalar(false)
u0 = Float32[1.0;0.0;0.0]
tspan = (0.0f0,100.0f0)
p = (10.0f0,28.0f0,8/3f0)
Expand Down
4 changes: 2 additions & 2 deletions test/ensemblegpuarray_sde.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DiffEqGPU, CuArrays, StochasticDiffEq, Test
using DiffEqGPU, CUDA, StochasticDiffEq, Test

function lorenz(du,u,p,t)
@inbounds begin
Expand All @@ -18,7 +18,7 @@ function multiplicative_noise(du,u,p,t)
nothing
end

CuArrays.allowscalar(false)
CUDA.allowscalar(false)
u0 = Float32[1.0;0.0;0.0]
tspan = (0.0f0,10.0f0)
p = (10.0f0,28.0f0,8/3f0)
Expand Down
12 changes: 6 additions & 6 deletions test/gpu_ode.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GPUifyLoops, CuArrays, SimpleDiffEq
using GPUifyLoops, CUDA, SimpleDiffEq
using StaticArrays

function loop(u, p, t)
Expand All @@ -20,7 +20,7 @@ const odeoop = ODEProblem{false}(loop, SVector{3}(u0), (0.0f0, 10.0f0), Float32
sol2 = solve(odeoop,GPUSimpleTsit5(),dt=dt)
cps = Array([@SVector [10f0,28f0,8/3f0] for i in 1:32])
ps = CuArray([@SVector [10f0,28f0,8/3f0] for i in 1:32])
CuArrays.allowscalar(false)
CUDA.allowscalar(false)

function f(p)
solve(odeoop,GPUSimpleTsit5(),dt=dt)
Expand All @@ -42,7 +42,7 @@ map(_f2,ps)


using GPUifyLoops, SimpleDiffEq, StaticArrays
using CuArrays, Cthulhu
using CUDA, Cthulhu

function loop(u, p, t)
@inbounds begin
Expand All @@ -61,7 +61,7 @@ dt = 1f-1
odeoop = ODEProblem{false}(loop, SVector{3}(u0), (0.0f0, 10.0f0), Float32[10, 28, 8/3])
sol2 = solve(odeoop,GPUSimpleATsit5(),save_everystep=false).u[end]
ps = CuArray([@SVector [10f0,28f0,8/3f0] for i in 1:10])
CuArrays.allowscalar(false)
CUDA.allowscalar(false)

function f(p)
prob = ODEProblem{false}(loop, su0, (0.0f0, 10.0f0), p)
Expand All @@ -87,7 +87,7 @@ end
_f2 = GPUifyLoops.contextualize(f2)
map(_f2,ps)

using GPUifyLoops, CuArrays, SimpleDiffEq
using GPUifyLoops, CUDA, SimpleDiffEq
using StaticArrays, Cthulhu

function loop(u, p, t)
Expand Down Expand Up @@ -115,7 +115,7 @@ odeoop = ODEProblem{false}(loop, SVector{3}(u0), (0.0f0, 10.0f0), Float32[10, 2
sol2 = solve(odeoop,GPUSimpleTsit5(),dt=dt)
ps = CuArray([@SVector [10f0,28f0,8/3f0] for i in 1:600])
_ps = [@SVector [10f0,28f0,8/3f0] for i in 1:600]
CuArrays.allowscalar(false)
CUDA.allowscalar(false)

function f(p)
prob = ODEProblem{false}(loop, su0, (0.0f0, 10.0f0), p)
Expand Down

0 comments on commit 9787de4

Please sign in to comment.