-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16d0cb7
commit 1c5195b
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters