diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 83595dff..58abe692 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -9,7 +9,7 @@ steps: - "src/**" - "ext/QuantumToolboxCUDAExt.jl" - "test/runtests.jl" - - "test/ext-test/cuda_ext.jl" + - "test/ext-test/gpu/**" - "Project.toml" target: ".buildkite/CUDA_Ext.yml" agents: diff --git a/Project.toml b/Project.toml index 8921bce9..35b9ff0f 100644 --- a/Project.toml +++ b/Project.toml @@ -33,6 +33,7 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" QuantumToolboxCUDAExt = "CUDA" [compat] +Aqua = "0.8" ArrayInterface = "6, 7" CUDA = "5" DiffEqBase = "6" @@ -42,6 +43,7 @@ Distributed = "1" FFTW = "1.5" Graphs = "1.7" IncompleteLU = "0.2" +JET = "0.9" LinearAlgebra = "1" LinearSolve = "2" OrdinaryDiffEqCore = "1" @@ -59,8 +61,9 @@ Test = "1" julia = "1.10" [extras] -CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Test"] +test = ["Aqua", "JET", "Test"] diff --git a/test/core-test/code_quality.jl b/test/core-test/code_quality.jl index 724639a3..5effb97d 100644 --- a/test/core-test/code_quality.jl +++ b/test/core-test/code_quality.jl @@ -1,5 +1,3 @@ -using Aqua, JET - @testset "Code quality" verbose = true begin @testset "Aqua.jl" begin Aqua.test_all(QuantumToolbox; ambiguities = false, unbound_args = false) diff --git a/test/ext-test/gpu/Project.toml b/test/ext-test/gpu/Project.toml new file mode 100644 index 00000000..63ad2aa7 --- /dev/null +++ b/test/ext-test/gpu/Project.toml @@ -0,0 +1,6 @@ +[deps] +CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" +QuantumToolbox = "6c2fb7c5-b903-41d2-bc5e-5a7c320b9fab" + +[compat] +CUDA = "5" \ No newline at end of file diff --git a/test/ext-test/cuda_ext.jl b/test/ext-test/gpu/cuda_ext.jl similarity index 97% rename from test/ext-test/cuda_ext.jl rename to test/ext-test/gpu/cuda_ext.jl index f8c7f1f8..20219b42 100644 --- a/test/ext-test/cuda_ext.jl +++ b/test/ext-test/gpu/cuda_ext.jl @@ -1,10 +1,3 @@ -using CUDA -using CUDA.CUSPARSE -CUDA.allowscalar(false) # Avoid unexpected scalar indexing - -QuantumToolbox.about() -CUDA.versioninfo() - @testset "CUDA Extension" verbose = true begin ψdi = Qobj(Int64[1, 0]) ψdf = Qobj(Float64[1, 0]) diff --git a/test/runtests.jl b/test/runtests.jl index e188cd8a..20f72b05 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,10 +1,5 @@ using Test using Pkg -using QuantumToolbox -using QuantumToolbox: position, momentum -using Random -using SciMLOperators -import SciMLOperators: ScaledOperator const GROUP = get(ENV, "GROUP", "All") @@ -32,11 +27,18 @@ core_tests = [ ] if (GROUP == "All") || (GROUP == "Code-Quality") - Pkg.add(["Aqua", "JET"]) + using QuantumToolbox + using Aqua, JET + include(joinpath(testdir, "core-test", "code_quality.jl")) end if (GROUP == "All") || (GROUP == "Core") + using QuantumToolbox + import QuantumToolbox: position, momentum + import Random: MersenneTwister + import SciMLOperators: MatrixOperator + QuantumToolbox.about() for test in core_tests @@ -45,6 +47,17 @@ if (GROUP == "All") || (GROUP == "Core") end if (GROUP == "CUDA_Ext")# || (GROUP == "All") - Pkg.add("CUDA") - include(joinpath(testdir, "ext-test", "cuda_ext.jl")) + Pkg.activate("ext-test/gpu") + Pkg.develop(PackageSpec(path = dirname(@__DIR__))) + Pkg.instantiate() + + using QuantumToolbox + using CUDA + using CUDA.CUSPARSE + CUDA.allowscalar(false) # Avoid unexpected scalar indexing + + QuantumToolbox.about() + CUDA.versioninfo() + + include(joinpath(testdir, "ext-test", "gpu", "cuda_ext.jl")) end