Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove AMDGPU dependency #52

Merged
merged 2 commits into from
Jul 9, 2023
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
5 changes: 2 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name = "ExaAdmm"
uuid = "4d6a948c-1075-4240-a564-361a5d4e22a2"
authors = ["Youngdae Kim <[email protected]>", "Kibaek Kim <[email protected]>", "Weiqi Zhang <[email protected]>", "Bowen Li <[email protected]>", "François Pacaud <[email protected]>", "Michel Schanen <[email protected]>"]
version = "0.5.0"
version = "0.5.1"

[deps]
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
ExaTron = "28b18bf8-76f9-41ea-81fa-0f922810b349"
Expand All @@ -18,7 +18,6 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
AMDGPU = "0.4"
CUDA = "4.1"
ExaTron = "3"
FileIO = "1.14"
Expand Down
2 changes: 1 addition & 1 deletion src/ExaAdmm.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module ExaAdmm

using Adapt
using Printf
using FileIO
using DelimitedFiles
using LinearAlgebra
using SparseArrays
using MPI
using CUDA
import AMDGPU: ROCArray, has_rocm_gpu
using KernelAbstractions
using ExaTron
using Random
Expand Down
8 changes: 4 additions & 4 deletions src/interface/solve_acopf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ function solve_acopf(case::String;
elseif use_gpu && isa(ka_device, Nothing)
CUDA.device!(gpu_no)
TD = CuArray{Float64,1}; TI = CuArray{Int,1}; TM = CuArray{Float64,2}
elseif has_cuda_gpu()
TD = CuArray{Float64,1}; TI = CuArray{Int,1}; TM = CuArray{Float64,2}
elseif has_rocm_gpu()
TD = ROCArray{Float64,1}; TI = ROCArray{Int,1}; TM = ROCArray{Float64,2}
elseif KA.isgpu(ka_device)
TD = typeof(Adapt.adapt(ka_device, Array{Float64,1}(undef, 0)))
TI = typeof(Adapt.adapt(ka_device, Array{Int,1}(undef, 0)))
TM = typeof(Adapt.adapt(ka_device, Array{Float64,2}(undef, 0, 0)))
else
error("Inconsistent device selection use_gpu=$use_gpu and ka_device=$(typeof(ka_device))")
end
Expand Down
8 changes: 4 additions & 4 deletions src/interface/solve_qpsub.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ function solve_qpsub(
elseif use_gpu && isa(ka_device, Nothing)
CUDA.device!(gpu_no)
TD = CuArray{Float64,1}; TI = CuArray{Int,1}; TM = CuArray{Float64,2}
elseif has_cuda_gpu()
TD = CuArray{Float64,1}; TI = CuArray{Int,1}; TM = CuArray{Float64,2}
elseif has_rocm_gpu()
TD = ROCArray{Float64,1}; TI = ROCArray{Int,1}; TM = ROCArray{Float64,2}
elseif KA.isgpu(ka_device)
TD = typeof(Adapt.adapt(ka_device, Array{Float64,1}(undef, 0)))
TI = typeof(Adapt.adapt(ka_device, Array{Int,1}(undef, 0)))
TM = typeof(Adapt.adapt(ka_device, Array{Float64,2}(undef, 0, 0)))
else
error("Inconsistent device selection use_gpu=$use_gpu and ka_device=$(typeof(ka_device))")
end
Expand Down