2 ms·
Yes, it is required for all functions to be inlined in Julia. Note that Julia 1.8 and newer supports callsite inlining, so you can, for example, do `@inline exp
by celrod 3y ago
Yes, it is required for all functions to be inlined in Julia. Note that Julia 1.8 and newer supports callsite inlining, so you can, for example, do `@inline exp(x[i])` inside your `for` loop, and this will cause `exp` to get inlined there, and should enable vectorization.
For functions like `log` or `sin`, this is not enough, but you could try `@turbo` from LoopVectorization.jl, which supports these and some others.
`@simd ivdep` may be needed when you have indirect indexing.
Do not forget the `ivdep`, but only if you know it is actually safe. This can lead to hard to track down bugs if it is not.