generalization of reduce_mul implementation#1163
Merged
Merged
Conversation
263b4e8 to
6f5a63b
Compare
Contributor
Author
|
Note to self: we should provide dedicated reduction for |
6f5a63b to
42055b1
Compare
It matches the implementation of other operations.
42055b1 to
65e837b
Compare
65e837b to
83727ee
Compare
JohanMabille
approved these changes
Aug 29, 2025
| res += val; | ||
| } | ||
| return res; | ||
| } |
Member
There was a problem hiding this comment.
Technically, this means the next release should be a major one. On the other hand, since reduce_add was already available, I wonder if this function was really used.
Contributor
Author
|
On Fri, Aug 29, 2025 at 08:45:48AM -0700, Johan Mabille wrote:
@JohanMabille approved this pull request.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
In [1]include/xsimd/arch/common/xsimd_common_arithmetic.hpp:
> @@ -139,20 +139,6 @@ namespace xsimd
return fma(x, y, select(mask, neg(z), z));
}
- // hadd
- template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
- XSIMD_INLINE T hadd(batch<T, A> const& self, requires_arch<common>) noexcept
- {
- alignas(A::alignment()) T buffer[batch<T, A>::size];
- self.store_aligned(buffer);
- T res = 0;
- for (T val : buffer)
- {
- res += val;
- }
- return res;
- }
well, it's not part of the standard API, is it?
|
Member
|
Ah indeed, so we're good |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.