From e39334c15c7fd141bb8173d5017ea5ca157fca2c Mon Sep 17 00:00:00 2001 From: David Mansell Date: Fri, 6 Jul 2018 17:53:35 +0100 Subject: COMPMID-1271: New system for GEMM heuristics This patch implements a system for separating the "validity" from "preferred" aspect of the current heuristics in gemm_*.cpp. Now, each gemm_*.cpp defines a list of candidate implementations, each of which supplies an is_valid() function (to check for validity), an is_preferred() function (the "heuristic" part), and an instantiate() function which actually produces the GemmCommon object pointer. The actual gemm() function is now templated and uses this list to select an implementation. This patch also implements a mechanism to identify the preferred implementation, and override it via the GemmConfig structure. Change-Id: Id49ab7af8bf2e3e9fd951a9698883ade234d40e1 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/139120 Reviewed-by: Anthony Barbier Tested-by: Jenkins --- .../kernels/arm_gemm/kernels/a64_sgemm_native_16x4.hpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/core/NEON/kernels/arm_gemm/kernels/a64_sgemm_native_16x4.hpp') diff --git a/src/core/NEON/kernels/arm_gemm/kernels/a64_sgemm_native_16x4.hpp b/src/core/NEON/kernels/arm_gemm/kernels/a64_sgemm_native_16x4.hpp index 11a589d75c..1a3596511b 100644 --- a/src/core/NEON/kernels/arm_gemm/kernels/a64_sgemm_native_16x4.hpp +++ b/src/core/NEON/kernels/arm_gemm/kernels/a64_sgemm_native_16x4.hpp @@ -46,9 +46,17 @@ public: typedef void (*kern_type)(const float *, int, const float *, int, float *, int, float, int, int, int); /* Kernel blocking parameters */ - static const int out_width = 16; - static const int out_height = 4; - static const int k_unroll = 1; + static int out_width() { + return 16; + } + + static int out_height() { + return 4; + } + + static int k_unroll() { + return 1; + } // Default to the generic kernel kern_type kernel=a64_sgemm_native_16x4; -- cgit v1.2.1