Skip to content

Commit

Permalink
Define CuArray on FieldArrays
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Aug 31, 2024
1 parent 5df8fbb commit 6748636
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ext/cuda/data_layouts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ function Adapt.adapt_structure(
Adapt.adapt(to, bc.axes),
)
end

import ClimaCore.DataLayouts as DL
import CUDA
function CUDA.CuArray(fa::DL.FieldArray{FD}) where {FD}
arrays = ntuple(Val(DL.ncomponents(fa))) do f
CUDA.CuArray(fa.arrays[f])
end
return DL.FieldArray{FD}(arrays)
end

0 comments on commit 6748636

Please sign in to comment.