Skip to content

Commit

Permalink
remove convert array
Browse files Browse the repository at this point in the history
  • Loading branch information
sshin23 committed Jan 12, 2025
1 parent 0e0780d commit a00f7b2
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 15 deletions.
3 changes: 0 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ SolverCore = "ff4d7338-4cf1-434d-91df-b86cb86fb843"

[weakdeps]
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
Expand All @@ -22,7 +21,6 @@ oneAPI = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b"

[extensions]
ExaModelsAMDGPU = "AMDGPU"
ExaModelsCUDA = "CUDA"
ExaModelsIpopt = ["MathOptInterface", "NLPModelsIpopt"]
ExaModelsJuMP = "JuMP"
ExaModelsKernelAbstractions = "KernelAbstractions"
Expand All @@ -33,7 +31,6 @@ ExaModelsSpecialFunctions = "SpecialFunctions"

[compat]
AMDGPU = "1"
CUDA = "5"
Ipopt = "1.6"
JuMP = "1"
KernelAbstractions = "0.9"
Expand Down
2 changes: 0 additions & 2 deletions ext/ExaModelsAMDGPU.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module ExaModelsAMDGPU

import ExaModels, AMDGPU

ExaModels.convert_array(v, backend::AMDGPU.ROCBackend) = AMDGPU.ROCArray(v)

# Below are type piracy
function Base.findall(f::F, bitarray::A) where {F<:Function,A<:AMDGPU.ROCVector}
a = Array(bitarray)
Expand Down
8 changes: 0 additions & 8 deletions ext/ExaModelsCUDA.jl

This file was deleted.

4 changes: 4 additions & 0 deletions ext/ExaModelsKernelAbstractions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ module ExaModelsKernelAbstractions
import ExaModels: ExaModels, NLPModels
import KernelAbstractions: KernelAbstractions, @kernel, @index, @Const, synchronize, CPU

function ExaModels.convert_array(v, backend)
vg = KernelAbstractions.zeros(backend, eltype(v), length(v))
copyto!(vg, v)
end
ExaModels.convert_array(v, backend::CPU) = v

function getitr(gen::UnitRange{Int64})
Expand Down
2 changes: 0 additions & 2 deletions ext/ExaModelsOneAPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ function ExaModels.append!(backend, a::A, b::Number, lb) where {A<:oneAPI.oneArr
return aa
end

ExaModels.convert_array(v, backend::oneAPI.oneAPIBackend) = oneAPI.oneArray(v)

ExaModels.sort!(array::A; lt = isless) where {A<:oneAPI.oneArray} =
copyto!(array, sort!(Array(array); lt = lt))

Expand Down

0 comments on commit a00f7b2

Please sign in to comment.