diff --git a/Project.toml b/Project.toml index 93fb0aa..b85d843 100644 --- a/Project.toml +++ b/Project.toml @@ -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" @@ -22,7 +21,6 @@ oneAPI = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b" [extensions] ExaModelsAMDGPU = "AMDGPU" -ExaModelsCUDA = "CUDA" ExaModelsIpopt = ["MathOptInterface", "NLPModelsIpopt"] ExaModelsJuMP = "JuMP" ExaModelsKernelAbstractions = "KernelAbstractions" @@ -33,7 +31,6 @@ ExaModelsSpecialFunctions = "SpecialFunctions" [compat] AMDGPU = "1" -CUDA = "5" Ipopt = "1.6" JuMP = "1" KernelAbstractions = "0.9" diff --git a/ext/ExaModelsAMDGPU.jl b/ext/ExaModelsAMDGPU.jl index fc1ceea..7e7501b 100644 --- a/ext/ExaModelsAMDGPU.jl +++ b/ext/ExaModelsAMDGPU.jl @@ -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) diff --git a/ext/ExaModelsCUDA.jl b/ext/ExaModelsCUDA.jl deleted file mode 100644 index 4eeee4c..0000000 --- a/ext/ExaModelsCUDA.jl +++ /dev/null @@ -1,8 +0,0 @@ -module ExaModelsCUDA - -import ExaModels: ExaModels, NLPModels -import CUDA: CUDA, CUDABackend, CuArray - -ExaModels.convert_array(v, backend::CUDABackend) = CuArray(v) - -end diff --git a/ext/ExaModelsKernelAbstractions.jl b/ext/ExaModelsKernelAbstractions.jl index 77ee976..a51aea1 100644 --- a/ext/ExaModelsKernelAbstractions.jl +++ b/ext/ExaModelsKernelAbstractions.jl @@ -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}) diff --git a/ext/ExaModelsOneAPI.jl b/ext/ExaModelsOneAPI.jl index 2a3282b..d4b8b61 100644 --- a/ext/ExaModelsOneAPI.jl +++ b/ext/ExaModelsOneAPI.jl @@ -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))