Skip to content

Commit

Permalink
Readd AMDGPU depedency
Browse files Browse the repository at this point in the history
  • Loading branch information
michel2323 committed Dec 5, 2023
1 parent 5da101b commit db2197f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
2 changes: 2 additions & 0 deletions test/Polar/TestPolarForm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module TestPolarFormulation

using Test

using AMDGPU
using CUDA
using FiniteDiff
using KernelAbstractions
using LinearAlgebra
Expand Down
4 changes: 2 additions & 2 deletions test/Polar/second_order.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function test_hessprod_with_finitediff(polar, device, MT; rtol=1e-6, atol=1e-6)
proj_fd = zeros(nx+nu)
mul!(proj_fd, H_fd, tgt)

if startswith(string(device), "ROCBackend")
if isa(device, ROCBackend)
@test_broken myisapprox(projp, proj_fd, rtol=rtol)
else
@test myisapprox(projp, proj_fd, rtol=rtol)
Expand Down Expand Up @@ -121,7 +121,7 @@ function test_full_space_hessian(polar, device, MT)
Hd = FiniteDiff.finite_difference_jacobian(grad_fd_x, x)

# Test that both Hessian match
if startswith(string(device), "ROCBackend")
if isa(device, ROCBackend)
@test_broken myisapprox(Hd, H, rtol=1e-5)
else
@test myisapprox(Hd, H, rtol=1e-5)
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Expand All @@ -8,7 +9,6 @@ LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Metis = "2679e427-3c69-5b7f-982b-ece356f1e94b"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Expand Down
2 changes: 2 additions & 0 deletions test/quickstart.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Test
using AMDGPU
using CUDA
using KernelAbstractions

using ExaPF
Expand Down
17 changes: 4 additions & 13 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using LinearAlgebra
using Pkg
using Random
using SparseArrays
using Test

using AMDGPU
using CUDA
using KernelAbstractions

using ExaPF
Expand All @@ -18,18 +19,8 @@ is_package_installed(name::String) = !isnothing(Base.find_package(name))

ARCHS = Any[(CPU(), Array, SparseMatrixCSC)]

test_cuda = if is_package_installed("CUDA")
using CUDA
CUDA.has_cuda_gpu()
else
false
end
test_rocm = if is_package_installed("AMDGPU")
using AMDGPU
AMDGPU.has_rocm_gpu()
else
false
end
test_cuda = CUDA.functional() && CUDA.has_cuda_gpu()
test_rocm = AMDGPU.functional() && AMDGPU.has_rocm_gpu()

# Setup CUDA
if test_cuda
Expand Down

0 comments on commit db2197f

Please sign in to comment.