MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / run

Method run

tests/framework/Framework.cpp:596–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

594}
595
596bool Framework::run()
597{
598 // Clear old test results
599 _test_results.clear();
600
601 if (_log_level >= LogLevel::TESTS)
602 {
603 func_on_all_printers([](Printer *p) { p->print_run_header(); });
604 }
605
606 const std::chrono::time_point<std::chrono::high_resolution_clock> start = std::chrono::high_resolution_clock::now();
607
608 int id = 0;
609 int id_run_test = 0;
610 ARM_COMPUTE_UNUSED(id_run_test); // Not used if ARM_COMPUTE_CL is not defined
611
612 for (auto &test_factory : _test_factories)
613 {
614 const std::string test_case_name = test_factory->name();
615 const TestInfo test_info{id, test_case_name, test_factory->mode(), test_factory->status()};
616
617 if (_test_filter->is_selected(test_info))
618 {
619#ifdef ARM_COMPUTE_CL
620 // Every 100 tests, reset the OpenCL context to release the allocated memory
621 if (opencl_is_available() && (id_run_test % 100) == 0)
622 {
623 auto ctx_properties = CLScheduler::get().context().getInfo<CL_CONTEXT_PROPERTIES>(nullptr);
624 auto queue_properties = CLScheduler::get().queue().getInfo<CL_QUEUE_PROPERTIES>(nullptr);
625
626 cl::Context new_ctx = cl::Context(CL_DEVICE_TYPE_DEFAULT, ctx_properties.data());
627 cl::CommandQueue new_queue =
628 cl::CommandQueue(new_ctx, CLKernelLibrary::get().get_device(), queue_properties);
629
630 CLKernelLibrary::get().clear_programs_cache();
631 CLScheduler::get().set_context(new_ctx);
632 CLScheduler::get().set_queue(new_queue);
633 }
634#endif // ARM_COMPUTE_CL
635 TestResult::Status result = run_test(test_info, *test_factory);
636 if ((_print_rerun_cmd) && (result == TestResult::Status::CRASHED || result == TestResult::Status::FAILED))
637 {
638 std::cout << "Rerun command: ./arm_compute_validation --filter='^" << test_info.name
639 << "$' --seed=" << _seed << std::endl;
640 }
641 ++id_run_test;
642
643 // Run test delay
644 sleep_in_seconds(_cooldown_sec);
645 }
646
647 ++id;
648 }
649
650 const std::chrono::time_point<std::chrono::high_resolution_clock> end = std::chrono::high_resolution_clock::now();
651
652 if (_log_level >= LogLevel::TESTS)
653 {

Callers 1

mainFunction · 0.45

Calls 15

opencl_is_availableFunction · 0.85
sleep_in_secondsFunction · 0.85
is_selectedMethod · 0.80
contextMethod · 0.80
set_queueMethod · 0.80
ContextClass · 0.50
CommandQueueClass · 0.50
clearMethod · 0.45
print_run_headerMethod · 0.45
nameMethod · 0.45
modeMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected