diff options
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/tests/dotproduct/dotproductbenchmark.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vespalib/src/tests/dotproduct/dotproductbenchmark.cpp b/vespalib/src/tests/dotproduct/dotproductbenchmark.cpp index e95e8a5c58b..5d7817bc59b 100644 --- a/vespalib/src/tests/dotproduct/dotproductbenchmark.cpp +++ b/vespalib/src/tests/dotproduct/dotproductbenchmark.cpp @@ -5,6 +5,7 @@ #include <iostream> #include <vector> #include <thread> +#include <functional> using namespace vespalib; using vespalib::hwaccelrated::IAccelrated; @@ -106,6 +107,8 @@ SparseBenchmark::SparseBenchmark(size_t numDocs, size_t numValues, size_t numQue } SparseBenchmark::~SparseBenchmark() = default; +std::function<void(int)> use_sum = [](int) noexcept { }; + class UnorderedSparseBenchmark : public SparseBenchmark { private: @@ -124,6 +127,7 @@ private: sum += static_cast<int64_t>(_values[offset + i]._value) * it->second; } } + use_sum(sum); } map _query; }; @@ -154,6 +158,7 @@ private: sum += static_cast<int64_t>(_values[offset + b]._value) * _query[a]._value; } } + use_sum(sum); } std::vector<P> _query; }; |