Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 1 | /* |
Michalis Spyrou | 778b95c | 2021-04-20 12:15:52 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2021 Arm Limited. |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
| 24 | #include "arm_gemm.hpp" |
| 25 | #include "gemm_common.hpp" |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 26 | #include "gemm_hybrid.hpp" |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 27 | #include "gemm_hybrid_indirect.hpp" |
David Mansell | e39334c | 2018-07-06 17:53:35 +0100 | [diff] [blame] | 28 | #include "gemm_implementation.hpp" |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 29 | #include "gemm_interleaved.hpp" |
David Mansell | ce8f605 | 2018-05-17 18:51:26 +0100 | [diff] [blame] | 30 | #include "gemv_batched.hpp" |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 31 | #include "gemv_pretransposed.hpp" |
| 32 | |
Anthony Barbier | 5f70773 | 2018-07-03 16:22:02 +0100 | [diff] [blame] | 33 | #include "kernels/a32_sgemm_8x6.hpp" |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 34 | #include "kernels/a64_hybrid_fp32bf16fp32_mmla_4x24.hpp" |
| 35 | #include "kernels/a64_hybrid_fp32bf16fp32_mmla_6x16.hpp" |
| 36 | #include "kernels/a64_hybrid_fp32_mla_4x24.hpp" |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 37 | #include "kernels/a64_hybrid_fp32_mla_6x16.hpp" |
| 38 | #include "kernels/a64_hybrid_fp32_mla_8x4.hpp" |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 39 | #include "kernels/a64_interleaved_bf16fp32_mmla_8x12.hpp" |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 40 | #include "kernels/a64_sgemm_8x12.hpp" |
Michalis Spyrou | 778b95c | 2021-04-20 12:15:52 +0100 | [diff] [blame] | 41 | #include "kernels/a64_sgemm_8x6.hpp" |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 42 | #include "kernels/a64_smallK_hybrid_fp32_mla_6x4.hpp" |
| 43 | #include "kernels/a64_smallK_hybrid_fp32_mla_8x4.hpp" |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 44 | |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 45 | #include "kernels/sve_hybrid_fp32bf16fp32_mmla_4x6VL.hpp" |
| 46 | #include "kernels/sve_hybrid_fp32bf16fp32_mmla_6x4VL.hpp" |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 47 | #include "kernels/sve_hybrid_fp32_mla_6x4VL.hpp" |
| 48 | #include "kernels/sve_hybrid_fp32_mla_8x1VL.hpp" |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 49 | #include "kernels/sve_interleaved_bf16fp32_mmla_8x3VL.hpp" |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 50 | #include "kernels/sve_interleaved_fp32_mla_8x3VL.hpp" |
| 51 | #include "kernels/sve_interleaved_fp32_mmla_8x3VL.hpp" |
| 52 | #include "kernels/sve_smallK_hybrid_fp32_mla_8x1VL.hpp" |
Georgios Pinitas | 421405b | 2018-10-26 19:05:32 +0100 | [diff] [blame] | 53 | |
Anthony Barbier | 5f70773 | 2018-07-03 16:22:02 +0100 | [diff] [blame] | 54 | namespace arm_gemm { |
| 55 | |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 56 | static const GemmImplementation<float, float> gemm_fp32_methods[] = |
| 57 | { |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 58 | // GEMV cases - starting with 'gemv_batched' wrapper to turn batched GEMV into GEMM. |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 59 | { |
| 60 | GemmMethod::GEMV_BATCHED, |
| 61 | "gemv_batched", |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 62 | [](const GemmArgs &args) { return args._Msize==1 && args._nbatches>1 && !args._indirect_input; }, |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 63 | nullptr, |
Georgios Pinitas | 48b3ef8 | 2019-10-14 19:03:09 +0100 | [diff] [blame] | 64 | [](const GemmArgs &args) { return new GemvBatched<float, float>(args); } |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 65 | }, |
| 66 | #ifdef __aarch64__ |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 67 | #ifdef ARM_COMPUTE_ENABLE_BF16 |
| 68 | // "fast mode" (BF16) kernels |
| 69 | GemmImplementation<float, float>::with_estimate( |
| 70 | GemmMethod::GEMM_INTERLEAVED, |
| 71 | "a64_interleaved_bf16fp32_mmla_8x12", |
| 72 | [](const GemmArgs &args) { return args._fast_mode && args._ci->has_bf16(); }, |
| 73 | [](const GemmArgs &args) { return GemmInterleaved<cls_a64_interleaved_bf16fp32_mmla_8x12, float, float>::estimate_cycles<float>(args); }, |
| 74 | [](const GemmArgs &args) { return new GemmInterleaved<cls_a64_interleaved_bf16fp32_mmla_8x12, float, float>(args); } |
| 75 | ), |
| 76 | GemmImplementation<float, float>::with_estimate( |
| 77 | GemmMethod::GEMM_HYBRID, |
| 78 | "a64_hybrid_fp32bf16fp32_mmla_6x16", |
| 79 | [](const GemmArgs &args) { return args._fast_mode && args._ci->has_bf16(); }, |
| 80 | [](const GemmArgs &args) { return GemmHybridIndirect<cls_a64_hybrid_fp32bf16fp32_mmla_6x16, float, float>::estimate_cycles<float>(args); }, |
| 81 | [](const GemmArgs &args) { return new GemmHybridIndirect<cls_a64_hybrid_fp32bf16fp32_mmla_6x16, float, float>(args); } |
| 82 | ), |
| 83 | GemmImplementation<float, float>::with_estimate( |
| 84 | GemmMethod::GEMM_HYBRID, |
| 85 | "a64_hybrid_fp32bf16fp32_mmla_4x24", |
| 86 | [](const GemmArgs &args) { return args._fast_mode && args._ci->has_bf16(); }, |
| 87 | [](const GemmArgs &args) { return GemmHybridIndirect<cls_a64_hybrid_fp32bf16fp32_mmla_4x24, float, float>::estimate_cycles<float>(args); }, |
| 88 | [](const GemmArgs &args) { return new GemmHybridIndirect<cls_a64_hybrid_fp32bf16fp32_mmla_4x24, float, float>(args); } |
| 89 | ), |
| 90 | #endif // ARM_COMPUTE_ENABLE_BF16 |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 91 | #ifdef ARM_COMPUTE_ENABLE_SVE |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 92 | #ifdef ARM_COMPUTE_ENABLE_BF16 |
| 93 | GemmImplementation<float, float>::with_estimate( |
| 94 | GemmMethod::GEMM_INTERLEAVED, |
| 95 | "sve_interleaved_bf16fp32_mmla_8x3VL", |
| 96 | [](const GemmArgs &args) { return args._fast_mode && args._ci->has_svebf16(); }, |
| 97 | [](const GemmArgs &args) { return GemmInterleaved<cls_sve_interleaved_bf16fp32_mmla_8x3VL, float, float>::estimate_cycles<float>(args); }, |
| 98 | [](const GemmArgs &args) { return new GemmInterleaved<cls_sve_interleaved_bf16fp32_mmla_8x3VL, float, float>(args); } |
| 99 | ), |
| 100 | GemmImplementation<float, float>::with_estimate( |
Georgios Pinitas | 5aa1a0b | 2020-07-02 20:02:20 +0100 | [diff] [blame] | 101 | GemmMethod::GEMM_HYBRID, |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 102 | "sve_hybrid_fp32bf16fp32_mmla_6x4VL", |
| 103 | [](const GemmArgs &args) { return args._fast_mode && args._ci->has_bf16(); }, |
| 104 | [](const GemmArgs &args) { return GemmHybridIndirect<cls_sve_hybrid_fp32bf16fp32_mmla_6x4VL, float, float>::estimate_cycles<float>(args); }, |
| 105 | [](const GemmArgs &args) { return new GemmHybridIndirect<cls_sve_hybrid_fp32bf16fp32_mmla_6x4VL, float, float>(args); } |
| 106 | ), |
| 107 | GemmImplementation<float, float>::with_estimate( |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 108 | GemmMethod::GEMM_HYBRID, |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 109 | "sve_hybrid_fp32bf16fp32_mmla_4x6VL", |
| 110 | [](const GemmArgs &args) { return args._fast_mode && args._ci->has_bf16(); }, |
| 111 | [](const GemmArgs &args) { return GemmHybridIndirect<cls_sve_hybrid_fp32bf16fp32_mmla_4x6VL, float, float>::estimate_cycles<float>(args); }, |
| 112 | [](const GemmArgs &args) { return new GemmHybridIndirect<cls_sve_hybrid_fp32bf16fp32_mmla_4x6VL, float, float>(args); } |
| 113 | ), |
| 114 | #endif // ARM_COMPUTE_ENABLE_BF16 |
| 115 | #ifdef ARM_COMPUTE_ENABLE_SVEF32MM |
| 116 | // MMLA next due to higher throughput (which is SVE only) |
| 117 | // Prefer this in all cases, except if fast mode is requested and BF16 is available. |
Georgios Pinitas | 5aa1a0b | 2020-07-02 20:02:20 +0100 | [diff] [blame] | 118 | { |
| 119 | GemmMethod::GEMM_INTERLEAVED, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 120 | "sve_interleaved_fp32_mmla_8x3VL", |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 121 | [](const GemmArgs &args) { return args._ci->has_svef32mm() && (args._Ksize>4); }, |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 122 | [](const GemmArgs &args) { return !(args._fast_mode && args._ci->has_bf16()); }, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 123 | [](const GemmArgs &args) { return new GemmInterleaved<cls_sve_interleaved_fp32_mmla_8x3VL, float, float>(args); } |
Georgios Pinitas | 5aa1a0b | 2020-07-02 20:02:20 +0100 | [diff] [blame] | 124 | }, |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 125 | #endif // ARM_COMPUTE_ENABLE_SVEF32MM |
| 126 | // SVE kernels |
Georgios Pinitas | c7b183a | 2020-03-06 18:12:09 +0000 | [diff] [blame] | 127 | { |
| 128 | GemmMethod::GEMM_HYBRID, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 129 | "sve_smallK_hybrid_fp32_mla_8x1VL", |
Pablo Marquez Tello | a50f193 | 2021-03-08 17:27:05 +0000 | [diff] [blame] | 130 | [](const GemmArgs &args) { return args._ci->has_sve() && args._Ksize <= 24 && !args._indirect_input; }, |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 131 | nullptr, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 132 | [](const GemmArgs &args) { return new GemmHybrid<cls_sve_smallK_hybrid_fp32_mla_8x1VL, float, float>(args); } |
Georgios Pinitas | c7b183a | 2020-03-06 18:12:09 +0000 | [diff] [blame] | 133 | }, |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 134 | { |
| 135 | GemmMethod::GEMM_HYBRID, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 136 | "sve_hybrid_fp32_mla_8x1VL", |
Pablo Marquez Tello | a50f193 | 2021-03-08 17:27:05 +0000 | [diff] [blame] | 137 | [](const GemmArgs &args) { return args._ci->has_sve(); }, |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 138 | [](const GemmArgs &args) { return (args._Nsize < 12); }, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 139 | [](const GemmArgs &args) { return new GemmHybridIndirect<cls_sve_hybrid_fp32_mla_8x1VL, float, float>(args); } |
| 140 | }, |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 141 | GemmImplementation<float, float>::with_estimate( |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 142 | GemmMethod::GEMM_HYBRID, |
| 143 | "sve_hybrid_fp32_mla_6x4VL", |
Pablo Marquez Tello | a50f193 | 2021-03-08 17:27:05 +0000 | [diff] [blame] | 144 | [](const GemmArgs &args) { return args._ci->has_sve(); }, |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 145 | [](const GemmArgs &args) { return GemmHybridIndirect<cls_sve_hybrid_fp32_mla_6x4VL, float, float>::estimate_cycles<float>(args); }, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 146 | [](const GemmArgs &args) { return new GemmHybridIndirect<cls_sve_hybrid_fp32_mla_6x4VL, float, float>(args); } |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 147 | ), |
| 148 | GemmImplementation<float, float>::with_estimate( |
| 149 | GemmMethod::GEMM_INTERLEAVED, |
| 150 | "sve_interleaved_fp32_mla_8x3VL", |
| 151 | [](const GemmArgs &args) { return args._ci->has_sve(); }, |
| 152 | [](const GemmArgs &args) { return GemmInterleaved<cls_sve_interleaved_fp32_mla_8x3VL, float, float>::estimate_cycles<float>(args); }, |
| 153 | [](const GemmArgs &args) { return new GemmInterleaved<cls_sve_interleaved_fp32_mla_8x3VL, float, float>(args); } |
| 154 | ), |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 155 | #endif // ARM_COMPUTE_ENABLE_SVE |
Michalis Spyrou | 778b95c | 2021-04-20 12:15:52 +0100 | [diff] [blame] | 156 | // Cortex-A35 specific kernel - use for any problem on A35, and never in any other cases. |
| 157 | { |
| 158 | GemmMethod::GEMM_INTERLEAVED, |
| 159 | "a64_sgemm_8x6", |
| 160 | nullptr, |
| 161 | [](const GemmArgs &args) { return args._ci->get_cpu_model() == CPUModel::A35; }, |
| 162 | [](const GemmArgs &args) { return new GemmInterleaved<cls_a64_sgemm_8x6, float, float>(args); } |
| 163 | }, |
Michele Di Giorgio | 33f41fa | 2021-03-09 14:09:08 +0000 | [diff] [blame] | 164 | // Arm® Neon™ hybrid methods |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 165 | { |
| 166 | GemmMethod::GEMM_HYBRID, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 167 | "a64_smallK_hybrid_fp32_mla_8x4", |
| 168 | [](const GemmArgs &args) { return args._Ksize <= 8 && (args._Nsize % 4)==0 && !args._indirect_input; }, |
Georgios Pinitas | 48b3ef8 | 2019-10-14 19:03:09 +0100 | [diff] [blame] | 169 | nullptr, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 170 | [](const GemmArgs &args) { return new GemmHybrid<cls_a64_smallK_hybrid_fp32_mla_8x4, float, float>(args); } |
Georgios Pinitas | 48b3ef8 | 2019-10-14 19:03:09 +0100 | [diff] [blame] | 171 | }, |
| 172 | { |
| 173 | GemmMethod::GEMM_HYBRID, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 174 | "a64_smallK_hybrid_fp32_mla_6x4", |
| 175 | [](const GemmArgs &args) { return (args._Ksize > 8 && args._Ksize <= 16) && (args._Nsize % 4)==0 && !args._indirect_input; }, |
Georgios Pinitas | 48b3ef8 | 2019-10-14 19:03:09 +0100 | [diff] [blame] | 176 | nullptr, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 177 | [](const GemmArgs &args) { return new GemmHybrid<cls_a64_smallK_hybrid_fp32_mla_6x4, float, float>(args); } |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 178 | }, |
| 179 | { |
Georgios Pinitas | 1461383 | 2019-03-01 19:07:11 +0000 | [diff] [blame] | 180 | GemmMethod::GEMM_HYBRID, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 181 | "a64_hybrid_fp32_mla_8x4", |
| 182 | nullptr, |
Michalis Spyrou | 71ac903 | 2019-11-14 14:31:44 +0000 | [diff] [blame] | 183 | [](const GemmArgs &args) { return (args._Nsize < 12); }, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 184 | [](const GemmArgs &args) { return new GemmHybridIndirect<cls_a64_hybrid_fp32_mla_8x4, float, float>(args); } |
Michalis Spyrou | 71ac903 | 2019-11-14 14:31:44 +0000 | [diff] [blame] | 185 | }, |
David Mansell | 318c9f4 | 2020-07-08 13:28:45 +0100 | [diff] [blame] | 186 | GemmImplementation<float, float>::with_estimate( |
Michalis Spyrou | 71ac903 | 2019-11-14 14:31:44 +0000 | [diff] [blame] | 187 | GemmMethod::GEMM_HYBRID, |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 188 | "a64_hybrid_fp32_mla_4x24", |
| 189 | nullptr, |
| 190 | [](const GemmArgs &args) { return GemmHybridIndirect<cls_a64_hybrid_fp32_mla_4x24, float, float>::estimate_cycles<float>(args); }, |
| 191 | [](const GemmArgs &args) { return new GemmHybridIndirect<cls_a64_hybrid_fp32_mla_4x24, float, float>(args); } |
| 192 | ), |
| 193 | GemmImplementation<float, float>::with_estimate( |
| 194 | GemmMethod::GEMM_HYBRID, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 195 | "a64_hybrid_fp32_mla_6x16", |
| 196 | nullptr, |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 197 | [](const GemmArgs &args) { return GemmHybridIndirect<cls_a64_hybrid_fp32_mla_6x16, float, float>::estimate_cycles<float>(args); }, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 198 | [](const GemmArgs &args) { return new GemmHybridIndirect<cls_a64_hybrid_fp32_mla_6x16, float, float>(args); } |
David Mansell | 318c9f4 | 2020-07-08 13:28:45 +0100 | [diff] [blame] | 199 | ), |
David Mansell | 318c9f4 | 2020-07-08 13:28:45 +0100 | [diff] [blame] | 200 | GemmImplementation<float, float>::with_estimate( |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 201 | GemmMethod::GEMM_INTERLEAVED, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 202 | "a64_sgemm_8x12", |
Gian Marco Iodice | 463f976 | 2020-05-19 14:12:27 +0100 | [diff] [blame] | 203 | nullptr, |
Georgios Pinitas | 4ee8b15 | 2021-07-16 16:16:43 +0100 | [diff] [blame] | 204 | [](const GemmArgs &args) { return GemmInterleaved<cls_a64_sgemm_8x12, float, float>::estimate_cycles<float>(args); }, |
Georgios Pinitas | c0b6f76 | 2020-11-02 01:37:17 +0000 | [diff] [blame] | 205 | [](const GemmArgs &args) { return new GemmInterleaved<cls_a64_sgemm_8x12, float, float>(args); } |
David Mansell | 318c9f4 | 2020-07-08 13:28:45 +0100 | [diff] [blame] | 206 | ), |
David Mansell | e39334c | 2018-07-06 17:53:35 +0100 | [diff] [blame] | 207 | #endif // __aarch64__ |
| 208 | |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 209 | #ifdef __arm__ |
Georgios Pinitas | cfa2bba | 2019-06-27 17:00:52 +0100 | [diff] [blame] | 210 | { |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 211 | GemmMethod::GEMM_INTERLEAVED, |
| 212 | "sgemm_8x6", |
| 213 | nullptr, |
| 214 | nullptr, |
Georgios Pinitas | 48b3ef8 | 2019-10-14 19:03:09 +0100 | [diff] [blame] | 215 | [](const GemmArgs &args) { return new GemmInterleaved<sgemm_8x6, float, float>(args); } |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 216 | }, |
| 217 | #endif // __arm__ |
| 218 | { |
| 219 | GemmMethod::DEFAULT, |
| 220 | "", |
| 221 | nullptr, |
| 222 | nullptr, |
| 223 | nullptr |
| 224 | } |
David Mansell | e39334c | 2018-07-06 17:53:35 +0100 | [diff] [blame] | 225 | }; |
| 226 | |
| 227 | /* Templated function to return this list. */ |
| 228 | template<> |
Georgios Pinitas | 7cd26d4 | 2019-01-09 18:35:17 +0000 | [diff] [blame] | 229 | const GemmImplementation<float, float> *gemm_implementation_list<float, float>() { |
| 230 | return gemm_fp32_methods; |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 231 | } |
| 232 | |
David Mansell | e39334c | 2018-07-06 17:53:35 +0100 | [diff] [blame] | 233 | /* Explicitly instantiate the external functions for these types. */ |
Georgios Pinitas | 48b3ef8 | 2019-10-14 19:03:09 +0100 | [diff] [blame] | 234 | template UniqueGemmCommon<float, float> gemm<float, float, Nothing>(const GemmArgs &args, const Nothing &); |
| 235 | template KernelDescription get_gemm_method<float, float, Nothing>(const GemmArgs &args, const Nothing &); |
| 236 | template std::vector<KernelDescription> get_compatible_kernels<float, float, Nothing> (const GemmArgs &args, const Nothing &); |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 237 | |
Georgios Pinitas | 1461383 | 2019-03-01 19:07:11 +0000 | [diff] [blame] | 238 | } // namespace arm_gemm |