diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2021-04-12 17:34:33 +0100 |
---|---|---|
committer | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2021-04-16 11:49:52 +0000 |
commit | 379549191246f7742d8175edd88d8cff8de3feda (patch) | |
tree | f7fb4586307c56f4c13375ec02c03e73049aadbd /src/core/CL/gemm/native/CLGEMMDefaultConfigNativeValhall.cpp | |
parent | ebbb6f9e2735f903a4cb75c23ab7c80797079c25 (diff) | |
download | ComputeLibrary-379549191246f7742d8175edd88d8cff8de3feda.tar.gz |
Add GEMM heuristic for Mali-G78
- Replace std::map with a basic container with std::array
Change-Id: I76f53ca61676ca0e5136ce61a3f3adb10e22b4c3
Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5441
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/gemm/native/CLGEMMDefaultConfigNativeValhall.cpp')
-rw-r--r-- | src/core/CL/gemm/native/CLGEMMDefaultConfigNativeValhall.cpp | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/src/core/CL/gemm/native/CLGEMMDefaultConfigNativeValhall.cpp b/src/core/CL/gemm/native/CLGEMMDefaultConfigNativeValhall.cpp index ab5aa11bf8..3b55be747f 100644 --- a/src/core/CL/gemm/native/CLGEMMDefaultConfigNativeValhall.cpp +++ b/src/core/CL/gemm/native/CLGEMMDefaultConfigNativeValhall.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Arm Limited. + * Copyright (c) 2020-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -28,7 +28,6 @@ #include "arm_compute/core/GPUTarget.h" #include "src/core/CL/gemm/CLGEMMHelpers.h" -#include <map> #include <utility> namespace arm_compute @@ -45,30 +44,13 @@ std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> CLGEMMDefaultConfigNativeValhall using ConfigurationFunctionExecutorPtr = std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> (CLGEMMDefaultConfigNativeValhall::*)(unsigned int m, unsigned int n, unsigned int k, unsigned int b); - // Configurations for Mali-G77 - static std::map<DataType, ConfigurationFunctionExecutorPtr> gemm_configs_G77 = - { - { DataType::F32, &CLGEMMDefaultConfigNativeValhall::configure_G77_f32 }, - { DataType::F16, &CLGEMMDefaultConfigNativeValhall::configure_G77_f16 }, - { DataType::QASYMM8, &CLGEMMDefaultConfigNativeValhall::configure_G77_u8 }, - { DataType::QSYMM8, &CLGEMMDefaultConfigNativeValhall::configure_G77_u8 }, - { DataType::QASYMM8_SIGNED, &CLGEMMDefaultConfigNativeValhall::configure_G77_u8 }, - { DataType::QSYMM8_PER_CHANNEL, &CLGEMMDefaultConfigNativeValhall::configure_G77_u8 } - }; + CLGEMMConfigArray<ConfigurationFunctionExecutorPtr> configs_default(&CLGEMMDefaultConfigNativeValhall::configure_G77_f32, + &CLGEMMDefaultConfigNativeValhall::configure_G77_f16, + &CLGEMMDefaultConfigNativeValhall::configure_G77_u8); - switch(_target) - { - case GPUTarget::G77: - default: - if(gemm_configs_G77.find(data_type) != gemm_configs_G77.end()) - { - return (this->*gemm_configs_G77[data_type])(m, n, k, b); - } - else - { - ARM_COMPUTE_ERROR("Not supported data type"); - } - } + auto func = configs_default.get_function(data_type); + ARM_COMPUTE_ERROR_ON_MSG(func == nullptr, "Data type not support for GEMM"); + return (this->*func)(m, n, k, b); } std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> CLGEMMDefaultConfigNativeValhall::configure_G77_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b) |