miniBUDE
miniBUDE copied to clipboard
CUDA version: Issue with "best gflop/s" if the validation fails for some sizes
This is for the CUDA version. If the CUDA kernel launch fails, the results will fail validation but still be included in the results, so the "best gflop/s" will be too big since the kernel time was very fast since it failed.
One option to avoid this is the following, which if the validation fails, sets the kernel time to the biggest possible, so that it will not mess up the computation of "best" gflop/s. There are probably cleaner ways, this is just what I was using to get it working.
diff --git a/src/main.cpp b/src/main.cpp
index 32b01be..0eba5e7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -388,9 +388,11 @@ std::pair<double, std::vector<size_t>> validate(const Sample &sample, const Para
}
// flush at the end to make sure errors are clumped together
std::cerr << std::flush;
+ return {valid, maxDiffPct, s, SummaryStats<double>({ std::numeric_limits<double>::max() }), 0, 0, 0};
}
-
- return {valid, maxDiffPct, s, SummaryStats<double>(msWithoutWarmup), gflops, gfinsts, interactions_per_sec};
+ else {
+ return {valid, maxDiffPct, s, SummaryStats<double>(msWithoutWarmup), gflops, gfinsts, interactions_per_sec};
+ }
}