Skip to content

Commit 171c54a

Browse files
committed
Skeleton for GPU tests in test/runtests
1 parent a147db1 commit 171c54a

File tree

1 file changed

+38
-20
lines changed

1 file changed

+38
-20
lines changed

test/runtests.jl

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const TK = TensorKit
1515

1616
Random.seed!(1234)
1717

18+
# don't run all tests on GPU, only the GPU
19+
# specific ones
20+
is_buildkite = get(ENV, "BUILDKITE", "false") == "true"
21+
1822
smallset(::Type{I}) where {I<:Sector} = take(values(I), 5)
1923
function smallset(::Type{ProductSector{Tuple{I1,I2}}}) where {I1,I2}
2024
iter = product(smallset(I1), smallset(I2))
@@ -112,24 +116,38 @@ VSU₂U₁ = (Vect[SU2Irrep ⊠ U1Irrep]((0, 0) => 1, (1 // 2, -1) => 1),
112116
# ℂ[SU3Irrep]((1, 0, 0) => 1, (2, 0, 0) => 1),
113117
# ℂ[SU3Irrep]((0, 0, 0) => 1, (1, 0, 0) => 1, (1, 1, 0) => 1)')
114118

115-
Ti = time()
116-
include("fusiontrees.jl")
117-
include("spaces.jl")
118-
include("tensors.jl")
119-
include("diagonal.jl")
120-
include("planar.jl")
121-
# TODO: remove once we know AD is slow on macOS CI
122-
if !(Sys.isapple() && get(ENV, "CI", "false") == "true") && isempty(VERSION.prerelease)
123-
include("ad.jl")
124-
end
125-
include("bugfixes.jl")
126-
Tf = time()
127-
printstyled("Finished all tests in ",
128-
string(round((Tf - Ti) / 60; sigdigits=3)),
129-
" minutes."; bold=true, color=Base.info_color())
130-
println()
131-
132-
@testset "Aqua" verbose = true begin
133-
using Aqua
134-
Aqua.test_all(TensorKit)
119+
if !is_buildkite
120+
Ti = time()
121+
include("fusiontrees.jl")
122+
include("spaces.jl")
123+
include("tensors.jl")
124+
include("diagonal.jl")
125+
include("planar.jl")
126+
# TODO: remove once we know AD is slow on macOS CI
127+
if !(Sys.isapple() && get(ENV, "CI", "false") == "true") && isempty(VERSION.prerelease)
128+
include("ad.jl")
129+
end
130+
include("bugfixes.jl")
131+
Tf = time()
132+
printstyled("Finished all tests in ",
133+
string(round((Tf - Ti) / 60; sigdigits=3)),
134+
" minutes."; bold=true, color=Base.info_color())
135+
println()
136+
@testset "Aqua" verbose = true begin
137+
using Aqua
138+
Aqua.test_all(TensorKit)
139+
end
140+
else
141+
Ti = time()
142+
#=using CUDA
143+
if CUDA.functional()
144+
end
145+
using AMDGPU
146+
if AMDGPU.functional()
147+
end=#
148+
Tf = time()
149+
printstyled("Finished all GPU tests in ",
150+
string(round((Tf - Ti) / 60; sigdigits=3)),
151+
" minutes."; bold=true, color=Base.info_color())
152+
println()
135153
end

0 commit comments

Comments
 (0)