diff --git a/src/utils/ReproductibleSumUtils.hpp b/src/utils/ReproductibleSumUtils.hpp index 4b41980ccfb94e7705a83e201379e4dd16660e88..bab97230ec500dd8a58eb2c0d5058ac1a1a80a59 100644 --- a/src/utils/ReproductibleSumUtils.hpp +++ b/src/utils/ReproductibleSumUtils.hpp @@ -68,7 +68,7 @@ ufp(const DataType& x) noexcept(NO_ASSERT) // Useful bits per bin template <typename DataType> -constexpr inline size_t bin_size; +constexpr inline size_t bin_size = 0; template <> constexpr inline size_t bin_size<double> = 40; template <> @@ -76,15 +76,15 @@ constexpr inline size_t bin_size<float> = 12; // IEEE 754 epsilon template <typename DataType> -constexpr inline double bin_epsilon; +constexpr inline double bin_epsilon = 0; template <> -constexpr inline double bin_epsilon<double> = std::pow(2., -53); +constexpr inline double bin_epsilon<double> = 1.11022302462516e-16; // std::pow(2., -53) template <> -constexpr inline double bin_epsilon<float> = std::pow(2., -24); +constexpr inline double bin_epsilon<float> = 5.96046447753906e-08; // std::pow(2., -24) // number of bins: improves precision template <typename DataType> -constexpr inline size_t bin_number; +constexpr inline size_t bin_number = 0; template <> constexpr inline size_t bin_number<double> = 3; @@ -93,7 +93,7 @@ constexpr inline size_t bin_number<float> = 4; // max local sum size to avoid overflow template <typename DataType> -constexpr inline size_t bin_max_size; +constexpr inline size_t bin_max_size = 0; template <> constexpr inline size_t bin_max_size<double> = 2048; diff --git a/tests/test_Array.cpp b/tests/test_Array.cpp index fb3a50ef9ec02bd3a98d5d7b5af95be8bbb9b439..ff12fa0af4b211067d32fa71c9cfc85232aeb370 100644 --- a/tests/test_Array.cpp +++ b/tests/test_Array.cpp @@ -357,22 +357,8 @@ TEST_CASE("Array", "[utils]") ReproductibleTinyVectorSum s0(array); - auto bin0 = s0.getSummationBin(); - std::clog << "S0 = " << bin0.S[0] << ";" << bin0.S[1] << ";" << bin0.S[2] << " C0 = " << bin0.C[0] << ";" - << bin0.C[1] << ";" << bin0.C[2] << "\n"; const auto sum_after_shuffle = sum(array); - ReproductibleTinyVectorSum s1(array); - - auto bin1 = s1.getSummationBin(); - std::clog << "S1 = " << bin1.S[0] << ";" << bin1.S[1] << ";" << bin1.S[2] << " C1 = " << bin1.C[0] << ";" - << bin1.C[1] << ";" << bin1.C[2] << "\n"; - - std::clog << "DIFF_BIN: DS = " << bin1.S[0] - bin0.S[0] << ";" << bin1.S[1] - bin0.S[1] << ";" - << bin1.S[1] - bin0.S[2] << '\n'; - - std::clog << "DIFF=" << sum_before_shuffle - sum_after_shuffle << '\n'; - REQUIRE(sum_before_shuffle == sum_after_shuffle); }