Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ steps:
- JuliaCI/julia#v1:
version: "1.12"
- JuliaCI/julia-test#v1:
test_args: "--gpu=0,1 --quickfail core libraries/cublas/xt"
test_args: "--quickfail core libraries/cublas/xt"
- JuliaCI/julia-coverage#v1:
dirs:
- src
Expand Down
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/peakflops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function kernel_100fma(a, b, c, out)
return
end

function peakflops(n::Integer=5000, dev::CuDevice=CuDevice(0))
function peakflops(n::Integer=1024, dev::CuDevice=CuDevice(0))
device!(dev) do
dims = (n, n)
a = round.(rand(Float32, dims) * 100)
Expand Down
4 changes: 4 additions & 0 deletions lib/cublas/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
BFloat16s = "ab4f0b2a-ad5b-11e8-123f-65d77653426b"
CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
cuBLAS = "182d3088-87b7-4494-8cad-fc6afaa545bc"

[compat]
ParallelTestRunner = "2"
18 changes: 9 additions & 9 deletions lib/cublas/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include("setup.jl")
using cuBLAS
using ParallelTestRunner

@testset verbose=true "cuBLAS" begin
for (root, _, files) in walkdir(@__DIR__)
for file in sort(files)
endswith(file, ".jl") || continue
file in ("setup.jl", "runtests.jl") && continue
include(joinpath(root, file))
end
end
const init_code = quote
include(joinpath(@__DIR__, "setup.jl"))
end

testsuite = find_tests(@__DIR__)
delete!(testsuite, "setup")

runtests(cuBLAS, ARGS; init_code, testsuite)
4 changes: 4 additions & 0 deletions lib/cudnn/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
CUDA_Runtime_jll = "76a88914-d11a-5bdc-97e0-2f5a05c973a2"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"

[compat]
ParallelTestRunner = "2"
25 changes: 8 additions & 17 deletions lib/cudnn/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
include("setup.jl")
@test cuDNN.functional()
using cuDNN
using ParallelTestRunner

@testset verbose=true "cuDNN" begin

# include all tests
for entry in readdir(@__DIR__)
endswith(entry, ".jl") || continue
entry in ["runtests.jl", "setup.jl"] && continue

# generate a testset
name = splitext(entry)[1]
@eval begin
@testset $name begin
include($entry)
end
end
const init_code = quote
include(joinpath(@__DIR__, "setup.jl"))
end

end
testsuite = find_tests(@__DIR__)
delete!(testsuite, "setup")

runtests(cuDNN, ARGS; init_code, testsuite)
4 changes: 4 additions & 0 deletions lib/cufft/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
cuFFT = "533571aa-0936-420e-b4be-9c66f5f626ca"

[compat]
ParallelTestRunner = "2"
10 changes: 10 additions & 0 deletions lib/cufft/test/ensure_increasing.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using cuFFT

@testset "ensure_increasing" begin
@test (1,2,3) == cuFFT.ensure_increasing((1,2,3))
@test (1,2,3) == cuFFT.ensure_increasing((2,1,3))
@test (1,2,3) == cuFFT.ensure_increasing((1,3,2))
@test (1,2,3) == cuFFT.ensure_increasing((3,1,2))
@test (1,2,3) == cuFFT.ensure_increasing((2,3,1))
@test (10,20,30) == cuFFT.ensure_increasing((30,20,10))
end
21 changes: 8 additions & 13 deletions lib/cufft/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
include("setup.jl")
@test cuFFT.version() isa VersionNumber
using cuFFT
using ParallelTestRunner

@testset "ensure_increasing" begin
@test (1,2,3) == cuFFT.ensure_increasing((1,2,3))
@test (1,2,3) == cuFFT.ensure_increasing((2,1,3))
@test (1,2,3) == cuFFT.ensure_increasing((1,3,2))
@test (1,2,3) == cuFFT.ensure_increasing((3,1,2))
@test (1,2,3) == cuFFT.ensure_increasing((2,3,1))
@test (10,20,30) == cuFFT.ensure_increasing((30,20,10))
const init_code = quote
include(joinpath(@__DIR__, "setup.jl"))
end

include("complex.jl")
include("real.jl")
include("integer.jl")
include("issues.jl")
testsuite = find_tests(@__DIR__)
delete!(testsuite, "setup")

runtests(cuFFT, ARGS; init_code, testsuite)
4 changes: 4 additions & 0 deletions lib/curand/test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[deps]
CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
cuRAND = "20fd9a0b-12d5-4c2f-a8af-7c34e9e60431"

[compat]
ParallelTestRunner = "2"
14 changes: 10 additions & 4 deletions lib/curand/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
include("setup.jl")
@test cuRAND.version() isa VersionNumber
using cuRAND
using ParallelTestRunner

