| 619 | }; |
| 620 | |
| 621 | int main(int argc, char* argv[]) |
| 622 | { |
| 623 | double time_start = timer.getRealTime(); |
| 624 | cout.precision(4); |
| 625 | cerr.precision(4); |
| 626 | |
| 627 | vector<unique_ptr<action_t>> available_actions; |
| 628 | available_actions.emplace_back(new measure_all_pot_sizes_action_t); |
| 629 | available_actions.emplace_back(new measure_default_sizes_action_t); |
| 630 | |
| 631 | auto action = available_actions.end(); |
| 632 | |
| 633 | if (argc <= 1) { |
| 634 | show_usage_and_exit(argc, argv, available_actions); |
| 635 | } |
| 636 | for (auto it = available_actions.begin(); it != available_actions.end(); ++it) { |
| 637 | if (!strcmp(argv[1], (*it)->invokation_name())) { |
| 638 | action = it; |
| 639 | break; |
| 640 | } |
| 641 | } |
| 642 | |
| 643 | if (action == available_actions.end()) { |
| 644 | show_usage_and_exit(argc, argv, available_actions); |
| 645 | } |
| 646 | |
| 647 | for (int i = 2; i < argc; i++) { |
| 648 | if (argv[i] == strstr(argv[i], "--min-working-set-size=")) { |
| 649 | const char* equals_sign = strchr(argv[i], '='); |
| 650 | min_working_set_size = strtoul(equals_sign+1, nullptr, 10); |
| 651 | } else { |
| 652 | cerr << "unrecognized option: " << argv[i] << endl << endl; |
| 653 | show_usage_and_exit(argc, argv, available_actions); |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | print_cpuinfo(); |
| 658 | |
| 659 | cout << "benchmark parameters:" << endl; |
| 660 | cout << "pointer size: " << 8*sizeof(void*) << " bits" << endl; |
| 661 | cout << "scalar type: " << type_name<Scalar>() << endl; |
| 662 | cout << "packet size: " << internal::packet_traits<MatrixType::Scalar>::size << endl; |
| 663 | cout << "minsize = " << minsize << endl; |
| 664 | cout << "maxsize = " << maxsize << endl; |
| 665 | cout << "measurement_repetitions = " << measurement_repetitions << endl; |
| 666 | cout << "min_accurate_time = " << min_accurate_time << endl; |
| 667 | cout << "min_working_set_size = " << min_working_set_size; |
| 668 | if (min_working_set_size == 0) { |
| 669 | cout << " (try to outsize caches)"; |
| 670 | } |
| 671 | cout << endl << endl; |
| 672 | |
| 673 | (*action)->run(); |
| 674 | |
| 675 | double time_end = timer.getRealTime(); |
| 676 | cerr << "Finished in " << human_duration_t(time_end - time_start) << endl; |
| 677 | } |
nothing calls this directly
no test coverage detected