Skip to content

Commit a2dd2e6

Browse files
authored
Fix broadcasting rules given upstream broadcasting fixes (#94)
There was a bug in Julia broadcasting rules fixed by JuliaLang/julia#35948, but that fix breaks a test here, since this package was inadvertantly relying on the old incorrect logic. This fixes this package, basically correctly implements the API, and doesn't break it on current Julia versions either.
1 parent 0c498fb commit a2dd2e6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/broadcast.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ _extract(_) = nothing
77
abstract type AbstractStrideStyle{S,N} <: Base.Broadcast.AbstractArrayStyle{N} end
88
struct LinearStyle{S,N,R} <: AbstractStrideStyle{S,N} end
99
struct CartesianStyle{S,N} <: AbstractStrideStyle{S,N} end
10+
LinearStyle{S,N,R}(::Val{N}) where {S,N,R} = LinearStyle{S,N,R}()
11+
CartesianStyle{S,N}(::Val{N}) where {S,N} = CartesianStyle{S,N}()
1012
@generated function Base.BroadcastStyle(
1113
::Type{A}
1214
) where {T<:VectorizationBase.NativeTypes,N,R,S,X,A<:AbstractStrideArray{T,N,R,S,X}}

0 commit comments

Comments
 (0)