include("high_level.jl")
include("native.jl")
const init_code = quote
include(joinpath(@__DIR__, "setup.jl"))
end

testsuite = find_tests(@__DIR__)
delete!(testsuite, "setup")

runtests(cuRAND, ARGS; init_code, testsuite)
4 changes: 4 additions & 0 deletions lib/cusolver/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
cuBLAS = "182d3088-87b7-4494-8cad-fc6afaa545bc"
cuSOLVER = "887afef0-6a32-4de5-add4-7827692ba8fc"
cuSPARSE = "b26da814-b3bc-49ef-b0ee-c816305aa060"

[compat]
ParallelTestRunner = "2"
18 changes: 9 additions & 9 deletions lib/cusolver/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include("setup.jl")
using cuSOLVER
using ParallelTestRunner

@testset verbose=true "cuSOLVER" begin
for (root, _, files) in walkdir(@__DIR__)
for file in sort(files)
endswith(file, ".jl") || continue
file in ("setup.jl", "runtests.jl") && continue
include(joinpath(root, file))
end
end
const init_code = quote
include(joinpath(@__DIR__, "setup.jl"))
end

testsuite = find_tests(@__DIR__)
delete!(testsuite, "setup")

runtests(cuSOLVER, ARGS; init_code, testsuite)
4 changes: 4 additions & 0 deletions lib/cusparse/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseMatricesCSR = "a0a7dd2c-ebf4-11e9-1f05-cf50bc540ca1"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
cuSPARSE = "b26da814-b3bc-49ef-b0ee-c816305aa060"

[compat]
ParallelTestRunner = "2"
11 changes: 6 additions & 5 deletions lib/cusparse/test/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
@test ndims(d_x) == 1
dense_d_x = CuVector(x)
dense_d_x2 = CuVector(d_x)
ctx = :module => @__MODULE__
CUDACore.@allowscalar begin
@test sprint(show, d_x) == replace(sprint(show, x), "SparseVector{Float64, Int64}"=>"cuSPARSE.CuSparseVector{Float64, Int32}", "sparsevec(["=>"sparsevec(Int32[")
@test sprint(show, MIME"text/plain"(), d_x) == replace(sprint(show, MIME"text/plain"(), x), "SparseVector{Float64, Int64}"=>"CuSparseVector{Float64, Int32}", "sparsevec(["=>"sparsevec(Int32[")
@test sprint(show, d_x; context=ctx) == replace(sprint(show, x; context=ctx), "SparseVector{Float64, Int64}"=>"cuSPARSE.CuSparseVector{Float64, Int32}", "sparsevec(["=>"sparsevec(Int32[")
@test sprint(show, MIME"text/plain"(), d_x; context=ctx) == replace(sprint(show, MIME"text/plain"(), x; context=ctx), "SparseVector{Float64, Int64}"=>"CuSparseVector{Float64, Int32}", "sparsevec(["=>"sparsevec(Int32[")
@test Array(d_x[:]) == x[:]
@test d_x[firstindex(d_x)] == x[firstindex(x)]
@test d_x[div(end, 2)] == x[div(end, 2)]
Expand Down Expand Up @@ -45,8 +46,8 @@
@test size(d_x,3) == 1
@test ndims(d_x) == 2
CUDACore.@allowscalar begin
@test sprint(show, d_x) == sprint(show, SparseMatrixCSC(d_x))
@test sprint(show, MIME"text/plain"(), d_x) == replace(sprint(show, MIME"text/plain"(), x), "SparseMatrixCSC{Float64, Int64}"=>"CuSparseMatrixCSC{Float64, Int32}")
@test sprint(show, d_x; context=ctx) == sprint(show, SparseMatrixCSC(d_x); context=ctx)
@test sprint(show, MIME"text/plain"(), d_x; context=ctx) == replace(sprint(show, MIME"text/plain"(), x; context=ctx), "SparseMatrixCSC{Float64, Int64}"=>"CuSparseMatrixCSC{Float64, Int32}")
@test Array(d_x[:]) == x[:]
@test d_x[:, :] == x[:, :]
@test d_tx[:, :] == transpose(x)[:, :]
Expand Down Expand Up @@ -247,7 +248,7 @@
# to hit the CuSparseArrayCSR path
CUDACore.unsafe_free!(repeat(d_x, 1, 1, 3))
CUDACore.@allowscalar begin
@test startswith(sprint(show, MIME"text/plain"(), repeat(d_x, 1, 1, 2)), "$m×$n×2 CuSparseArrayCSR{Float64, Int32, 3} with $(2*nnz(d_x)) stored entries:\n")
@test startswith(sprint(show, MIME"text/plain"(), repeat(d_x, 1, 1, 2); context=ctx), "$m×$n×2 CuSparseArrayCSR{Float64, Int32, 3} with $(2*nnz(d_x)) stored entries:\n")
end
@test length(d_x) == m*n
@test_throws ArgumentError copyto!(d_y,d_x)
Expand Down
19 changes: 9 additions & 10 deletions lib/cusparse/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
include("setup.jl")
@test cuSPARSE.version() isa VersionNumber
using cuSPARSE
using ParallelTestRunner

