-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New paper on simd<enum> #75
Comments
At this point I only want to pursue enums. I believe that |
I find that a little surprising and also question the usefulness, but it would be consistent if we would get
Here I fully agree. This is also what I implemented in my LLAMA library, where I can vectorize any nested struct (described as nested typelists though). if you do it this way, then code like: auto add(auto pair) {
return pair.first + pair.second;
} Would work efficienly on scalars and vectors, which I think is an important property in the face of heterogeneity. For CUDA, you would want to have scalar instantiations of your algorithms, and SIMD ones for CPUs. At some point in the future, reflection may be powerful enough to also simdize structs and maybe whole classes (including member functions), while maintaining this scalar/vector flexibility, depending on how you instantiate.
That's also my poor man's reflection for now :D |
Yes, since there's a place for both Wrt. |
I agreed. A simd should make the T an atomic unit rather than breaking it up.
That's true for pair, but being able to create simd values of other user defined types is interesting. We have done a few examples of this, where simd operates on types (e.g., fixed-point) that aren't going to be standardised anytime soon, but still have hardware support to back them. We use traits to define what the container for each type looks like, and how to map the various operators onto their hardware instructions. With a little bit of work implementing the trait the full power of std::simd then becomes available - anything that simd allows you to conveniently do (permutation, reductions, predicated operations, resizing, parallel memory operations, come to mind) just works. Using the mechanisms we have we can already create simd of enum, but it relies on a few implementation details. Exposing the traits in a way that doesn't rely on the implementation is the interesting bit. It would have been useful to whiteboard this at Varna but unfortunately I won't be able to make that meeting.
I like this idea too, but as you say, it's a completely different thing. |
Yes! As SG6 regular and chair, please feel free to help getting fixed-point etc. standardized soon! And yes, I'd like to focus this issue on |
|
Make the following types vectorizable:
std::pair<T, U>
whereT
andU
are vectorizablestd::tuple<Ts...>
whereTs...
are vectorizableThe text was updated successfully, but these errors were encountered: