Skip to content

Commit

Permalink
Add broken gpu broadcasting test
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Jan 11, 2023
1 parent 16d0cb7 commit 1c5195b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/Fields/bc_gpu.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using Test
using CUDA
import ClimaCore.Fields as Fields
import ClimaCore.Device as Device
import ClimaCore.Domains as Domains
import ClimaCore.Geometry as Geometry
import ClimaCore.Meshes as Meshes
import ClimaCore.Topologies as Topologies
import ClimaCore.Spaces as Spaces
import ClimaComms

function foo!(::Type{FT}) where {FT}
context = ClimaComms.SingletonCommsContext(Device.device())
domain = Domains.RectangleDomain(
Domains.IntervalDomain(
Geometry.XPoint(FT(0)),
Geometry.XPoint(FT(1)),
periodic = true,
),
Domains.IntervalDomain(
Geometry.YPoint(FT(0)),
Geometry.YPoint(FT(1)),
periodic = true,
),
)
mesh = Meshes.RectilinearMesh(domain, 2, 2)
topology = Topologies.Topology2D(context, mesh)
quad = Spaces.Quadratures.GLL{3}()
space = Spaces.SpectralElementSpace2D(topology, quad)
(; x) = Fields.coordinate_field(space)
ϕ = @. sin(2 * FT(π) * x)
return nothing
end

@testset "GPU Field broadcasting" begin
try
foo!(Float64)
@test true
catch
@test_broken false
end
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ if !Sys.iswindows()
# now part of buildkite
# @safetestset "Fields" begin @time include("Fields/field.jl") end
@safetestset "Fields diffeq" begin @time include("Fields/fielddiffeq.jl") end
@safetestset "Fields gpu broadcast" begin @time include("Fields/bc_gpu.jl") end

@safetestset "Spectral elem - rectilinear" begin @time include("Operators/spectralelement/rectilinear.jl") end
@safetestset "Spectral elem - opt" begin @time include("Operators/spectralelement/opt.jl") end
Expand Down

0 comments on commit 1c5195b

Please sign in to comment.