File tree Expand file tree Collapse file tree
test/Operators/spectralelement Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -705,6 +705,11 @@ steps:
705705 retry : *retry_policy
706706 command : " julia --color=yes --check-bounds=yes --project=.buildkite test/Operators/spectralelement/rectilinear.jl"
707707
708+ - label : " Unit: lazy composition"
709+ key : unit_lazy_composition
710+ retry : *retry_policy
711+ command : " julia --color=yes --check-bounds=yes --project=.buildkite test/Operators/spectralelement/lazy_composition.jl"
712+
708713 - label : " Unit: diffusion2d"
709714 key : unit_diffusion2d
710715 retry : *retry_policy
@@ -926,6 +931,15 @@ steps:
926931 agents :
927932 slurm_gpus : 1
928933
934+ - label : " Unit: lazy composition cuda"
935+ key : unit_lazy_composition_cuda
936+ retry : *retry_policy
937+ command : " julia --color=yes --check-bounds=yes --project=.buildkite test/Operators/spectralelement/lazy_composition.jl"
938+ env :
939+ CLIMACOMMS_DEVICE : " CUDA"
940+ agents :
941+ slurm_gpus : 1
942+
929943 - label : " Unit: operators on levels and extruded spaces"
930944 key : unit_cuda_operators_example
931945 retry : *retry_policy
Original file line number Diff line number Diff line change @@ -507,10 +507,8 @@ Base.Broadcast.BroadcastStyle(
507507 :: Fields.AbstractFieldStyle ,
508508) = style
509509
510- # The device-resolved style assigned by `instantiate` takes precedence over the
511- # generic construction-time style, so an instantiated spectral broadcast can be
512- # used as an argument to a new operator broadcast. See the finite-difference
513- # analogue for `ColumnStencilStyle` in the CUDA extension.
510+ # The device-resolved style assigned by `instantiate` takes precedence over
511+ # the generic construction-time style.
514512Base. Broadcast. BroadcastStyle (
515513 :: SpectralStyle ,
516514 style:: AbstractSpectralStyle ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import ClimaCore:
1212 Quadratures
1313import ClimaCore. Operators as O
1414import Base. Broadcast as BB
15+ import LazyBroadcast: lazy
1516using LinearAlgebra, IntervalSets
1617
1718@testset " spectral broadcast style combination" begin
4849 )
4950 out = @. wdiv (K * ∇f)
5051 @test parent (out) ≈ 2 .* parent (ref)
52+ ∇f_lazy = @. lazy (grad (f) + grad (f))
53+ out_lazy = @. wdiv (K * ∇f_lazy)
54+ @test parent (out_lazy) ≈ 2 .* parent (ref)
5155end
You can’t perform that action at this time.
0 commit comments