-
Notifications
You must be signed in to change notification settings - Fork 17
Description
It would be nice if we provide a macro that replaces functions with their vectorized version.
Like @ivm @. sin(x)
would replace this with IntelVectorMath function, and @applacc @. sin(x)
calls AppleAccelerate.
We can provide such macros from IntelVectorMath.jl too, or else maybe having all of them in one place like inside LoopVectorization.jl.
cc: @chriselrod
The major improvement these provide is that they're vectorized. If
x
is a scalar, then there isn't much benefit, if there is any at all.
Version of LoopVectorization provided an@vectorize
macro (that has since been removed) which naively swapped calls, and made loops incremented (ie, instead of 1:N, it would be 1:W:N, plus some code to handle the remainder).@avx
does this better.If they are a vector, calling
@avx sin.(x)
orIntelVectorMath.sin(x)
work (although a macro could search a whole block of code and swap them to useIntelVectorMath
.
Related: #42
Came up in: #22 (comment)