Skip to content

Commit

Permalink
Merge #1366
Browse files Browse the repository at this point in the history
1366: Change Ref -> tuple in broadcasting CartesianVector r=charleskawczynski a=charleskawczynski

This PR changes Ref -> tuple in broadcasting CartesianVector, since we were having allocation issues with `Ref`.

Co-authored-by: Charles Kawczynski <[email protected]>
  • Loading branch information
bors[bot] and charleskawczynski authored Jul 13, 2023
2 parents 68fabae + 3edb5fd commit 445448e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fields/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ function Base.Broadcast.broadcasted(
fs,
V,
arg,
Ref(space.global_geometry),
tuple(space.global_geometry),
local_geometry_field(space),
)
end
Expand Down
8 changes: 8 additions & 0 deletions src/Operators/spectralelement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,14 @@ Base.@propagate_inbounds _get_node(space, ij, slabidx, arg, xargs...) = (
Base.@propagate_inbounds function get_node(space, scalar, ij, slabidx)
scalar[]
end
Base.@propagate_inbounds function get_node(
space,
scalar::Tuple{<:Any},
ij,
slabidx,
)
scalar[1]
end
Base.@propagate_inbounds function get_node(
parent_space,
field::Fields.Field,
Expand Down

0 comments on commit 445448e

Please sign in to comment.