Skip to content

Commit a084cc8

Browse files
Merge pull request #1992 from CliMA/ck/jetfixes
Fix some JET failures
2 parents 4cda6fb + 463cc1a commit a084cc8

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

src/MatrixFields/field_matrix_solver.jl

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -247,17 +247,6 @@ function check_field_matrix_solver(::BlockDiagonalSolve, _, A, b)
247247
end
248248
end
249249

250-
# TODO: we can remove the uniform_vertical_levels
251-
# limitation while still using static shared memory
252-
# once Nv is in the type space.
253-
function uniform_vertical_levels(x, names)
254-
_, _, _, Nv1, _ = size(Fields.field_values(x[first(names)]))
255-
return all(Base.tail(names)) do name
256-
_, _, _, Nv, _ = size(Fields.field_values(x[name]))
257-
Nv == Nv1
258-
end
259-
end
260-
261250
NVTX.@annotate function run_field_matrix_solver!(
262251
::BlockDiagonalSolve,
263252
cache,
@@ -267,8 +256,7 @@ NVTX.@annotate function run_field_matrix_solver!(
267256
)
268257
names = matrix_row_keys(keys(A))
269258
if length(names) == 1 ||
270-
all(name -> A[name, name] isa UniformScaling, names.values) ||
271-
!uniform_vertical_levels(x, names.values)
259+
all(name -> A[name, name] isa UniformScaling, names.values)
272260
foreach(names) do name
273261
single_field_solve!(cache[name], x[name], A[name, name], b[name])
274262
end

src/MatrixFields/field_name_set.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,11 @@ end
276276
values_string(values) =
277277
length(values) == 2 ? join(values, " and ") : join(values, ", ", ", and ")
278278

279-
combine_eltypes(T1, T2) =
280-
T1 == T2 ? T1 :
279+
@noinline combine_eltypes(::T1, ::T2) where {T1, T2} =
281280
errror("Mismatched FieldNameSets: Cannot combine a $T1 with a $T2")
282281

282+
@inline combine_eltypes(::Type{T}, ::Type{T}) where {T} = T
283+
283284
combine_name_trees(::Nothing, ::Nothing) = nothing
284285
combine_name_trees(name_tree1, ::Nothing) = name_tree1
285286
combine_name_trees(::Nothing, name_tree2) = name_tree2

0 commit comments

Comments
 (0)