Skip to content

Commit

Permalink
Merge pull request #15735 from peterrum/sum_const
Browse files Browse the repository at this point in the history
Make VectorizedArray::sum() const
  • Loading branch information
peterrum committed Jul 13, 2023
2 parents 79ac9cf + ee17ee0 commit e6e7e31
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit e6e7e31

Please sign in to comment.