Skip to content

Commit 57b1c92

Browse files
committed
Use Project.toml for test
1 parent e8f7c72 commit 57b1c92

File tree

4 files changed

+33
-34
lines changed

4 files changed

+33
-34
lines changed

.buildkite/pipeline.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,6 @@ steps:
6969
queue: "juliagpu"
7070
rocm: "*"
7171
rocmgpu: "*"
72-
command:
73-
- julia -e """
74-
using TOML;
75-
conf = TOML.parse(read(\"Project.toml\", String));
76-
push!(conf[\"targets\"][\"test\"], \"AMDGPU\");
77-
open(io -> TOML.print(io, conf), \"Project.toml\", \"w\");
78-
"""
79-
- julia --project=. -e """
80-
using Pkg;
81-
Pkg.develop(\"AMDGPU\");
82-
Pkg.activate(joinpath(Pkg.devdir(), \"AMDGPU\"));
83-
Pkg.add(\"MIOpen_jll\");
84-
"""
8572
timeout_in_minutes: 30
8673
env:
8774
JULIA_AMDGPU_CORE_MUST_LOAD: "1"

Project.toml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,3 @@ julia = "1.6"
2626

2727
[extras]
2828
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
29-
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
30-
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
31-
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
32-
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
33-
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
34-
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
35-
NNlibCUDA = "a00861dc-f156-4864-bf3c-e6376f28a68d"
36-
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
37-
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
38-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
39-
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
40-
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
41-
42-
[targets]
43-
test = ["ChainRulesTestUtils", "CUDA", "Documenter", "FiniteDifferences", "ForwardDiff", "Logging", "NNlibCUDA", "Random", "StableRNGs", "Test", "UnicodePlots", "Zygote"]

test/Project.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[deps]
2+
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
3+
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
4+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
5+
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
6+
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
7+
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
8+
NNlibCUDA = "a00861dc-f156-4864-bf3c-e6376f28a68d"
9+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
10+
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
11+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
12+
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
13+
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
14+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
15+
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
16+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
17+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

test/runtests.jl

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,42 @@ import ForwardDiff
66
import Zygote
77
using Zygote: gradient
88
using StableRNGs
9-
using CUDA
109
using Documenter
1110
DocMeta.setdocmeta!(NNlib, :DocTestSetup, :(using NNlib, UnicodePlots); recursive=true)
1211

1312
const rng = StableRNG(123)
1413
include("test_utils.jl")
1514

1615
@testset verbose=true "NNlib.jl" begin
17-
if CUDA.functional()
18-
if get(ENV, "NNLIB_TEST_CUDA", "false") == "true"
16+
if get(ENV, "NNLIB_TEST_CUDA", "false") == "true"
17+
using CUDA
18+
if CUDA.functional()
1919
import Pkg
2020
using NNlibCUDA
2121
@testset "CUDA" begin
2222
Pkg.test("NNlibCUDA")
2323
end
2424
else
25-
@info "Skipping CUDA tests, set NNLIB_TEST_CUDA=true to run them"
25+
@info "Insufficient version or CUDA not found; Skipping CUDA tests"
2626
end
2727
else
28-
@info "Insufficient version or CUDA not found; Skipping CUDA tests"
28+
@info "Skipping CUDA tests, set NNLIB_TEST_CUDA=true to run them"
2929
end
3030

3131
if get(ENV, "NNLIB_TEST_AMDGPU", "false") == "true"
32+
# Hack to add MIOpen_jll to AMDGPU.
33+
import Pkg
34+
test_info = Pkg.project()
35+
Pkg.develop("AMDGPU")
36+
Pkg.activate(joinpath(Pkg.devdir(), "AMDGPU"))
37+
Pkg.add("MIOpen_jll")
38+
Pkg.update()
39+
Pkg.activate(test_info.path)
40+
Pkg.update()
41+
3242
using AMDGPU
43+
AMDGPU.versioninfo()
3344
if AMDGPU.functional() && AMDGPU.functional(:MIOpen)
34-
AMDGPU.versioninfo()
3545
@show AMDGPU.MIOpen.version()
3646
@testset "AMDGPU" begin
3747
include("ext_amdgpu/runtests.jl")

0 commit comments

Comments
 (0)