I'm trying to write a loop that currently looks something like
@avx for i in 1:2:(length(a)-1)
f(a[i], a[i+1]
end
What's the right way to write something like this with LoopVectorization? Is there an easy way I can tell if LoopVectorization is able to understand this loop, or if it is bailing out and just @inbounds @simd
'ing it?
Okay, so one approach is to just reshape a
to a 2xN
matrix and then treat the first index special. Interestingly, I found a performance loss when I made it a StaticInt(2)xN
matrix for some reason.
What kind of static array
I was using a PtrArray
. Chris identified what the problem was in #general > Working with Complex Numbers in LoopVectorization. It was just that VectorizationBase.jl was making a suboptimal choice for my CPU architecture, so he added a patch that makes it make the right choice
Last updated: Nov 22 2024 at 04:41 UTC