Skip to content

Commit 9b167b6

Browse files
committed
Various minor improvements
1 parent b61b50a commit 9b167b6

4 files changed

Lines changed: 67 additions & 60 deletions

File tree

GPU/GPUbenchmark/Shared/Utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ struct benchmarkOpts {
7575
float freeMemoryFractionToAllocate = 0.95f;
7676
int kernelLaunches = 1;
7777
int nTests = 1;
78+
std::string outFileName = "benchmark_result";
7879
};
7980

8081
template <class T>

GPU/GPUbenchmark/benchmark.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ bool parseArgs(o2::benchmark::benchmarkOpts& conf, int argc, const char* argv[])
2828
"chunkSize,c", bpo::value<float>()->default_value(1.f), "Size of scratch partitions (GB).")(
2929
"freeMemFraction,f", bpo::value<float>()->default_value(0.95f), "Fraction of free memory to be allocated (min: 0.f, max: 1.f).")(
3030
"launches,l", bpo::value<int>()->default_value(10), "Number of iterations in reading kernels.")(
31-
"nruns,n", bpo::value<int>()->default_value(1), "Number of times each test is run.");
31+
"nruns,n", bpo::value<int>()->default_value(1), "Number of times each test is run.")(
32+
"outfile,o", bpo::value<std::string>()->default_value("benchmark_result"), "Output file name to store results.");
3233
try {
3334
bpo::store(parse_command_line(argc, argv, options), vm);
3435
if (vm.count("help")) {
@@ -89,6 +90,8 @@ bool parseArgs(o2::benchmark::benchmarkOpts& conf, int argc, const char* argv[])
8990
}
9091
}
9192

93+
conf.outFileName = vm["outfile"].as<std::string>();
94+
9295
return true;
9396
}
9497

@@ -103,7 +106,7 @@ int main(int argc, const char* argv[])
103106
return -1;
104107
}
105108

106-
std::shared_ptr<ResultWriter> writer = std::make_shared<ResultWriter>(std::to_string(opts.deviceId) + "_benchmark_results.root");
109+
std::shared_ptr<ResultWriter> writer = std::make_shared<ResultWriter>(std::to_string(opts.deviceId) + "_" + opts.outFileName + ".root");
107110

108111
o2::benchmark::GPUbenchmark<char> bm_char{opts, writer};
109112
bm_char.run();

0 commit comments

Comments
 (0)