blob: b6672d75846388c05eb138ebf8440368464d5f3d [file] [log] [blame]
Pablo Tello181e6512017-11-15 13:28:27 +00001
2/*
Pablo Telloeb82fd22018-02-23 13:43:50 +00003 * Copyright (c) 2017-2018 ARM Limited.
Pablo Tello181e6512017-11-15 13:28:27 +00004 *
5 * SPDX-License-Identifier: MIT
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to
9 * deal in the Software without restriction, including without limitation the
10 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 */
25#ifndef __ARM_COMPUTE_NEGEMMLOWPASSEMBLYMATRIXMULTIPLYCORE_H__
26#define __ARM_COMPUTE_NEGEMMLOWPASSEMBLYMATRIXMULTIPLYCORE_H__
27
28#include "arm_compute/core/NEON/INEKernel.h"
29#include "arm_compute/runtime/IFunction.h"
30#include "arm_compute/runtime/IMemoryManager.h"
31#include "arm_compute/runtime/MemoryGroup.h"
Anthony Barbier71d9b572018-07-06 17:05:59 +010032#include "arm_compute/runtime/NEON/functions/NEGEMMAssemblyDispatch.h"
Pablo Tello181e6512017-11-15 13:28:27 +000033#include "arm_compute/runtime/Tensor.h"
34
35#include <memory>
36
37namespace arm_compute
38{
39class ITensor;
40
41/** Basic function to execute matrix multiply assembly kernels.
42 *
43*/
44class NEGEMMLowpAssemblyMatrixMultiplyCore : public IFunction
45{
46public:
47 /** Constructor */
48 NEGEMMLowpAssemblyMatrixMultiplyCore(std::shared_ptr<IMemoryManager> memory_manager = nullptr);
49 /** Initialise the kernel's inputs, output
Anthony Barbierf202e502017-11-23 18:02:04 +000050 *
51 * @param[in] a First input tensor (Matrix A). Data type supported: U8, S8.
52 * @param[in] b Second input tensor (Matrix B). Data type supported: same as @p a
53 * @param[out] output Output tensor. Data type supported: Data type supported: S32
54 */
Pablo Tello181e6512017-11-15 13:28:27 +000055 void configure(const ITensor *a, const ITensor *b, ITensor *output);
56
57 // Inherited methods overridden:
58 void run() override;
59
60private:
Anthony Barbier71d9b572018-07-06 17:05:59 +010061 MemoryGroup _memory_group;
62 NEGEMMAssemblyDispatchU8U32 _asm_glue_unsigned;
63 NEGEMMAssemblyDispatchS8S32 _asm_glue_signed;
64 std::unique_ptr<INEKernel> _mm_kernel;
65 std::unique_ptr<INEKernel> _mtx_a_reshape_kernel;
66 std::unique_ptr<INEKernel> _mtx_b_reshape_kernel;
67 Tensor _tmp_a;
68 Tensor _tmp_b;
Pablo Tello181e6512017-11-15 13:28:27 +000069};
70}
71#endif /*__ARM_COMPUTE_NEGEMMLOWPASSEMBLYMATRIXMULTIPLYCORE_H__ */