-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1671 from CliMA/ck/prog_edmf_implicit_repro_only
Add broken GPU test for implicit prognostic edmf
- Loading branch information
Showing
2 changed files
with
67 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
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,56 @@ | ||
#= | ||
using Revise; include(joinpath("test", "MatrixFields", "gpu_compat_bidiag_matrix_row.jl")) | ||
=# | ||
import ClimaCore | ||
import ClimaComms | ||
if !(@isdefined(TU)) | ||
include( | ||
joinpath( | ||
pkgdir(ClimaCore), | ||
"test", | ||
"TestUtilities", | ||
"TestUtilities.jl", | ||
), | ||
) | ||
end | ||
import .TestUtilities as TU | ||
|
||
import ClimaCore: Spaces, Geometry, Operators, Fields, MatrixFields | ||
using ClimaCore.MatrixFields: | ||
BidiagonalMatrixRow, TridiagonalMatrixRow, MultiplyColumnwiseBandMatrixField | ||
const C3 = Geometry.Covariant3Vector | ||
FT = Float64 | ||
const ᶠgradᵥ = Operators.GradientC2F( | ||
bottom = Operators.SetGradient(C3(0)), | ||
top = Operators.SetGradient(C3(0)), | ||
) | ||
const ᶠgradᵥ_matrix = MatrixFields.operator_matrix(ᶠgradᵥ) | ||
const ⋅ = MultiplyColumnwiseBandMatrixField() | ||
|
||
device = ClimaComms.device() | ||
context = ClimaComms.context(device) | ||
cspace = | ||
TU.CenterExtrudedFiniteDifferenceSpace(FT; zelem = 25, helem = 10, context) | ||
fspace = Spaces.FaceExtrudedFiniteDifferenceSpace(cspace) | ||
@info "device = $device" | ||
|
||
f = (; | ||
ᶠtridiagonal_matrix_c3 = Fields.Field(TridiagonalMatrixRow{C3{FT}}, fspace), | ||
) | ||
|
||
const ᶜleft_bias = Operators.LeftBiasedF2C() | ||
const ᶜright_bias = Operators.RightBiasedF2C() | ||
const ᶜleft_bias_matrix = MatrixFields.operator_matrix(ᶜleft_bias) | ||
const ᶜright_bias_matrix = MatrixFields.operator_matrix(ᶜright_bias) | ||
|
||
conv(::Type{_FT}, ᶜbias_matrix) where {_FT} = | ||
convert(BidiagonalMatrixRow{_FT}, ᶜbias_matrix) | ||
function foo(f) | ||
(; ᶠtridiagonal_matrix_c3) = f | ||
space = axes(ᶠtridiagonal_matrix_c3) | ||
FT = Spaces.undertype(space) | ||
@. ᶠtridiagonal_matrix_c3 = ᶠgradᵥ_matrix() ⋅ conv(FT, ᶜleft_bias_matrix()) | ||
return nothing | ||
end | ||
|
||
foo(f) |