MCPcopy Create free account
hub / github.com/PX4/eigen / main

Function main

bench/benchmark-blocking-sizes.cpp:621–677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619};
620
621int 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}

Callers

nothing calls this directly

Calls 9

print_cpuinfoFunction · 0.85
human_duration_tClass · 0.85
getRealTimeMethod · 0.80
precisionMethod · 0.80
endMethod · 0.80
beginMethod · 0.80
show_usage_and_exitFunction · 0.70
invokation_nameMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected