Skip to content

Commit

Permalink
placeholder for AMDGPU
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Nov 15, 2024
1 parent 36b73ba commit 2678a5b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,23 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
ThreadsX = "ac1d9e8a-700a-412c-b207-f0111f4b6c0d"

[weakdeps]
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"

[extensions]
CUDAExt = "CUDA"
AMDGPUExt = "AMDGPU"

[compat]
AMDGPU = "1"
CUDA = "3.8, 4, 5"
ChainRulesCore = "1"
Flux = "0.14"
NCDatasets = "0.11, 0.12, 0.13, 0.14"
ThreadsX = "0.1"
julia = "1"

[weakdeps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"

[extensions]
CUDAExt = "CUDA"


[extras]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
Expand Down
20 changes: 20 additions & 0 deletions ext/AMDGPUExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module AMDGPUExt

import DINCAE: interpnd!, interp_adjn!, _to_device
using AMDGPU
using Flux


function interpnd!(pos::AbstractVector{<:NTuple{N}},A::ROCArray,vec) where N
@roc interpnd!(pos,A,vec)
end

function interp_adjn!(pos::AbstractVector{<:NTuple{N}},values::ROCArray,A2) where N
@roc interp_adjn!(pos,values,A2)
end

@inline function _to_device(::Type{Atype}) where Atype <: ROCArray
return Flux.gpu
end

end

0 comments on commit 2678a5b

Please sign in to comment.