diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2020-03-16 12:22:37 +0000 |
---|---|---|
committer | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2020-04-08 15:31:25 +0000 |
commit | 5a4fe19c23729f1e58e947ed15e865dc33c35ff6 (patch) | |
tree | 006c2253f3b674c33f2fc540bfb78efbb816317d /src/core/CL | |
parent | 11d4918b2321d1e590124f44dd68e6cda223dbdc (diff) | |
download | ComputeLibrary-5a4fe19c23729f1e58e947ed15e865dc33c35ff6.tar.gz |
COMPMID-3112: Reworking heuristic for CLGEMM - part1
The new heuristic only affects the floating point execution
Change-Id: Ia6edc14ab1bdda4cee31b7afb096d0305d99b809
Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2942
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL')
-rw-r--r-- | src/core/CL/gemm/reshaped_only_rhs/CLGEMMReshapedOnlyRHSKernelConfigurationValhall.cpp | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/core/CL/gemm/reshaped_only_rhs/CLGEMMReshapedOnlyRHSKernelConfigurationValhall.cpp b/src/core/CL/gemm/reshaped_only_rhs/CLGEMMReshapedOnlyRHSKernelConfigurationValhall.cpp index b44b297722..951447e1a0 100644 --- a/src/core/CL/gemm/reshaped_only_rhs/CLGEMMReshapedOnlyRHSKernelConfigurationValhall.cpp +++ b/src/core/CL/gemm/reshaped_only_rhs/CLGEMMReshapedOnlyRHSKernelConfigurationValhall.cpp @@ -75,17 +75,26 @@ std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> CLGEMMReshapedOnlyRHSKernelConfi if(m == 1) { - return configure_lhs_rhs_info(m, n, 1, 4, 8, 1, 8, false, true, false, true); + if(n > 2048) + { + return configure_lhs_rhs_info(m, n, 1, 8, 2, 1, 256, false, true, false, true); + } + else + { + return configure_lhs_rhs_info(m, n, 1, 2, 2, 1, 256, false, true, false, true); + } } else { - if(m % 5) + if(m > 300) { - return configure_lhs_rhs_info(m, n, 4, 4, 4, 1, 8, false, true, false, true); + const int v0 = std::max(std::min(static_cast<int>(n / 4), static_cast<int>(256)), static_cast<int>(1)); + return configure_lhs_rhs_info(m, n, 4, 4, 4, 1, v0, false, true, false, true); } else { - return configure_lhs_rhs_info(m, n, 5, 4, 4, 1, 8, false, true, false, true); + const int v0 = std::max(std::min(static_cast<int>(n / 4), static_cast<int>(256)), static_cast<int>(1)); + return configure_lhs_rhs_info(m, n, 2, 4, 4, 1, v0, false, true, false, true); } } } @@ -97,12 +106,20 @@ std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> CLGEMMReshapedOnlyRHSKernelConfi if(m == 1) { - const unsigned int h0 = std::max(n / 2, 1U); - return configure_lhs_rhs_info(m, n, 1, 4, 8, 1, h0, false, true, false, true); + const int h0 = std::max(std::min(static_cast<int>(n / 4), static_cast<int>(256)), static_cast<int>(1)); + return configure_lhs_rhs_info(m, n, 1, 4, 4, 1, h0, false, true, false, true); } else { - return configure_lhs_rhs_info(m, n, 4, 8, 8, 1, 4, false, true, false, true); + const int h0 = std::max(std::min(static_cast<int>(n / 4), static_cast<int>(256)), static_cast<int>(1)); + if(k > 512) + { + return configure_lhs_rhs_info(m, n, 2, 4, 16, 1, h0, false, true, false, false); + } + else + { + return configure_lhs_rhs_info(m, n, 2, 4, 8, 1, h0, false, true, false, false); + } } } |