EXSWHTEC-231 - Implement custom Benchmarking tool for Performance tests (#117)
- Introduce performance tests to project. - Improve benchmarking utilities. - Delete copy constructors from Timer and Benchmark classes. - Disable Catch2's benchmarking functionalities. - Address review comments and add progress bar/display output to the Benchmarking tool - Add flushing of the buffer on the benchmark name display - Introduce command line options. - Add allocation type to string helper function. - Add output modifier to Benchmark class. - Fix invalid calculation of deviation - Update performance_common.hh - Resolve build error on Windows by adding include for reduce and accumulate
This commit is contained in:
committed by
GitHub
orang tua
ad9f036f1d
melakukan
5fbbdcae68
@@ -1,7 +1,10 @@
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#include <cmd_options.hh>
|
||||
#include <hip_test_common.hh>
|
||||
#include <iostream>
|
||||
|
||||
CmdOptions cmd_options;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
auto& context = TestContext::get(argc, argv);
|
||||
if (context.skipTest()) {
|
||||
@@ -9,8 +12,33 @@ int main(int argc, char** argv) {
|
||||
std::cout << "HIP_SKIP_THIS_TEST" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
int out = Catch::Session().run(argc, argv);
|
||||
|
||||
Catch::Session session;
|
||||
|
||||
using namespace Catch::clara;
|
||||
// clang-format off
|
||||
auto cli = session.cli()
|
||||
| Opt(cmd_options.iterations, "iterations")
|
||||
["-I"]["--iterations"]
|
||||
("Number of iterations used for performance tests (default: 1000)")
|
||||
| Opt(cmd_options.warmups, "warmups")
|
||||
["-W"]["--warmups"]
|
||||
("Number of warmup iterations used for performance tests (default: 100)")
|
||||
| Opt(cmd_options.no_display)
|
||||
["-S"]["--no-display"]
|
||||
("Do not display the output of performance tests")
|
||||
| Opt(cmd_options.progress)
|
||||
["-P"]["--progress"]
|
||||
("Show progress bar when running performance tests")
|
||||
| Opt(cmd_options.extended_run)
|
||||
["-E"]["--extended-run"]
|
||||
("TODO: Description goes here")
|
||||
;
|
||||
// clang-format on
|
||||
|
||||
session.cli(cli);
|
||||
|
||||
int out = session.run(argc, argv);
|
||||
TestContext::get().cleanContext();
|
||||
return out;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user