Skip to content

Commit

Permalink
Merge pull request #415 from JuliaHealth/metal-dev
Browse files Browse the repository at this point in the history
Fixing testing environments for GPU backends
  • Loading branch information
cncastillo authored Jun 21, 2024
2 parents ebfaead + 0f47f36 commit 3178902
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
23 changes: 17 additions & 6 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ steps:
julia -e 'println("--- :julia: Instantiating project")
using Pkg
Pkg.develop([
PackageSpec(path=pwd(), subdir="."),
PackageSpec(path=pwd(), subdir="KomaMRIBase"),
PackageSpec(path=pwd(), subdir="KomaMRICore"),
])'
julia -e 'println("--- :julia: Running tests")
using Pkg
Pkg.test("KomaMRICore"; coverage=true, julia_args=`--threads=auto`)'
Expand All @@ -46,11 +45,14 @@ steps:
julia -e 'println("--- :julia: Instantiating project")
using Pkg
Pkg.develop([
PackageSpec(path=pwd(), subdir="."),
PackageSpec(path=pwd(), subdir="KomaMRIBase"),
PackageSpec(path=pwd(), subdir="KomaMRICore"),
])'
julia --project=KomaMRICore/test -e 'println("--- :julia: Add AMDGPU to test environment")
using Pkg
Pkg.add("AMDGPU")'
julia -e 'println("--- :julia: Running tests")
using Pkg
Pkg.test("KomaMRICore"; coverage=true, test_args=["AMDGPU"])'
Expand All @@ -77,11 +79,14 @@ steps:
julia -e 'println("--- :julia: Instantiating project")
using Pkg
Pkg.develop([
PackageSpec(path=pwd(), subdir="."),
PackageSpec(path=pwd(), subdir="KomaMRIBase"),
PackageSpec(path=pwd(), subdir="KomaMRICore"),
])'
julia --project=KomaMRICore/test -e 'println("--- :julia: Add CUDA to test environment")
using Pkg
Pkg.add("CUDA")'
julia -e 'println("--- :julia: Running tests")
using Pkg
Pkg.test("KomaMRICore"; coverage=true, test_args=["CUDA"])'
Expand All @@ -103,11 +108,14 @@ steps:
julia -e 'println("--- :julia: Instantiating project")
using Pkg
Pkg.develop([
PackageSpec(path=pwd(), subdir="."),
PackageSpec(path=pwd(), subdir="KomaMRIBase"),
PackageSpec(path=pwd(), subdir="KomaMRICore"),
])'
julia --project=KomaMRICore/test -e 'println("--- :julia: Add Metal to test environment")
using Pkg
Pkg.add("Metal")'
julia -e 'println("--- :julia: Running tests")
using Pkg
Pkg.test("KomaMRICore"; test_args=["Metal"])'
Expand Down Expand Up @@ -135,11 +143,14 @@ steps:
julia -e 'println("--- :julia: Instantiating project")
using Pkg
Pkg.develop([
PackageSpec(path=pwd(), subdir="."),
PackageSpec(path=pwd(), subdir="KomaMRIBase"),
PackageSpec(path=pwd(), subdir="KomaMRICore"),
])'
julia --project=KomaMRICore/test -e 'println("--- :julia: Add oneAPI to test environment")
using Pkg
Pkg.add("oneAPI")'
julia -e 'println("--- :julia: Running tests")
using Pkg
Pkg.test("KomaMRICore"; coverage=true, test_args=["oneAPI"])'
Expand Down
12 changes: 4 additions & 8 deletions KomaMRICore/test/initialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@ using Pkg
using Suppressor

const USE_GPU = if "AMDGPU" in ARGS
@suppress Pkg.add("AMDGPU")
using AMDGPU
using AMDGPU # ] add AMDGPU to KomaMRICore/test/Project.toml
@info "Testing AMD" maxlog=1
true
elseif "CUDA" in ARGS
@suppress Pkg.add("CUDA")
using CUDA
using CUDA # ] add CUDA to KomaMRICore/test/Project.toml
@info "Testing CUDA" maxlog=1
true
elseif "Metal" in ARGS
@suppress Pkg.add("Metal")
using Metal
using Metal # ] add Metal to KomaMRICore/test/Project.toml
@info "Testing Metal" maxlog=1
true
elseif "oneAPI" in ARGS
@suppress Pkg.add("oneAPI")
using oneAPI
using oneAPI # ] add oneAPI to KomaMRICore/test/Project.toml
@info "Testing oneAPI" maxlog=1
true
else
Expand Down

0 comments on commit 3178902

Please sign in to comment.