aboutsummaryrefslogtreecommitdiff
path: root/tests/main.cpp
diff options
context:
space:
mode:
authorSiCong Li <sicong.li@arm.com>2021-02-05 09:30:57 +0000
committerSiCong Li <sicong.li@arm.com>2021-02-09 11:59:33 +0000
commitdb4a6c15e55aaffbe555c33f3e10795d822701e7 (patch)
tree8c2aeddf0e71a92263735a26c44d0a0377f1381c /tests/main.cpp
parentf5aad5166e430819ce8592e0e322d084c4b69d91 (diff)
downloadComputeLibrary-db4a6c15e55aaffbe555c33f3e10795d822701e7.tar.gz
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 <sicong.li@arm.com> Change-Id: I869c3a4122414ae6a7bbd721966c1da37621ca11 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5002 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Manuel Bottini <manuel.bottini@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/main.cpp')
-rw-r--r--tests/main.cpp12
1 files changed, 9 insertions, 3 deletions
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<utils::SimpleOption<std::string>>("tuner-file", "");
tuner_file->set_help("File to load/save CLTuner values");
+
+ auto mlgo_file = parser.add_option<utils::SimpleOption<std::string>>("mlgo-file", "");
+ mlgo_file->set_help("File to load MLGO heuristics");
#endif /* ARM_COMPUTE_CL */
auto threads = parser.add_option<utils::SimpleOption<int>>("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())