Skip to content

Commit b1d39dd

Browse files
Merge pull request #106 from SciML/gpu
Test GPU
2 parents fb7e767 + 621c54a commit b1d39dd

File tree

5 files changed

+54
-5
lines changed

5 files changed

+54
-5
lines changed

.buildkite/pipeline.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
steps:
2+
- label: "Julia 1"
3+
plugins:
4+
- JuliaCI/julia#v1:
5+
version: "1"
6+
- JuliaCI/julia-test#v1:
7+
coverage: false # 1000x slowdown
8+
agents:
9+
queue: "juliagpu"
10+
cuda: "*"
11+
timeout_in_minutes: 30
12+
# Don't run Buildkite if the commit message includes the text [skip tests]
13+
if: build.message !~ /\[skip tests\]/
14+
15+
env:
16+
GROUP: GPU
17+
JULIA_PKG_SERVER: "" # it often struggles with our large artifacts
18+
# SECRET_CODECOV_TOKEN: "..."

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
[![codecov](https://codecov.io/gh/SciML/NonlinearSolve.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SciML/NonlinearSolve.jl)
77
[![Build Status](https://github.com/SciML/NonlinearSolve.jl/workflows/CI/badge.svg)](https://github.com/SciML/NonlinearSolve.jl/actions?query=workflow%3ACI)
8+
[![Build status](https://badge.buildkite.com/413dc8df7d555cc14c262aba066503a9e7a42023f9cfb75a55.svg)](https://buildkite.com/julialang/nonlinearsolve-dot-jl)
89

910
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
1011
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)
@@ -45,7 +46,7 @@ you can now use SimpleNonlinearSolve.jl. `Falsi`, `Bisection`, and `NewtonRahpso
4546
implementations designed for scalar and static vector inputs have all moved to the
4647
lower dependency version. NonlinearSolve.jl is thus designed for the larger scale
4748
more complex implementations, with `NewtonRahpson` now sporting support for
48-
LinearSolve.jl and soon SparseDiffTools.jl to allow for preconditioned Newton-Krylov and
49+
LinearSolve.jl and soon SparseDiffTools.jl to allow for preconditioned Newton-Krylov and
4950
exploitation of sparsity. The two pieces will continue to grow in this direction,
5051
with NonlinearSolve.jl gaining more and more wrapped solver libraries and support
5152
for more complex methods, while SimpleNonlinearSolve.jl will keep a lower dependency

test/GPU/Project.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[deps]
2+
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
3+
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
4+
5+
[compat]
6+
CUDA = "3.12"
7+
NonlinearSolve = "1"

test/gpu.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using CUDA, NonlinearSolve
2+
3+
A = cu(rand(4, 4))
4+
u0 = cu(rand(4))
5+
b = cu(rand(4))
6+
7+
function f(du, u, p)
8+
du .= A * u .+ b
9+
end
10+
11+
prob = NonlinearProblem(f, u0)
12+
sol = solve(prob, NewtonRaphson())

test/runtests.jl

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,20 @@ const LONGER_TESTS = false
55
const GROUP = get(ENV, "GROUP", "All")
66
const is_APPVEYOR = Sys.iswindows() && haskey(ENV, "APPVEYOR")
77

8+
function activate_downstream_env()
9+
Pkg.activate("GPU")
10+
Pkg.develop(PackageSpec(path = dirname(@__DIR__)))
11+
Pkg.instantiate()
12+
end
13+
814
@time begin
15+
if GROUP == "All" || GROUP == "Core"
16+
@time @safetestset "Basic Tests + Some AD" begin include("basictests.jl") end
17+
@time @safetestset "Sparsity Tests" begin include("sparse.jl") end
18+
end
919

10-
if GROUP == "All" || GROUP == "Core"
11-
@time @safetestset "Basic Tests + Some AD" begin include("basictests.jl") end
12-
@time @safetestset "Sparsity Tests" begin include("sparse.jl") end
13-
end end
20+
if GROUP == "GPU"
21+
activate_downstream_env()
22+
@time @safetestset "GPU Tests" begin include("gpu.jl") end
23+
end
24+
end

0 commit comments

Comments
 (0)