Skip to content

Commit

Permalink
Merge #1111
Browse files Browse the repository at this point in the history
1111: cuda support for dss2 (serial) r=sriharshakandala a=sriharshakandala



Co-authored-by: sriharshakandala <sriharsha.kvs@gmail.com>
  • Loading branch information
bors[bot] and sriharshakandala authored Jan 31, 2023
2 parents 95c84fc + de36bcb commit ba71538
Show file tree
Hide file tree
Showing 12 changed files with 737 additions and 145 deletions.
4 changes: 4 additions & 0 deletions examples/sphere/shallow_water_cuda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,10 @@ function shallow_water_driver_cuda(ARGS, ::Type{FT}) where {FT}
h_s = surface_topography(space, test)
Y = set_initial_condition(space, test)

ghost_buffer = Spaces.create_dss_buffer(Y)
Spaces.weighted_dss_start2!(Y, ghost_buffer)
Spaces.weighted_dss_internal2!(Y, ghost_buffer)
Spaces.weighted_dss_ghost2!(Y, ghost_buffer)
return nothing
end

Expand Down
6 changes: 6 additions & 0 deletions src/DataLayouts/DataLayouts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ function IJF{S, Nij}(array::AbstractArray{T, 3}) where {S, Nij, T}
IJF{S, Nij, typeof(array)}(array)
end

rebuild(data::IJF{S, Nij}, array::A) where {S, Nij, A <: AbstractArray} =
IJF{S, Nij}(array)

function replace_basetype(data::IJF{S, Nij}, ::Type{T}) where {S, Nij, T}
array = parent(data)
S′ = replace_basetype(eltype(array), T, S)
Expand Down Expand Up @@ -1058,6 +1061,9 @@ function VIFH{S, Ni}(array::AbstractArray{T, 4}) where {S, Ni, T}
VIFH{S, Ni, typeof(array)}(array)
end

rebuild(data::VIFH{S, Ni}, array::A) where {S, Ni, A <: AbstractArray} =
VIFH{S, Ni}(array)

function replace_basetype(data::VIFH{S, Ni}, ::Type{T}) where {S, Ni, T}
array = parent(data)
S′ = replace_basetype(eltype(array), T, S)
Expand Down
2 changes: 2 additions & 0 deletions src/Spaces/Spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
module Spaces

using ClimaComms
using Adapt
using CUDA

import ..slab, ..column, ..level
import ..Utilities: PlusHalf
Expand Down
Loading

0 comments on commit ba71538

Please sign in to comment.