diff options
Diffstat (limited to 'src/runtime/CL/gemm')
-rw-r--r-- | src/runtime/CL/gemm/CLGEMMDefaultTypeBifrost.cpp (renamed from src/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.cpp) | 84 | ||||
-rw-r--r-- | src/runtime/CL/gemm/CLGEMMDefaultTypeBifrost.h (renamed from src/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.h) | 10 | ||||
-rw-r--r-- | src/runtime/CL/gemm/CLGEMMDefaultTypeMidgard.cpp (renamed from src/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.cpp) | 26 | ||||
-rw-r--r-- | src/runtime/CL/gemm/CLGEMMDefaultTypeMidgard.h (renamed from src/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.h) | 10 | ||||
-rw-r--r-- | src/runtime/CL/gemm/CLGEMMDefaultTypeValhall.cpp (renamed from src/runtime/CL/gemm/CLGEMMKernelSelectionValhall.cpp) | 50 | ||||
-rw-r--r-- | src/runtime/CL/gemm/CLGEMMDefaultTypeValhall.h (renamed from src/runtime/CL/gemm/CLGEMMKernelSelectionValhall.h) | 10 | ||||
-rw-r--r-- | src/runtime/CL/gemm/CLGEMMKernelSelection.h | 12 |
7 files changed, 101 insertions, 101 deletions
diff --git a/src/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.cpp b/src/runtime/CL/gemm/CLGEMMDefaultTypeBifrost.cpp index 0bda38e5e9..5ac25a9a20 100644 --- a/src/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.cpp +++ b/src/runtime/CL/gemm/CLGEMMDefaultTypeBifrost.cpp @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "src/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.h" +#include "src/runtime/CL/gemm/CLGEMMDefaultTypeBifrost.h" #include "arm_compute/core/CL/CLHelpers.h" #include "arm_compute/core/CL/CLKernelLibrary.h" @@ -34,60 +34,60 @@ namespace arm_compute { namespace cl_gemm { -CLGEMMKernelSelectionBifrost::CLGEMMKernelSelectionBifrost(GPUTarget gpu) +CLGEMMDefaultTypeBifrost::CLGEMMDefaultTypeBifrost(GPUTarget gpu) : ICLGEMMKernelSelection(gpu) { } -CLGEMMKernelType CLGEMMKernelSelectionBifrost::select_kernel(const CLGEMMKernelSelectionParams ¶ms) +CLGEMMKernelType CLGEMMDefaultTypeBifrost::select_kernel(const CLGEMMKernelSelectionParams ¶ms) { // _target could be used in the future to have a dedicated heuristic for each GPU IP ARM_COMPUTE_UNUSED(_target); - using FunctionExecutorPtr = CLGEMMKernelType (CLGEMMKernelSelectionBifrost::*)(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); + using FunctionExecutorPtr = CLGEMMKernelType (CLGEMMDefaultTypeBifrost::*)(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); // Default configurations for Bifrost architectures static std::map<DataType, FunctionExecutorPtr> gemm_default_configs = { - { DataType::F32, &CLGEMMKernelSelectionBifrost::default_f32 }, - { DataType::F16, &CLGEMMKernelSelectionBifrost::default_f16 }, - { DataType::QASYMM8, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QASYMM8_SIGNED, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QSYMM8, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QSYMM8_PER_CHANNEL, &CLGEMMKernelSelectionBifrost::default_q8 } + { DataType::F32, &CLGEMMDefaultTypeBifrost::default_f32 }, + { DataType::F16, &CLGEMMDefaultTypeBifrost::default_f16 }, + { DataType::QASYMM8, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QASYMM8_SIGNED, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QSYMM8, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QSYMM8_PER_CHANNEL, &CLGEMMDefaultTypeBifrost::default_q8 } }; // Mali-G71 configurations static std::map<DataType, FunctionExecutorPtr> gemm_g71_configs = { - { DataType::F32, &CLGEMMKernelSelectionBifrost::default_f32 }, - { DataType::F16, &CLGEMMKernelSelectionBifrost::g71_f16 }, - { DataType::QASYMM8, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QASYMM8_SIGNED, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QSYMM8, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QSYMM8_PER_CHANNEL, &CLGEMMKernelSelectionBifrost::default_q8 } + { DataType::F32, &CLGEMMDefaultTypeBifrost::default_f32 }, + { DataType::F16, &CLGEMMDefaultTypeBifrost::g71_f16 }, + { DataType::QASYMM8, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QASYMM8_SIGNED, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QSYMM8, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QSYMM8_PER_CHANNEL, &CLGEMMDefaultTypeBifrost::default_q8 } }; // Mali-G52 configurations static std::map<DataType, FunctionExecutorPtr> gemm_g52_configs = { - { DataType::F32, &CLGEMMKernelSelectionBifrost::g52_f32 }, - { DataType::F16, &CLGEMMKernelSelectionBifrost::g52_f16 }, - { DataType::QASYMM8, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QASYMM8_SIGNED, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QSYMM8, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QSYMM8_PER_CHANNEL, &CLGEMMKernelSelectionBifrost::default_q8 } + { DataType::F32, &CLGEMMDefaultTypeBifrost::g52_f32 }, + { DataType::F16, &CLGEMMDefaultTypeBifrost::g52_f16 }, + { DataType::QASYMM8, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QASYMM8_SIGNED, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QSYMM8, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QSYMM8_PER_CHANNEL, &CLGEMMDefaultTypeBifrost::default_q8 } }; // Mali-G76 configurations static std::map<DataType, FunctionExecutorPtr> gemm_g76_configs = { - { DataType::F32, &CLGEMMKernelSelectionBifrost::g76_f32 }, - { DataType::F16, &CLGEMMKernelSelectionBifrost::g76_f16 }, - { DataType::QASYMM8, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QASYMM8_SIGNED, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QSYMM8, &CLGEMMKernelSelectionBifrost::default_q8 }, - { DataType::QSYMM8_PER_CHANNEL, &CLGEMMKernelSelectionBifrost::default_q8 } + { DataType::F32, &CLGEMMDefaultTypeBifrost::g76_f32 }, + { DataType::F16, &CLGEMMDefaultTypeBifrost::g76_f16 }, + { DataType::QASYMM8, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QASYMM8_SIGNED, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QSYMM8, &CLGEMMDefaultTypeBifrost::default_q8 }, + { DataType::QSYMM8_PER_CHANNEL, &CLGEMMDefaultTypeBifrost::default_q8 } }; const DataType data_type = params.data_type; @@ -121,7 +121,7 @@ CLGEMMKernelType CLGEMMKernelSelectionBifrost::select_kernel(const CLGEMMKernelS } } -CLGEMMKernelType CLGEMMKernelSelectionBifrost::default_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeBifrost::default_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(b); @@ -162,7 +162,7 @@ CLGEMMKernelType CLGEMMKernelSelectionBifrost::default_f32(unsigned int m, unsig return gemm_type; } -CLGEMMKernelType CLGEMMKernelSelectionBifrost::default_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeBifrost::default_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(n, k, b); @@ -183,7 +183,7 @@ CLGEMMKernelType CLGEMMKernelSelectionBifrost::default_f16(unsigned int m, unsig } } -CLGEMMKernelType CLGEMMKernelSelectionBifrost::default_q8(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeBifrost::default_q8(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(m, n, k, b); @@ -197,7 +197,7 @@ CLGEMMKernelType CLGEMMKernelSelectionBifrost::default_q8(unsigned int m, unsign } } -CLGEMMKernelType CLGEMMKernelSelectionBifrost::g76_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeBifrost::g76_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(b); @@ -254,16 +254,16 @@ CLGEMMKernelType CLGEMMKernelSelectionBifrost::g76_f32(unsigned int m, unsigned } } -CLGEMMKernelType CLGEMMKernelSelectionBifrost::g52_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeBifrost::g52_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(b); - if (!is_rhs_constant) + if(!is_rhs_constant) { return CLGEMMKernelType::NATIVE_V1; } - if (m == 1) + if(m == 1) { return CLGEMMKernelType::RESHAPED_ONLY_RHS; } @@ -381,16 +381,16 @@ CLGEMMKernelType CLGEMMKernelSelectionBifrost::g52_f32(unsigned int m, unsigned } } -CLGEMMKernelType CLGEMMKernelSelectionBifrost::g76_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeBifrost::g76_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(b); - if (!is_rhs_constant) + if(!is_rhs_constant) { return CLGEMMKernelType::NATIVE_V1; } - if (m == 1) + if(m == 1) { return CLGEMMKernelType::RESHAPED_ONLY_RHS; } @@ -443,14 +443,14 @@ CLGEMMKernelType CLGEMMKernelSelectionBifrost::g76_f16(unsigned int m, unsigned } } -CLGEMMKernelType CLGEMMKernelSelectionBifrost::g52_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeBifrost::g52_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { - if (!is_rhs_constant) + if(!is_rhs_constant) { return CLGEMMKernelType::NATIVE_V1; } - if (m == 1) + if(m == 1) { return CLGEMMKernelType::RESHAPED_ONLY_RHS; } @@ -556,7 +556,7 @@ CLGEMMKernelType CLGEMMKernelSelectionBifrost::g52_f16(unsigned int m, unsigned } } -CLGEMMKernelType CLGEMMKernelSelectionBifrost::g71_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeBifrost::g71_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(b); diff --git a/src/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.h b/src/runtime/CL/gemm/CLGEMMDefaultTypeBifrost.h index 6831a12aec..0cbab35c2e 100644 --- a/src/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.h +++ b/src/runtime/CL/gemm/CLGEMMDefaultTypeBifrost.h @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef SRC_CLGEMMKERNELSELECTIONBIFROST_H -#define SRC_CLGEMMKERNELSELECTIONBIFROST_H +#ifndef SRC_CLGEMMDEFAULTTYPEBIFROST_H +#define SRC_CLGEMMDEFAULTTYPEBIFROST_H #include "arm_compute/runtime/CL/ICLGEMMKernelSelection.h" @@ -31,14 +31,14 @@ namespace arm_compute namespace cl_gemm { /** Bifrost based OpenCL GEMMKernel selection */ -class CLGEMMKernelSelectionBifrost final : public ICLGEMMKernelSelection +class CLGEMMDefaultTypeBifrost final : public ICLGEMMKernelSelection { public: /** Constructor * * @param[in] gpu GPU target */ - CLGEMMKernelSelectionBifrost(GPUTarget gpu); + CLGEMMDefaultTypeBifrost(GPUTarget gpu); // Inherited overridden method CLGEMMKernelType select_kernel(const CLGEMMKernelSelectionParams ¶ms) override; @@ -55,4 +55,4 @@ private: }; } // namespace cl_gemm } // namespace arm_compute -#endif /* SRC_CLGEMMKERNELSELECTIONBIFROST_H */ +#endif /* SRC_CLGEMMDEFAULTTYPEBIFROST_H */ diff --git a/src/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.cpp b/src/runtime/CL/gemm/CLGEMMDefaultTypeMidgard.cpp index d172a827b5..88b6060e12 100644 --- a/src/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.cpp +++ b/src/runtime/CL/gemm/CLGEMMDefaultTypeMidgard.cpp @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "src/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.h" +#include "src/runtime/CL/gemm/CLGEMMDefaultTypeMidgard.h" #include "arm_compute/core/CL/CLHelpers.h" #include "arm_compute/core/CL/CLKernelLibrary.h" @@ -35,27 +35,27 @@ namespace arm_compute { namespace cl_gemm { -CLGEMMKernelSelectionMidgard::CLGEMMKernelSelectionMidgard(GPUTarget gpu) +CLGEMMDefaultTypeMidgard::CLGEMMDefaultTypeMidgard(GPUTarget gpu) : ICLGEMMKernelSelection(gpu) { } -CLGEMMKernelType CLGEMMKernelSelectionMidgard::select_kernel(const CLGEMMKernelSelectionParams ¶ms) +CLGEMMKernelType CLGEMMDefaultTypeMidgard::select_kernel(const CLGEMMKernelSelectionParams ¶ms) { // _target could be used in the future to have a dedicated heuristic for each GPU IP ARM_COMPUTE_UNUSED(_target); - using FunctionExecutorPtr = CLGEMMKernelType (CLGEMMKernelSelectionMidgard::*)(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); + using FunctionExecutorPtr = CLGEMMKernelType (CLGEMMDefaultTypeMidgard::*)(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); // Configurations for Midgard architectures static std::map<DataType, FunctionExecutorPtr> gemm_configs = { - { DataType::F32, &CLGEMMKernelSelectionMidgard::default_f32 }, - { DataType::F16, &CLGEMMKernelSelectionMidgard::default_f16 }, - { DataType::QASYMM8, &CLGEMMKernelSelectionMidgard::default_q8 }, - { DataType::QASYMM8_SIGNED, &CLGEMMKernelSelectionMidgard::default_q8 }, - { DataType::QSYMM8, &CLGEMMKernelSelectionMidgard::default_q8 }, - { DataType::QSYMM8_PER_CHANNEL, &CLGEMMKernelSelectionMidgard::default_q8 } + { DataType::F32, &CLGEMMDefaultTypeMidgard::default_f32 }, + { DataType::F16, &CLGEMMDefaultTypeMidgard::default_f16 }, + { DataType::QASYMM8, &CLGEMMDefaultTypeMidgard::default_q8 }, + { DataType::QASYMM8_SIGNED, &CLGEMMDefaultTypeMidgard::default_q8 }, + { DataType::QSYMM8, &CLGEMMDefaultTypeMidgard::default_q8 }, + { DataType::QSYMM8_PER_CHANNEL, &CLGEMMDefaultTypeMidgard::default_q8 } }; const DataType data_type = params.data_type; @@ -68,7 +68,7 @@ CLGEMMKernelType CLGEMMKernelSelectionMidgard::select_kernel(const CLGEMMKernelS ARM_COMPUTE_ERROR("Not supported data type"); } -CLGEMMKernelType CLGEMMKernelSelectionMidgard::default_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeMidgard::default_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(n, k, b); @@ -76,7 +76,7 @@ CLGEMMKernelType CLGEMMKernelSelectionMidgard::default_f32(unsigned int m, unsig return ((m != 1) && is_rhs_constant) ? CLGEMMKernelType::RESHAPED_V1 : CLGEMMKernelType::NATIVE_V1; } -CLGEMMKernelType CLGEMMKernelSelectionMidgard::default_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeMidgard::default_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(n, k, b); @@ -84,7 +84,7 @@ CLGEMMKernelType CLGEMMKernelSelectionMidgard::default_f16(unsigned int m, unsig return ((m != 1) && is_rhs_constant) ? CLGEMMKernelType::RESHAPED_V1 : CLGEMMKernelType::NATIVE_V1; } -CLGEMMKernelType CLGEMMKernelSelectionMidgard::default_q8(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeMidgard::default_q8(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(m, n, k, b, is_rhs_constant); diff --git a/src/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.h b/src/runtime/CL/gemm/CLGEMMDefaultTypeMidgard.h index 3f6003f7dc..241072fd58 100644 --- a/src/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.h +++ b/src/runtime/CL/gemm/CLGEMMDefaultTypeMidgard.h @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef SRC_CLGEMMKERNELSELECTIONMIDGARD_H -#define SRC_CLGEMMKERNELSELECTIONMIDGARD_H +#ifndef SRC_CLGEMMDefaultTypeMidgard_H +#define SRC_CLGEMMDefaultTypeMidgard_H #include "arm_compute/runtime/CL/ICLGEMMKernelSelection.h" @@ -31,14 +31,14 @@ namespace arm_compute namespace cl_gemm { /** Midgard based OpenCL GEMMKernel selection */ -class CLGEMMKernelSelectionMidgard final : public ICLGEMMKernelSelection +class CLGEMMDefaultTypeMidgard final : public ICLGEMMKernelSelection { public: /** Constructor * * @param[in] gpu GPU target */ - CLGEMMKernelSelectionMidgard(GPUTarget gpu); + CLGEMMDefaultTypeMidgard(GPUTarget gpu); // Inherited overridden method CLGEMMKernelType select_kernel(const CLGEMMKernelSelectionParams ¶ms) override; @@ -50,4 +50,4 @@ private: }; } // namespace cl_gemm } // namespace arm_compute -#endif /* SRC_CLGEMMKERNELSELECTIONMIDGARD_H */ +#endif /* SRC_CLGEMMDefaultTypeMidgard_H */ diff --git a/src/runtime/CL/gemm/CLGEMMKernelSelectionValhall.cpp b/src/runtime/CL/gemm/CLGEMMDefaultTypeValhall.cpp index da41859b87..ad74368889 100644 --- a/src/runtime/CL/gemm/CLGEMMKernelSelectionValhall.cpp +++ b/src/runtime/CL/gemm/CLGEMMDefaultTypeValhall.cpp @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "src/runtime/CL/gemm/CLGEMMKernelSelectionValhall.h" +#include "src/runtime/CL/gemm/CLGEMMDefaultTypeValhall.h" #include "arm_compute/core/CL/CLHelpers.h" #include "arm_compute/core/CL/CLKernelLibrary.h" @@ -34,38 +34,38 @@ namespace arm_compute { namespace cl_gemm { -CLGEMMKernelSelectionValhall::CLGEMMKernelSelectionValhall(GPUTarget gpu) +CLGEMMDefaultTypeValhall::CLGEMMDefaultTypeValhall(GPUTarget gpu) : ICLGEMMKernelSelection(gpu) { } -CLGEMMKernelType CLGEMMKernelSelectionValhall::select_kernel(const CLGEMMKernelSelectionParams ¶ms) +CLGEMMKernelType CLGEMMDefaultTypeValhall::select_kernel(const CLGEMMKernelSelectionParams ¶ms) { // _target could be used in the future to have a dedicated heuristic for each GPU IP ARM_COMPUTE_UNUSED(_target); - using FunctionExecutorPtr = CLGEMMKernelType (CLGEMMKernelSelectionValhall::*)(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); + using FunctionExecutorPtr = CLGEMMKernelType (CLGEMMDefaultTypeValhall::*)(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); // Default configurations for Valhall architectures static std::map<DataType, FunctionExecutorPtr> gemm_default_configs = { - { DataType::F32, &CLGEMMKernelSelectionValhall::default_f32 }, - { DataType::F16, &CLGEMMKernelSelectionValhall::default_f16 }, - { DataType::QASYMM8, &CLGEMMKernelSelectionValhall::default_q8 }, - { DataType::QASYMM8_SIGNED, &CLGEMMKernelSelectionValhall::default_q8 }, - { DataType::QSYMM8, &CLGEMMKernelSelectionValhall::default_q8 }, - { DataType::QSYMM8_PER_CHANNEL, &CLGEMMKernelSelectionValhall::default_q8 } + { DataType::F32, &CLGEMMDefaultTypeValhall::default_f32 }, + { DataType::F16, &CLGEMMDefaultTypeValhall::default_f16 }, + { DataType::QASYMM8, &CLGEMMDefaultTypeValhall::default_q8 }, + { DataType::QASYMM8_SIGNED, &CLGEMMDefaultTypeValhall::default_q8 }, + { DataType::QSYMM8, &CLGEMMDefaultTypeValhall::default_q8 }, + { DataType::QSYMM8_PER_CHANNEL, &CLGEMMDefaultTypeValhall::default_q8 } }; // Mali-G77 configurations static std::map<DataType, FunctionExecutorPtr> gemm_g77_configs = { - { DataType::F32, &CLGEMMKernelSelectionValhall::default_f32 }, - { DataType::F16, &CLGEMMKernelSelectionValhall::g77_f16 }, - { DataType::QASYMM8, &CLGEMMKernelSelectionValhall::default_q8 }, - { DataType::QASYMM8_SIGNED, &CLGEMMKernelSelectionValhall::default_q8 }, - { DataType::QSYMM8, &CLGEMMKernelSelectionValhall::default_q8 }, - { DataType::QSYMM8_PER_CHANNEL, &CLGEMMKernelSelectionValhall::default_q8 } + { DataType::F32, &CLGEMMDefaultTypeValhall::default_f32 }, + { DataType::F16, &CLGEMMDefaultTypeValhall::g77_f16 }, + { DataType::QASYMM8, &CLGEMMDefaultTypeValhall::default_q8 }, + { DataType::QASYMM8_SIGNED, &CLGEMMDefaultTypeValhall::default_q8 }, + { DataType::QSYMM8, &CLGEMMDefaultTypeValhall::default_q8 }, + { DataType::QSYMM8_PER_CHANNEL, &CLGEMMDefaultTypeValhall::default_q8 } }; const DataType data_type = params.data_type; @@ -87,35 +87,35 @@ CLGEMMKernelType CLGEMMKernelSelectionValhall::select_kernel(const CLGEMMKernelS } } -CLGEMMKernelType CLGEMMKernelSelectionValhall::default_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeValhall::default_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(m, n, k, b); return is_rhs_constant ? CLGEMMKernelType::RESHAPED_ONLY_RHS : CLGEMMKernelType::NATIVE_V1; } -CLGEMMKernelType CLGEMMKernelSelectionValhall::default_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeValhall::default_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(m, n, k, b); return is_rhs_constant ? CLGEMMKernelType::RESHAPED_ONLY_RHS : CLGEMMKernelType::NATIVE_V1; } -CLGEMMKernelType CLGEMMKernelSelectionValhall::g77_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeValhall::g77_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { - if (!is_rhs_constant) + if(!is_rhs_constant) { return CLGEMMKernelType::NATIVE_V1; } - if (m == 1) + if(m == 1) { return CLGEMMKernelType::RESHAPED_ONLY_RHS; } - const float r_mn = static_cast<float>(m) / static_cast<float>(n); - const float r_mk = static_cast<float>(m) / static_cast<float>(k); - const float r_nk = static_cast<float>(n) / static_cast<float>(k); + const float r_mn = static_cast<float>(m) / static_cast<float>(n); + const float r_mk = static_cast<float>(m) / static_cast<float>(k); + const float r_nk = static_cast<float>(n) / static_cast<float>(k); const float workload = (static_cast<float>(m) * static_cast<float>(n) * static_cast<float>(b)) / 20.0f; if(r_mk <= 0.6817956566810608) @@ -205,7 +205,7 @@ CLGEMMKernelType CLGEMMKernelSelectionValhall::g77_f16(unsigned int m, unsigned } } -CLGEMMKernelType CLGEMMKernelSelectionValhall::default_q8(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) +CLGEMMKernelType CLGEMMDefaultTypeValhall::default_q8(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant) { ARM_COMPUTE_UNUSED(m, n, k, b); diff --git a/src/runtime/CL/gemm/CLGEMMKernelSelectionValhall.h b/src/runtime/CL/gemm/CLGEMMDefaultTypeValhall.h index 82e46f694e..2fae838cc3 100644 --- a/src/runtime/CL/gemm/CLGEMMKernelSelectionValhall.h +++ b/src/runtime/CL/gemm/CLGEMMDefaultTypeValhall.h @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef SRC_CLGEMMKERNELSELECTIONVALHALL_H -#define SRC_CLGEMMKERNELSELECTIONVALHALL_H +#ifndef SRC_CLGEMMDEFAULTTYPEVALHALL_H +#define SRC_CLGEMMDEFAULTTYPEVALHALL_H #include "arm_compute/runtime/CL/ICLGEMMKernelSelection.h" @@ -31,14 +31,14 @@ namespace arm_compute namespace cl_gemm { /** Valhall based OpenCL GEMMKernel selection */ -class CLGEMMKernelSelectionValhall final : public ICLGEMMKernelSelection +class CLGEMMDefaultTypeValhall final : public ICLGEMMKernelSelection { public: /** Constructor * * @param[in] gpu GPU target */ - CLGEMMKernelSelectionValhall(GPUTarget gpu); + CLGEMMDefaultTypeValhall(GPUTarget gpu); // Inherited overridden method CLGEMMKernelType select_kernel(const CLGEMMKernelSelectionParams ¶ms) override; @@ -51,4 +51,4 @@ private: }; } // namespace cl_gemm } // namespace arm_compute -#endif /* SRC_CLGEMMKERNELSELECTIONVALHALL_H */ +#endif /* SRC_CLGEMMDEFAULTTYPEVALHALL_H */ diff --git a/src/runtime/CL/gemm/CLGEMMKernelSelection.h b/src/runtime/CL/gemm/CLGEMMKernelSelection.h index 69f8349d27..6189a324cf 100644 --- a/src/runtime/CL/gemm/CLGEMMKernelSelection.h +++ b/src/runtime/CL/gemm/CLGEMMKernelSelection.h @@ -25,9 +25,9 @@ #define SRC_CLGEMMKERNELSELECTION_H #include "arm_compute/runtime/CL/ICLGEMMKernelSelection.h" -#include "src/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.h" -#include "src/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.h" -#include "src/runtime/CL/gemm/CLGEMMKernelSelectionValhall.h" +#include "src/runtime/CL/gemm/CLGEMMDefaultTypeBifrost.h" +#include "src/runtime/CL/gemm/CLGEMMDefaultTypeMidgard.h" +#include "src/runtime/CL/gemm/CLGEMMDefaultTypeValhall.h" namespace arm_compute { @@ -48,11 +48,11 @@ public: switch(get_arch_from_target(gpu)) { case GPUTarget::MIDGARD: - return std::make_unique<CLGEMMKernelSelectionMidgard>(gpu); + return std::make_unique<CLGEMMDefaultTypeMidgard>(gpu); case GPUTarget::BIFROST: - return std::make_unique<CLGEMMKernelSelectionBifrost>(gpu); + return std::make_unique<CLGEMMDefaultTypeBifrost>(gpu); case GPUTarget::VALHALL: - return std::make_unique<CLGEMMKernelSelectionValhall>(gpu); + return std::make_unique<CLGEMMDefaultTypeValhall>(gpu); default: ARM_COMPUTE_ERROR("Not supported GPU target"); } |