Open baggepinnen opened 4 years ago
This is reminiscent of: https://github.com/chriselrod/LoopVectorization.jl/issues/7
But I'll make that one about supporting StaticArrays
, and this one about not throwing an error and instead using a fallback.
The problem here is because broadcasting falls back via dispatch, and I guess it does so on the wrong level with respect to StaticArrays
.
vmaterialize
constructs a similar
array here, and then calls vmaterialize!
on it.
Fall back behavior is achieved by dispatch selecting a method that forwards to Base.Broadcast.materialize!.
The problem, of course, is that StaticArrays doesn't write into a destination, you can't materialize!
into one. The error comes when trying to allocate that destination in the first place, inside vmaterialize
.
So, the check for compatibility has to look at all the inputs (like @avx
applied to loops does), and not just on the destination. I'll make broadcasting use the same mechanism as loops for this.
On LV v0.8.1
Trying the same thing with
vmap
produces another error