From 904772b275e8761f6e779b85a1ed9c68d81cfc97 Mon Sep 17 00:00:00 2001 From: Maximilian Bergbauer Date: Wed, 24 May 2023 21:38:09 +0200 Subject: [PATCH] Rename to sum() --- include/deal.II/base/vectorization.h | 50 +++++++++---------- .../deal.II/matrix_free/fe_point_evaluation.h | 4 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index ffe8c130c1..cce9b00d82 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -657,11 +657,11 @@ public: } /** - * Returns horizontal sum of data field. + * Returns sum over entries of data field. */ DEAL_II_ALWAYS_INLINE Number - horizontal_add() + sum() { return data; } @@ -1227,10 +1227,10 @@ public: } /** - * Returns horizontal sum of data field. + * Returns sum over entries of data field. */ double - horizontal_add(); + sum(); /** * Actual data field. To be consistent with the standard layout type and to @@ -1826,10 +1826,10 @@ public: } /** - * Returns horizontal sum of data field. + * Returns sum over entries of data field. */ float - horizontal_add(); + sum(); /** * Actual data field. To be consistent with the standard layout type and to @@ -2530,10 +2530,10 @@ public: } /** - * Returns horizontal sum of data field. + * Returns sum over entries of data field. */ double - horizontal_add(); + sum(); /** * Actual data field. To be consistent with the standard layout type and to @@ -3088,10 +3088,10 @@ public: } /** - * Returns horizontal sum of data field. + * Returns sum over entries of data field. */ float - horizontal_add(); + sum(); /** * Actual data field. To be consistent with the standard layout type and to @@ -3676,10 +3676,10 @@ public: } /** - * Returns horizontal sum of data field. + * Returns sum over entries of data field. */ double - horizontal_add(); + sum(); /** * Actual data field. To be consistent with the standard layout type and to @@ -4138,10 +4138,10 @@ public: } /** - * Returns horizontal sum of data field. + * Returns sum over entries of data field. */ float - horizontal_add(); + sum(); /** * Actual data field. To be consistent with the standard layout type and to @@ -4939,12 +4939,12 @@ private: #endif // DOXYGEN /** - * horizontal_add() functions. + * sum() functions. */ #if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128 && defined(__SSE2__) inline double -VectorizedArray::horizontal_add() +VectorizedArray::sum() { __m128d t1 = _mm_unpackhi_pd(data, data); __m128d t2 = _mm_add_pd(data, t1); @@ -4954,7 +4954,7 @@ VectorizedArray::horizontal_add() inline float -VectorizedArray::horizontal_add() +VectorizedArray::sum() { __m128 t1 = _mm_movehl_ps(data, data); __m128 t2 = _mm_add_ps(data, t1); @@ -4968,21 +4968,21 @@ VectorizedArray::horizontal_add() #if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256 && defined(__AVX__) inline double -VectorizedArray::horizontal_add() +VectorizedArray::sum() { VectorizedArray t1; t1.data = _mm_add_pd(this->get_lower(), this->get_upper()); - return t1.horizontal_add(); + return t1.sum(); } inline float -VectorizedArray::horizontal_add() +VectorizedArray::sum() { VectorizedArray t1; t1.data = _mm_add_ps(this->get_lower(), this->get_upper()); - return t1.horizontal_add(); + return t1.sum(); } #endif @@ -4990,21 +4990,21 @@ VectorizedArray::horizontal_add() #if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512 && defined(__AVX512F__) inline double -VectorizedArray::horizontal_add() +VectorizedArray::sum() { VectorizedArray t1; t1.data = _mm256_add_pd(this->get_lower(), this->get_upper()); - return t1.horizontal_add(); + return t1.sum(); } inline float -VectorizedArray::horizontal_add() +VectorizedArray::sum() { VectorizedArray t1; t1.data = _mm256_add_ps(this->get_lower(), this->get_upper()); - return t1.horizontal_add(); + return t1.sum(); } #endif diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h index cecab550a6..0b13f8b7bd 100644 --- a/include/deal.II/matrix_free/fe_point_evaluation.h +++ b/include/deal.II/matrix_free/fe_point_evaluation.h @@ -2067,7 +2067,7 @@ FEPointEvaluation::finish_integrate_fast( ETT::write_value(vectorized_input, comp, solution_renumbered_vectorized[i]); - input[i] = vectorized_input.horizontal_add(); + input[i] = vectorized_input.sum(); } internal::FEFaceNormalEvaluationImpl:: @@ -2089,7 +2089,7 @@ FEPointEvaluation::finish_integrate_fast( VectorizedArrayType result; ETT::write_value(result, comp, solution_renumbered_vectorized[i]); solution_values[renumber[comp * dofs_per_component + i]] = - result.horizontal_add(); + result.sum(); } } } -- 2.39.5