Skip to content

Commit 61fd153

Browse files
Add broken cuda test
1 parent 5f096c2 commit 61fd153

File tree

2 files changed

+89
-1
lines changed

2 files changed

+89
-1
lines changed

.buildkite/pipeline.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,18 @@ steps:
651651
CLIMACOMMS_DEVICE: "CUDA"
652652
agents:
653653
slurm_gpus: 1
654-
654+
655+
- label: "Unit: operators on levels and extruded spaces"
656+
key: unit_cuda_operators_example
657+
command: "julia --color=yes --check-bounds=yes --project=.buildkite test/Operators/unit_operators_examples.jl"
658+
command:
659+
- "julia --project=.buildkite -e 'using CUDA; CUDA.versioninfo()'"
660+
- "julia --color=yes --check-bounds=yes --project=.buildkite test/Operators/unit_operators_examples.jl"
661+
env:
662+
CLIMACOMMS_DEVICE: "CUDA"
663+
agents:
664+
slurm_gpus: 1
665+
655666
- label: "Unit: velocity grad tensor ops"
656667
key: unit_spectral_tensor_op_cuda
657668
command: "julia --color=yes --check-bounds=yes --project=.buildkite test/Operators/spectralelement/covar_deriv_ops.jl"
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import ClimaCore:
2+
Domains,
3+
Meshes,
4+
Geometry,
5+
Grids,
6+
Spaces,
7+
Topologies,
8+
Hypsography,
9+
Fields,
10+
Operators,
11+
Utilities
12+
import ClimaComms
13+
14+
ClimaComms.@import_required_backends
15+
device = ClimaComms.device()
16+
comms_ctx = ClimaComms.context(device)
17+
18+
h_domain = Domains.RectangleDomain(
19+
Domains.IntervalDomain(
20+
Geometry.XPoint(0.0),
21+
Geometry.XPoint(1.0);
22+
periodic = true,
23+
),
24+
Domains.IntervalDomain(
25+
Geometry.YPoint(0.0),
26+
Geometry.YPoint(1.0);
27+
periodic = true,
28+
),
29+
)
30+
h_mesh = Meshes.RectilinearMesh(h_domain, 10, 10)
31+
h_grid = Spaces.grid(
32+
Spaces.SpectralElementSpace2D(
33+
Topologies.DistributedTopology2D(
34+
comms_ctx,
35+
h_mesh,
36+
Topologies.spacefillingcurve(h_mesh),
37+
),
38+
Spaces.Quadratures.GLL{4}(),
39+
),
40+
)
41+
z_domain = Domains.IntervalDomain(
42+
Geometry.ZPoint(0.0),
43+
Geometry.ZPoint(1.0);
44+
boundary_names = (:bottom, :top),
45+
)
46+
z_grid = Grids.FiniteDifferenceGrid(
47+
Topologies.IntervalTopology(
48+
comms_ctx,
49+
Meshes.IntervalMesh(z_domain, Meshes.Uniform(); nelems = 10),
50+
),
51+
)
52+
grid = Grids.ExtrudedFiniteDifferenceGrid(
53+
h_grid,
54+
z_grid,
55+
Hypsography.Flat();
56+
deep = false,
57+
)
58+
center_space = Spaces.CenterExtrudedFiniteDifferenceSpace(grid)
59+
face_space = Spaces.FaceExtrudedFiniteDifferenceSpace(grid)
60+
61+
# Create fields and show that it fails
62+
ᶜgradᵥ = Operators.GradientF2C()
63+
64+
level_field = Fields.level(Fields.Field(Float64, face_space), Utilities.half)
65+
ᶠscalar_field = Fields.Field(Float64, face_space)
66+
# Does not work:
67+
using Test
68+
69+
@testset "Broken broadcast expression on GPUs" begin
70+
if device isa ClimaComms.CUDADevice
71+
@test_broken begin
72+
@. ᶜgradᵥ(level_field + ᶠscalar_field)
73+
end
74+
else
75+
@. ᶜgradᵥ(level_field + ᶠscalar_field)
76+
end
77+
end

0 commit comments

Comments
 (0)