Skip to content
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

Make VectorizedArray::sum() const #15735

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions include/deal.II/base/vectorization.h
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ class VectorizedArray
*/
DEAL_II_ALWAYS_INLINE
Number
sum()
sum() const
{
return data;
}
Expand Down Expand Up @@ -1205,7 +1205,7 @@ class VectorizedArray<double, 2>
* this->data[i]$.
*/
double
sum()
sum() const
{
__m128d t1 = _mm_unpackhi_pd(data, data);
__m128d t2 = _mm_add_pd(data, t1);
Expand Down Expand Up @@ -1673,7 +1673,7 @@ class VectorizedArray<float, 4>
* this->data[i]$.
*/
float
sum()
sum() const
{
__m128 t1 = _mm_movehl_ps(data, data);
__m128 t2 = _mm_add_ps(data, t1);
Expand Down Expand Up @@ -2217,7 +2217,7 @@ class VectorizedArray<double, 4>
* this->data[i]$.
*/
double
sum()
sum() const
{
VectorizedArray<double, 2> t1;
t1.data = _mm_add_pd(this->get_lower(), this->get_upper());
Expand Down Expand Up @@ -2781,7 +2781,7 @@ class VectorizedArray<float, 8>
* this->data[i]$.
*/
float
sum()
sum() const
{
VectorizedArray<float, 4> t1;
t1.data = _mm_add_ps(this->get_lower(), this->get_upper());
Expand Down Expand Up @@ -3402,7 +3402,7 @@ class VectorizedArray<double, 8>
* this->data[i]$.
*/
double
sum()
sum() const
{
VectorizedArray<double, 4> t1;
t1.data = _mm256_add_pd(this->get_lower(), this->get_upper());
Expand Down Expand Up @@ -4007,7 +4007,7 @@ class VectorizedArray<float, 16>
* this->data[i]$.
*/
float
sum()
sum() const
{
VectorizedArray<float, 8> t1;
t1.data = _mm256_add_ps(this->get_lower(), this->get_upper());
Expand Down