You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current documentation describes the package, but does really mention where/why one would use `NullBroadcasted.
It'd be useful to add a line to provide more motivation for the package.
This package defines NullBroadcasted(), which can be added to, subtracted from, or multiplied by any value in a broadcast expression without incurring a runtime performance penalty. This can be useful for X
The text was updated successfully, but these errors were encountered:
NullBroadcasts provides an elegant solution to summing/subtracting non-existing broadcasted objects in broadcast expressions, without a performance penalty. It will also allow us to skip kernel launches on simple increments, for example: @. x += NullBroadcasted(), which will result in Base.materialize!(dest, ::NullBroadcasted) = nothing (no cost, no reads/writes, no kernel launches, a no-op).
The original alternative we had in ClimaAtmos was to use something of the flavor @. x += zero(eltype(x)), but that means that we would be reading and writing to x for every point in space, in a useless operation. We don't want to pay for this. Enter NullBroadcasts.jl.
I guess we could show users how we plan to use it, if you think it's helpful. See, for example CliMA/ClimaAtmos.jl#3540.
(I know documentation is under construction)
The current documentation describes the package, but does really mention where/why one would use `NullBroadcasted.
It'd be useful to add a line to provide more motivation for the package.
The text was updated successfully, but these errors were encountered: