aboutsummaryrefslogtreecommitdiff
path: root/tests/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/main.cpp')
-rw-r--r--tests/main.cpp40
1 files changed, 28 insertions, 12 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index cecd89bdb7..e862c7627e 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2021 Arm Limited.
+ * Copyright (c) 2017-2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
+#include "arm_compute/core/Version.h"
#include "support/StringSupport.h"
#include "tests/AssetsLibrary.h"
#include "tests/framework/DatasetModes.h"
@@ -45,6 +46,7 @@
#include "utils/TypePrinter.h"
#endif /* ARM_COMPUTE_CL */
#include "arm_compute/runtime/Scheduler.h"
+#include "src/common/cpuinfo/CpuModel.h"
#include <fstream>
#include <initializer_list>
@@ -115,7 +117,7 @@ int main(int argc, char **argv)
auto filter_id = parser.add_option<utils::SimpleOption<std::string>>("filter-id");
filter_id->set_help("List of test ids. ... can be used to define a range.");
auto stop_on_error = parser.add_option<utils::ToggleOption>("stop-on-error");
- stop_on_error->set_help("Abort execution after the first failed test (useful for debugging)");
+ stop_on_error->set_help("Stop execution after the first failed test (useful for debugging)");
auto seed = parser.add_option<utils::SimpleOption<std::random_device::result_type>>("seed", std::random_device()());
seed->set_help("Global seed for random number generation");
auto list_tests = parser.add_option<utils::ToggleOption>("list-tests", false);
@@ -126,6 +128,8 @@ int main(int argc, char **argv)
error_on_missing_assets->set_help("Mark a test as failed instead of skipping it when assets are missing");
auto assets = parser.add_positional_option<utils::SimpleOption<std::string>>("assets");
assets->set_help("Path to the assets directory");
+ auto print_rerun_command = parser.add_option<utils::ToggleOption>("rerun-cmd");
+ print_rerun_command->set_help("Print out the command to rerun the exact failed testcase");
#ifdef ARM_COMPUTE_CL
auto enable_tuner = parser.add_option<utils::ToggleOption>("enable-tuner");
enable_tuner->set_help("Enable OpenCL dynamic tuner");
@@ -183,7 +187,7 @@ int main(int argc, char **argv)
CLGEMMHeuristicsHandle gemm_heuristics;
if(opencl_is_available())
{
- auto ctx_dev_err = create_opencl_context_and_device();
+ auto ctx_dev_err = create_opencl_context_and_device(CLBackendType::Native);
ARM_COMPUTE_ERROR_ON_MSG(std::get<2>(ctx_dev_err) != CL_SUCCESS, "Failed to create OpenCL context");
gemm_heuristics.reload_from_file(mlgo_file->value());
CLScheduler::get().default_init_with_context(std::get<1>(ctx_dev_err), std::get<0>(ctx_dev_err), &cl_tuner, &gemm_heuristics);
@@ -235,13 +239,23 @@ int main(int argc, char **argv)
#endif /* ARM_COMPUTE_CL */
const arm_compute::CPUInfo &cpu_info = Scheduler::get().cpu_info();
const unsigned int num_cpus = cpu_info.get_cpu_num();
+
+ p->print_entry("cpu_has_sve", support::cpp11::to_string(cpu_info.has_sve()));
+ p->print_entry("cpu_has_sve2", support::cpp11::to_string(cpu_info.has_sve2()));
+ p->print_entry("cpu_has_svef32mm", support::cpp11::to_string(cpu_info.has_svef32mm()));
+ p->print_entry("cpu_has_svei8mm", support::cpp11::to_string(cpu_info.has_svei8mm()));
+ p->print_entry("cpu_has_svebf16", support::cpp11::to_string(cpu_info.has_svebf16()));
+ p->print_entry("cpu_has_sme", support::cpp11::to_string(cpu_info.has_sme()));
+ p->print_entry("cpu_has_sme2", support::cpp11::to_string(cpu_info.has_sme2()));
p->print_entry("cpu_has_fp16", support::cpp11::to_string(cpu_info.has_fp16()));
+ p->print_entry("cpu_has_bf16", support::cpp11::to_string(cpu_info.has_bf16()));
p->print_entry("cpu_has_dotprod", support::cpp11::to_string(cpu_info.has_dotprod()));
+ p->print_entry("cpu_has_i8mm", support::cpp11::to_string(cpu_info.has_i8mm()));
for(unsigned int j = 0; j < num_cpus; ++j)
{
const CPUModel model = cpu_info.get_cpu_model(j);
- p->print_entry("CPU" + support::cpp11::to_string(j), cpu_model_to_string(model));
+ p->print_entry("CPU" + support::cpp11::to_string(j), cpuinfo::cpu_model_to_string(model));
}
p->print_entry("Iterations", support::cpp11::to_string(options.iterations->value()));
p->print_entry("Threads", support::cpp11::to_string(threads->value()));
@@ -259,14 +273,16 @@ int main(int argc, char **argv)
// Initialize framework
framework::FrameworkConfig fconfig;
- fconfig.instruments = options.instruments->value();
- fconfig.name_filter = filter->value();
- fconfig.id_filter = filter_id->value();
- fconfig.num_iterations = options.iterations->value();
- fconfig.mode = dataset_mode->value();
- fconfig.log_level = options.log_level->value();
- fconfig.cooldown_sec = cooldown_sec->value();
- fconfig.configure_only = configure_only->value();
+ fconfig.instruments = options.instruments->value();
+ fconfig.name_filter = filter->value();
+ fconfig.id_filter = filter_id->value();
+ fconfig.num_iterations = options.iterations->value();
+ fconfig.mode = dataset_mode->value();
+ fconfig.log_level = options.log_level->value();
+ fconfig.cooldown_sec = cooldown_sec->value();
+ fconfig.configure_only = configure_only->value();
+ fconfig.print_rerun_cmd = print_rerun_command->value();
+ fconfig.seed = seed->value();
framework.init(fconfig);
for(auto &p : printers)