From ca419dde35118fcfe07fa0a5ce388c0a40b75c49 Mon Sep 17 00:00:00 2001 From: Gian Marco Iodice Date: Wed, 3 Mar 2021 17:25:07 +0000 Subject: Add tuner mode support in GeMM benchmark Change-Id: Ie1ad9880d22daa2a8ee4f239b5b23d3a7ba4cb1b Signed-off-by: Gian Marco Iodice Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5210 Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas Reviewed-by: SiCong Li --- examples/gemm_tuner/CommonGemmExampleOptions.cpp | 29 +++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'examples/gemm_tuner/CommonGemmExampleOptions.cpp') diff --git a/examples/gemm_tuner/CommonGemmExampleOptions.cpp b/examples/gemm_tuner/CommonGemmExampleOptions.cpp index 440973737c..f1306ccf5c 100644 --- a/examples/gemm_tuner/CommonGemmExampleOptions.cpp +++ b/examples/gemm_tuner/CommonGemmExampleOptions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -35,6 +35,7 @@ using namespace utils; os << "K : " << common_params.K << std::endl; os << "B : " << common_params.B << std::endl; os << "Data type : " << common_params.data_type << std::endl; + os << "OpenCL tuner mode : " << common_params.tuner_mode << std::endl; return os; } @@ -44,7 +45,8 @@ CommonGemmExampleOptions::CommonGemmExampleOptions(CommandLineParser &parser, Da N(parser.add_positional_option>("N", 100)), K(parser.add_positional_option>("K", 50)), B(parser.add_positional_option>("B", 1)), - data_type() + data_type(), + tuner_mode() { const std::set supported_data_types { @@ -52,9 +54,18 @@ CommonGemmExampleOptions::CommonGemmExampleOptions(CommandLineParser &parser, Da DataType::F32, DataType::QASYMM8, }; + + const std::set supported_tuner_modes + { + CLTunerMode::EXHAUSTIVE, + CLTunerMode::NORMAL, + CLTunerMode::RAPID + }; + ARM_COMPUTE_ERROR_ON_MSG(supported_data_types.find(default_data_type) == supported_data_types.end(), "Default data type unsupported"); - data_type = parser.add_option>("type", supported_data_types, default_data_type); + data_type = parser.add_option>("type", supported_data_types, default_data_type); + tuner_mode = parser.add_option>("tuner-mode", supported_tuner_modes, CLTunerMode::RAPID); help->set_help("Show this help message."); M->set_help("Number of lhs matrix rows."); @@ -62,16 +73,18 @@ CommonGemmExampleOptions::CommonGemmExampleOptions(CommandLineParser &parser, Da K->set_help("Number of lhs matrix columns/rhs matrix rows."); B->set_help("Batch size."); data_type->set_help("Data type to use"); + tuner_mode->set_help("OpenCL tuner mode"); } CommonGemmExampleParams consume_common_gemm_example_parameters(const CommonGemmExampleOptions &options) { CommonGemmExampleParams common_params; - common_params.M = options.M->value(); - common_params.N = options.N->value(); - common_params.K = options.K->value(); - common_params.B = options.B->value(); - common_params.data_type = options.data_type->value(); + common_params.M = options.M->value(); + common_params.N = options.N->value(); + common_params.K = options.K->value(); + common_params.B = options.B->value(); + common_params.data_type = options.data_type->value(); + common_params.tuner_mode = options.tuner_mode->value(); return common_params; } } // namespace gemm_tuner -- cgit v1.2.1