-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #292 from JuliaDiffEq/gpu
add downstream GPU testing
- Loading branch information
Showing
3 changed files
with
107 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
image: "julia:1" | ||
|
||
variables: | ||
JULIA_DEPOT_PATH: "$CI_PROJECT_DIR/.julia/" | ||
JULIA_NUM_THREADS: '8' | ||
|
||
cache: | ||
paths: | ||
- .julia/ | ||
|
||
build: | ||
stage: build | ||
tags: | ||
- 'p6000' | ||
script: | ||
- curl https://julialang-s3.julialang.org/bin/linux/x64/1.1/julia-1.1.1-linux-x86_64.tar.gz -o julia.tar.gz | ||
- unp julia.tar.gz | ||
- export PATH="$(pwd)/julia-1.1.1/bin:$PATH" | ||
- julia -e "using InteractiveUtils; | ||
versioninfo()" | ||
- julia --project -e "using Pkg; | ||
Pkg.update(); | ||
Pkg.instantiate(); | ||
Pkg.add(\"OrdinaryDiffEq\"); | ||
pkg\"precompile\"; | ||
using OrdinaryDiffEq;" | ||
only: | ||
- master | ||
- tags | ||
- external | ||
- pushes | ||
artifacts: | ||
untracked: true | ||
paths: | ||
- .julia/**/* | ||
- julia-1.1.1/**/* | ||
|
||
test-GPU: | ||
stage: test | ||
tags: | ||
- 'p6000' | ||
dependencies: | ||
- build | ||
variables: | ||
GROUP: "GPU" | ||
script: | ||
- export PATH="$(pwd)/julia-1.1.1/bin:$PATH" | ||
- julia -e "using InteractiveUtils; | ||
versioninfo()" | ||
- julia --project -e "using Pkg; Pkg.add(\"CuArrays\"); | ||
Pkg.add(\"OrdinaryDiffEq\"); | ||
Pkg.test(\"DiffEqBase\"; coverage=true);" | ||
only: | ||
- master | ||
- tags | ||
- external | ||
- pushes | ||
artifacts: | ||
untracked: true | ||
paths: | ||
- .julia/**/* | ||
- julia-1.1.1/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using OrdinaryDiffEq, CuArrays, LinearAlgebra, Test | ||
function f(du,u,p,t) | ||
mul!(du,A,u) | ||
end | ||
function jac(J,u,p,t) | ||
J .= A | ||
end | ||
ff = ODEFunction(f,jac=jac) | ||
A = cu(-rand(3,3)) | ||
u0 = cu([1.0;0.0;0.0]) | ||
tspan = (0.0,100.0) | ||
prob = ODEProblem(ff,u0,tspan) | ||
|
||
CuArrays.allowscalar(false) | ||
sol = solve(prob,Tsit5()) | ||
@test_broken solve(prob,Rosenbrock23()).retcode == :Success | ||
solve(prob,Rosenbrock23(autodiff=false)) | ||
|
||
prob_nojac = ODEProblem(f,u0,tspan) | ||
@test_broken solve(prob_nojac,Rosenbrock23()).retcode == :Success | ||
@test_broken solve(prob_nojac,Rosenbrock23(autodiff=false)).retcode == :Success | ||
|
||
# Test auto-offload | ||
_A = -rand(3,3) | ||
function f2(du,u,p,t) | ||
mul!(du,_A,u) | ||
end | ||
function jac2(J,u,p,t) | ||
J .= _A | ||
end | ||
ff2 = ODEFunction(f2,jac=jac2) | ||
u0 = [1.0;0.0;0.0] | ||
tspan = (0.0,100.0) | ||
prob_num = ODEProblem(ff2,u0,tspan) | ||
sol = solve(prob_num,Rosenbrock23(linsolve=LinSolveGPUFactorize())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters