blob: 1a0358b78793c3df4e7db7c1716b933eebc32d5d [file] [log] [blame]
Georgios Pinitas7cd26d42019-01-09 18:35:17 +00001/*
Georgios Pinitas48b3ef82019-10-14 19:03:09 +01002 * Copyright (c) 2019 ARM Limited.
Georgios Pinitas7cd26d42019-01-09 18:35:17 +00003 *
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#pragma once
25
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010026#ifdef __aarch64__
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000027
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000028namespace arm_gemm
29{
30
31// Actual kernel implementations
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010032void a64_smallK_hybrid_fp32_mla_4x8(const float *, int, const float *, float *, int, int, int, int, const float *, Activation, bool);
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000033
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010034class smallK_hybrid_fp32_mla_4x8
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000035{
36public:
37 typedef float operand_type;
38 typedef float result_type;
39
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010040 typedef void (*kern_type)(const float *, int, const float *, float *, int, int, int, int, const float *, Activation, bool);
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000041
42 /* Kernel blocking parameters */
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010043 static constexpr unsigned int out_height()
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000044 {
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010045 return 8;
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000046 }
47
Georgios Pinitas1d480652019-01-23 11:24:50 +000048 static unsigned int out_width()
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000049 {
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010050 return 4;
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000051 }
52
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010053 static constexpr unsigned int k_unroll()
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000054 {
55 return 1;
56 }
57
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010058 static constexpr bool supports_append()
59 {
60 return false;
61 }
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000062
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010063 static constexpr bool supports_bias()
64 {
65 return true;
66 }
67
68 static constexpr bool supports_activation()
69 {
70 return true;
71 }
72
73 StdTransformsFixed<operand_type, result_type, 8, 4, 1> transforms = {};
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000074
75 // Default to the generic kernel
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010076 kern_type kernel=a64_smallK_hybrid_fp32_mla_4x8;
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000077
Georgios Pinitas5aa1a0b2020-07-02 20:02:20 +010078 smallK_hybrid_fp32_mla_4x8(const CPUInfo *)
79 {
80
81 }
Georgios Pinitas7cd26d42019-01-09 18:35:17 +000082};
83
84} // namespace arm_gemm
85
Georgios Pinitas48b3ef82019-10-14 19:03:09 +010086#endif // __aarch64__