summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-05-15 21:38:19 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2024-05-15 21:38:19 +0000
commitb81bb0cd8827bea66f8a07f440a58218f205fb46 (patch)
treec14543a5cac47dbd833f76d93d5f47491b11f635
parentef6e5edc57653df6ac228de7704dbe4a98b32607 (diff)
Use a valuespace representable by both 8,16,23 and 64 bit floats to easier verify correctness.
-rw-r--r--searchlib/src/tests/tensor/distance_functions/distance_functions_benchmark.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/searchlib/src/tests/tensor/distance_functions/distance_functions_benchmark.cpp b/searchlib/src/tests/tensor/distance_functions/distance_functions_benchmark.cpp
index eb2477bac8e..04a2fa1cf2f 100644
--- a/searchlib/src/tests/tensor/distance_functions/distance_functions_benchmark.cpp
+++ b/searchlib/src/tests/tensor/distance_functions/distance_functions_benchmark.cpp
@@ -58,12 +58,12 @@ void benchmark(size_t iterations, size_t elems) __attribute_noinline__;
template<typename T>
void benchmark(size_t iterations, size_t elems, const DistanceFunctionFactory & df) {
std::vector<T> av, bv;
- srand(7);
+ srandom(7);
av.reserve(elems);
bv.reserve(elems);
for (size_t i(0); i < elems; i++) {
- av.push_back(rand());
- bv.push_back(rand());
+ av.push_back(random()%128);
+ bv.push_back(random()%128);
}
TypedCells a_cells(av), b_cells(bv);