LoopVectorization.jl
LoopVectorization.jl copied to clipboard
Can i use this package with while loop?
Can i use this package with while loop?
Can i use this package with while loop?
No. If it isn't possible to transform the while loop into a for loop, then the loop is probably too complicated for it to understand.
LoopVectorization works by performing different iterations in parallel (using SIMD instructions with @turbo
, or SIMD instructions + threading with @tturbo
), so it's also important that this is legal.
E.g., while loops are often used for iterative algorithms, and these necessarily require you to perform one iteration after the other, rather than in parallel.
There are some numerical methods that i couldn't transform to for loop (fixed iteration). It goes on and on until the condition meets. It will be nice to see any plan to support while (not fixed) iterations.
İdea: Don't parse whole loop body, parse just inside of while loop body and compile to efficient one.