From db4a6c15e55aaffbe555c33f3e10795d822701e7 Mon Sep 17 00:00:00 2001 From: SiCong Li Date: Fri, 5 Feb 2021 09:30:57 +0000 Subject: Integrate MLGO into CLGEMM and CLGEMMLowpMatrixMultiplyCore: Part2 * Associate CLScheduler with CLGEMMHeuristicsHandle * Add option in arm_compute_validation for mlgo file path * Extend logging for the selection of gemm configurations Resolves: COMPMID-3843, COMPMID-3844 Signed-off-by: SiCong Li Change-Id: I869c3a4122414ae6a7bbd721966c1da37621ca11 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5002 Tested-by: Arm Jenkins Reviewed-by: Manuel Bottini Reviewed-by: Gian Marco Iodice Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins --- tests/main.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/main.cpp') diff --git a/tests/main.cpp b/tests/main.cpp index 46a081b6c8..ff641c0762 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -38,6 +38,7 @@ #ifdef ARM_COMPUTE_CL #include "arm_compute/core/CL/OpenCL.h" +#include "arm_compute/runtime/CL/CLGEMMHeuristicsHandle.h" #include "arm_compute/runtime/CL/CLHelpers.h" #include "arm_compute/runtime/CL/CLScheduler.h" #include "arm_compute/runtime/CL/CLTuner.h" @@ -143,6 +144,9 @@ int main(int argc, char **argv) auto tuner_file = parser.add_option>("tuner-file", ""); tuner_file->set_help("File to load/save CLTuner values"); + + auto mlgo_file = parser.add_option>("mlgo-file", ""); + mlgo_file->set_help("File to load MLGO heuristics"); #endif /* ARM_COMPUTE_CL */ auto threads = parser.add_option>("threads", 1); threads->set_help("Number of threads to use"); @@ -190,12 +194,14 @@ int main(int argc, char **argv) #endif /* ARM_COMPUTE_GC */ #ifdef ARM_COMPUTE_CL - CLTuner cl_tuner(false); + CLTuner cl_tuner(false); + CLGEMMHeuristicsHandle gemm_heuristics; if(opencl_is_available()) { auto ctx_dev_err = create_opencl_context_and_device(); ARM_COMPUTE_ERROR_ON_MSG(std::get<2>(ctx_dev_err) != CL_SUCCESS, "Failed to create OpenCL context"); - CLScheduler::get().default_init_with_context(std::get<1>(ctx_dev_err), std::get<0>(ctx_dev_err), &cl_tuner); + 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); } if(enable_tuner->is_set()) -- cgit v1.2.1