mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 11:45:30 +08:00
Added an option to print available implementation variants.
This commit is contained in:
parent
b581f27249
commit
7a104d2793
@ -646,6 +646,7 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
|
|||||||
"{ |perf_verify_sanity |false |fail tests having no regression data for sanity checks}"
|
"{ |perf_verify_sanity |false |fail tests having no regression data for sanity checks}"
|
||||||
"{ |perf_impl |" + available_impls[0] +
|
"{ |perf_impl |" + available_impls[0] +
|
||||||
"|the implementation variant of functions under test}"
|
"|the implementation variant of functions under test}"
|
||||||
|
"{ |perf_list_impls |false |list available implementation variants and exit}"
|
||||||
"{ |perf_run_cpu |false |deprecated, equivalent to --perf_impl=plain}"
|
"{ |perf_run_cpu |false |deprecated, equivalent to --perf_impl=plain}"
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
"{ |perf_time_limit |6.0 |default time limit for a single test (in seconds)}"
|
"{ |perf_time_limit |6.0 |default time limit for a single test (in seconds)}"
|
||||||
@ -687,6 +688,19 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
|
|||||||
log_power_checkpoints = args.get<bool>("perf_log_power_checkpoints");
|
log_power_checkpoints = args.get<bool>("perf_log_power_checkpoints");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool param_list_impls = args.get<bool>("perf_list_impls");
|
||||||
|
|
||||||
|
if (param_list_impls)
|
||||||
|
{
|
||||||
|
fputs("Available implementation variants:", stdout);
|
||||||
|
for (size_t i = 0; i < available_impls.size(); ++i) {
|
||||||
|
putchar(' ');
|
||||||
|
fputs(available_impls[i].c_str(), stdout);
|
||||||
|
}
|
||||||
|
putchar('\n');
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (std::find(available_impls.begin(), available_impls.end(), param_impl) == available_impls.end())
|
if (std::find(available_impls.begin(), available_impls.end(), param_impl) == available_impls.end())
|
||||||
{
|
{
|
||||||
printf("No such implementation: %s\n", param_impl.c_str());
|
printf("No such implementation: %s\n", param_impl.c_str());
|
||||||
|
Loading…
Reference in New Issue
Block a user