Skip to content

Commit

Permalink
Forward fill to parent array
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Jul 18, 2024
1 parent f248a6e commit e2b603a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/DataLayouts/fill.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,9 @@ end

Base.fill!(dest::AbstractData, val) =
Base.fill!(dest, val, device_dispatch(dest))

# Specialize on Real, since `fill!(::AbstractArray, val)`
# may be able to leverage linear indexing.
# https://github.com/CliMA/ClimaCore.jl/issues/1888
Base.fill!(dest::AbstractData, val::Real) =
Base.fill!(parent(dest), val)

0 comments on commit e2b603a

Please sign in to comment.