-
Notifications
You must be signed in to change notification settings - Fork 280
Added load / store / broadcast APIs #596
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
Conversation
| template <class To, class A=default_arch, class From> | ||
| void store_batch(To* dst, batch<From, A> const& src, aligned_mode) { | ||
| kernel::store_aligned(dst, src, A{}); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the use of such aliases, We already provide xsimd::store that does exactly the same. If that's for backward compatibility, then I'd suggest using the __attribute__((deprecated(reason)) attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is for symmetry with load_batch, which is slightly different form the load methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another solution would be to replace the current load_xxx with the new implementation, andmake the current store implementation symmetric. And I discard the load_batch / store_batch methods. What do you think @serge-sans-paille ?
67628bf to
f318db9
Compare
| * @return a new batch instance | ||
| */ | ||
| template <class To, class A=default_arch, class From> | ||
| simd_return_type<From, To> broadcast_as(From v) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should static_assert that From and To are different and redirect to the right function otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, because as a user you don't want to have to check whether the types are equivalent or not, and invoke a function or another one depending on that. The user can do it, but we should not impose it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. Looks good otherwise, feel free to merge.
@serge-sans-paille these are the last APIs missing in xsimd and that we need in xtensor.
Once this is merged, we can release ;)