How to use LoopVectorization.jl?

I can’t tell you how to fix it, but you might be hitting a (current) limitation of LoopVectorization. From the
README

The macro assumes that loop iterations can be reordered. It also currently supports simple nested loops, where loop bounds of inner loops are constant across iterations of the outer loop, and only a single loop at each level of loop nest. These limitations should be removed in a future version.

Also, “thread-local state”, i.e. indexing arrays by thread id, is bound to break. Please see

2 Likes