Skip to content

@avx seems not using multi threads with user-defined types #242

Answered by chriselrod
islent asked this question in Q&A
Discussion options

You must be logged in to vote

LoopVectorization only understands primitive element types, i.e. Union{Base.HWReal,Bool}:

julia> Union{Base.HWReal,Bool}
Union{Bool, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8}

and strided memory layouts.
It uses the function LoopVectorization.check_args to check arguments for compatibility, so if you're curious whether LoopVectorization will work with a type, you can try:

julia> LoopVectorization.check_args(PointArray)
false

If it returns false, that means it will not work and will instead simply apply @inbounds @fastmath to your loops and hope that works out.

In this case, it doesn't. Compare @inbounds @fastmath with @inbounds @simd:

julia> using LoopVect…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@islent
Comment options

@chriselrod
Comment options

Answer selected by islent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants