Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upmacro does not work on arrays, no way to have a manual default implementation #18
Comments
fschutt
changed the title
macro does not work on arrays, no way to have a default implementation
macro does not work on arrays, no way to have a manual default implementation
Dec 14, 2017
This comment has been minimized.
This comment has been minimized.
|
Currently it is not very useful for explicit SIMD because of rust-lang/rust#42515. It's current use is with autovectorization. Once that issue is fixed you should be able to
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fschutt commentedDec 14, 2017
The problem is that I'm trying to vectorize this code:
https://github.com/fschutt/layout2d/blob/master/src/rect.rs#L43-L107
This crate is not helpful - if I use the
simdfunction, the SIMD will also be used in the default function. There is no way to use SIMD in the function, but no SIMD in the default, fallback function.Second, loading from fields takes a considerable amount of time in SIMD, which is why I have that weird layout with the four-number array. The macro completely fails on arrays, it does not vectorize arrays at all.
I don't know what the goal is - if you want me to write hand-vectorized code, then you need to provide to write a manual fallback function. If you want to do this work "automagically", then the macro should be smarter about arrays.
Currently the code generated with arrays is horrible:
If I, however, use the stdsimd functions, I get those too in the
default()function, which completely works against the point of this library:Now the default function has SIMD function, which is agains the point.
So, in practice, this library is currently useless.