We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c32b15c commit 15d3c89Copy full SHA for 15d3c89
benchmarks/gbench/common/distributed_vector.cpp
@@ -152,9 +152,10 @@ DR_BENCHMARK(Copy_Serial);
152
T fill = 100;
153
void check_reduce(T actual) {
154
if (comm_rank == 0) {
155
- std::vector<T> local_src(default_vector_size, fill);
156
- auto ref = std::reduce(local_src.begin(), local_src.end());
157
-
+ // Don't call std::reduce on big vectors, result is wrong due to adding
+ // small float to big one. E.g. adding 80M values of 100 results
+ // in 8.58993e+09
158
+ const T ref = fill * default_vector_size;
159
if ((ref - actual) / ref > .001) {
160
fmt::print("Mismatch:\n Ref {} Actual {}\n", ref, actual);
161
exit(1);
0 commit comments