@testset verbose=true "cuSPARSE" begin
for (root, _, files) in walkdir(@__DIR__)
for file in sort(files)
endswith(file, ".jl") || continue
file in ("setup.jl", "runtests.jl") && continue
include(joinpath(root, file))
end
end
const init_code = quote
include(joinpath(@__DIR__, "setup.jl"))
end

testsuite = find_tests(@__DIR__)
delete!(testsuite, "setup")

runtests(cuSPARSE, ARGS; init_code, testsuite)
4 changes: 4 additions & 0 deletions lib/custatevec/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
CUDA_Runtime_jll = "76a88914-d11a-5bdc-97e0-2f5a05c973a2"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
cuStateVec = "92f7fd98-d22e-4c0d-85a8-6ade11b672fb"

[compat]
ParallelTestRunner = "2"
18 changes: 8 additions & 10 deletions lib/custatevec/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
include("setup.jl")
@test cuStateVec.functional()
using cuStateVec
using ParallelTestRunner

@testset verbose=true "cuStateVec" begin
include("errors.jl")
include("apply_matrix.jl")
include("apply_pauli.jl")
include("measure.jl")
include("collapse.jl")
include("utilities.jl")
const init_code = quote
include(joinpath(@__DIR__, "setup.jl"))
end

include("multigpu.jl")
testsuite = find_tests(@__DIR__)
delete!(testsuite, "setup")

runtests(cuStateVec, ARGS; init_code, testsuite)
4 changes: 4 additions & 0 deletions lib/cutensor/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
CUDA_Runtime_jll = "76a88914-d11a-5bdc-97e0-2f5a05c973a2"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
cuTENSOR = "011b41b2-24ef-40a8-b3eb-fa098493e9e1"

[compat]
ParallelTestRunner = "2"
14 changes: 14 additions & 0 deletions lib/cutensor/test/kernel_cache.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using cuTENSOR
using CUDACore

if CUDACore.runtime_version() >= v"11.8" && capability(device()) >= v"8.0"
@testset "kernel cache" begin
mktempdir() do dir
cd(dir) do
cuTENSOR.write_cache!("kernelCache.bin")
@test isfile("kernelCache.bin")
cuTENSOR.read_cache!("kernelCache.bin")
end
end
end
end
32 changes: 8 additions & 24 deletions lib/cutensor/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
include("setup.jl")
@test cuTENSOR.functional()
using cuTENSOR
using ParallelTestRunner

@testset verbose=true "cuTENSOR" begin

include("base.jl")

include("elementwise_binary.jl")
include("elementwise_trinary.jl")
include("permutations.jl")
include("contractions.jl")
include("reductions.jl")

# we should have some kernels in the cache after this
if CUDACore.runtime_version() >= v"11.8" && capability(device()) >= v"8.0"
@testset "kernel cache" begin
mktempdir() do dir
cd(dir) do
cuTENSOR.write_cache!("kernelCache.bin")
@test isfile("kernelCache.bin")
cuTENSOR.read_cache!("kernelCache.bin")
end
end
end
const init_code = quote
include(joinpath(@__DIR__, "setup.jl"))
end

end
testsuite = find_tests(@__DIR__)
delete!(testsuite, "setup")

runtests(cuTENSOR, ARGS; init_code, testsuite)
4 changes: 4 additions & 0 deletions lib/cutensornet/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
CUDA_Runtime_jll = "76a88914-d11a-5bdc-97e0-2f5a05c973a2"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
cuTENSOR = "011b41b2-24ef-40a8-b3eb-fa098493e9e1"
cuTensorNet = "448d79b3-4b49-4e06-a5ea-00c62c0dc3db"

[compat]
ParallelTestRunner = "2"
2 changes: 1 addition & 1 deletion lib/cutensornet/test/contractions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ m = 16
aligns_in = UInt32.([256, 256, 256])
aligns_out = UInt32(256)
ctn = CuTensorNetwork(elty, modes_in, extents_in, [C_NULL, C_NULL, C_NULL], Int32[0, 0, 0], Int32.(modesD), extentsD, C_NULL)
@testset for max_ws_size in [2^28, 2^32]
@testset for max_ws_size in [2^28]
@testset for tuning in [NoAutoTune(), AutoTune()]
ctn.input_arrs = raw_data_in
info = rehearse_contraction(ctn, max_ws_size)
Expand Down
Loading