summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-09-27 21:03:24 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2016-09-27 21:03:24 +0200
commitd59e5c570b0bbdb8348d2f9ee6fc5850e606db27 (patch)
tree603b7f7631c46ec55ede97fd3205affdbc45a169 /src
parentdb5772e521a03602c8f66be95a4dc4d07b83cd84 (diff)
Added an option to run tuned kernels multiple times to average execution times; requires CLTune 2.5.0
Diffstat (limited to 'src')
-rw-r--r--src/tuning/tuning.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tuning/tuning.hpp b/src/tuning/tuning.hpp
index 13bae5a6..8fa93efc 100644
--- a/src/tuning/tuning.hpp
+++ b/src/tuning/tuning.hpp
@@ -46,6 +46,8 @@ void Tuner(int argc, char* argv[]) {
if (o == kArgBeta) { args.beta = GetArgument(argc, argv, help, kArgBeta, GetScalar<T>()); }
if (o == kArgFraction) { args.fraction = GetArgument(argc, argv, help, kArgFraction, C::DefaultFraction()); }
}
+ const auto num_runs = GetArgument(argc, argv, help, kArgNumRuns, size_t{1});
+
fprintf(stdout, "%s\n", help.c_str());
// Tests validity of the given arguments
@@ -127,6 +129,7 @@ void Tuner(int argc, char* argv[]) {
C::SetArguments(tuner, args, x_vec, y_vec, a_mat, b_mat, c_mat, temp);
// Starts the tuning process
+ tuner.SetNumRuns(num_runs);
tuner.Tune();
// Prints the results to screen
@@ -135,7 +138,7 @@ void Tuner(int argc, char* argv[]) {
// Also prints the performance of the best-case in terms of GB/s or GFLOPS
if (time_ms != 0.0) {
- printf("[ -------> ] %.1lf ms", time_ms);
+ printf("[ -------> ] %.2lf ms", time_ms);
printf(" or %.1lf %s\n", C::GetMetric(args)/(time_ms*1.0e6), C::PerformanceUnit().c_str());
}