blob: 71c666ad002bc1f2aab682fcf4534196891564d7 [file] [log] [blame]
Pablo Tello181e6512017-11-15 13:28:27 +00001/*
Georgios Pinitas1d480652019-01-23 11:24:50 +00002 * Copyright (c) 2017-2019 Arm Limited.
Pablo Tello181e6512017-11-15 13:28:27 +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
26#ifdef __aarch64__
27
David Manselld93991e2018-07-06 14:52:52 +010028#include "../std_transforms_fixed.hpp"
29
Anthony Barbier5f707732018-07-03 16:22:02 +010030namespace arm_gemm {
31
Pablo Tello181e6512017-11-15 13:28:27 +000032// Load the actual kernel
Pablo Telloeb82fd22018-02-23 13:43:50 +000033void a64_gemm_s8_4x4(const int8_t *, const int8_t *, int32_t *, int, int, int);
Pablo Tello181e6512017-11-15 13:28:27 +000034
Pablo Telloeb82fd22018-02-23 13:43:50 +000035#include "arm_gemm.hpp"
36
Anthony Barbier5f707732018-07-03 16:22:02 +010037class gemm_s8_4x4 {
Pablo Tello181e6512017-11-15 13:28:27 +000038public:
Anthony Barbier5f707732018-07-03 16:22:02 +010039 typedef int8_t operand_type;
Pablo Tello181e6512017-11-15 13:28:27 +000040 typedef int32_t result_type;
41
42 typedef void (*kern_type)(const int8_t *, const int8_t *, int32_t *, int, int, int);
43
Pablo Tello181e6512017-11-15 13:28:27 +000044 /* Kernel blocking parameters */
Georgios Pinitas1d480652019-01-23 11:24:50 +000045 static unsigned int out_width() {
David Manselld93991e2018-07-06 14:52:52 +010046 return 4;
47 }
48
Georgios Pinitas1d480652019-01-23 11:24:50 +000049 static unsigned int out_height() {
David Manselld93991e2018-07-06 14:52:52 +010050 return 4;
51 }
52
Georgios Pinitas1d480652019-01-23 11:24:50 +000053 static unsigned int k_unroll() {
David Manselld93991e2018-07-06 14:52:52 +010054 return 16;
55 }
56
57 // Use the standard fixed size transforms.
58 StdTransformsFixed<operand_type, result_type, 4, 4, 16> transforms = {};
Pablo Tello181e6512017-11-15 13:28:27 +000059
Anthony Barbier5f707732018-07-03 16:22:02 +010060 kern_type kernel=a64_gemm_s8_4x4;
Pablo Tello181e6512017-11-15 13:28:27 +000061
Anthony Barbier5f707732018-07-03 16:22:02 +010062 gemm_s8_4x4(const CPUInfo *ci) { }
Pablo Tello181e6512017-11-15 13:28:27 +000063};
64
Pablo Telloeb82fd22018-02-23 13:43:50 +000065} // namespace arm_gemm
Pablo Tello181e6512017-11-15 13:28:27 +000066
Pablo Telloeb82fd22018-02-23 13:43:50 +000067#endif // __aarch64__
Anthony Barbier5f707732018-07-03 16:22:02 +010068