Skip to content

Commit

Permalink
Merge pull request #115 from ytdHuang/opt/test
Browse files Browse the repository at this point in the history
Optimize precompilation process during runtests
  • Loading branch information
ytdHuang authored Nov 5, 2024
2 parents 274e7fa + de74b2a commit e8e5319
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ steps:
- "src/**"
- "ext/HierarchicalEOM_CUDAExt.jl"
- "test/runtests.jl"
- "test/CUDAExt.jl"
- "test/gpu/**"
- "Project.toml"
target: ".buildkite/CUDA_Ext.yml"
agents:
Expand Down
6 changes: 5 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
HierarchicalEOM_CUDAExt = "CUDA"

[compat]
Aqua = "0.8"
CUDA = "5"
DiffEqCallbacks = "2 - 4"
FastExpm = "1.1"
JET = "0.9"
JLD2 = "0.4.31 - 0.5"
LinearAlgebra = "1"
LinearSolve = "2.4.2 - 2"
Expand All @@ -45,7 +47,9 @@ Test = "1"
julia = "1.10"

[extras]
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"]
3 changes: 0 additions & 3 deletions test/code_quality.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import Aqua
import JET

@testset "Code quality" verbose = true begin
@testset "Aqua.jl" begin
Aqua.test_all(HierarchicalEOM; ambiguities = false)
Expand Down
6 changes: 0 additions & 6 deletions test/CUDAExt.jl → test/gpu/CUDAExt.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
using LinearSolve
using CUDA
CUDA.allowscalar(false) # Avoid unexpected scalar indexing

CUDA.versioninfo()

CUDA.@time @testset "CUDA Extension" begin

# re-define the bath (make the matrix smaller)
Expand Down
6 changes: 6 additions & 0 deletions test/gpu/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[deps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
QuantumToolbox = "6c2fb7c5-b903-41d2-bc5e-5a7c320b9fab"

[compat]
CUDA = "5"
29 changes: 20 additions & 9 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using Pkg
using Test
using HierarchicalEOM
import JLD2: jldopen

const GROUP = get(ENV, "GROUP", "All")

const testdir = dirname(@__FILE__)

include("test_utils.jl")

# Put Core tests in alphabetical order
core_tests = [
"ADOs.jl",
Expand All @@ -28,22 +24,37 @@ core_tests = [
]

if (GROUP == "All") || (GROUP == "Code_Quality")
Pkg.add(["Aqua", "JET"])
using HierarchicalEOM
using Aqua, JET

HierarchicalEOM.about()
include(joinpath(testdir, "code_quality.jl"))
end

if (GROUP == "All") || (GROUP == "Core")
GROUP == "All" ? nothing : HierarchicalEOM.about()
using HierarchicalEOM
import JLD2: jldopen

HierarchicalEOM.about()

include(joinpath(testdir, "test_utils.jl"))

for test in core_tests
include(joinpath(testdir, test))
end
end

if (GROUP == "CUDA_Ext")# || (GROUP == "All")
Pkg.add("CUDA")
Pkg.activate("gpu")
Pkg.develop(PackageSpec(path = dirname(@__DIR__)))
Pkg.instantiate()

using HierarchicalEOM
using CUDA, LinearSolve
CUDA.allowscalar(false) # Avoid unexpected scalar indexing

HierarchicalEOM.about()
include(joinpath(testdir, "CUDAExt.jl"))
CUDA.versioninfo()

include(joinpath(testdir, "test_utils.jl"))
include(joinpath(testdir, "gpu", "CUDAExt.jl"))
end

0 comments on commit e8e5319

Please sign in to comment.