blob: 3d213a7668ece5a484b6df82912cfbe31d365626 [file] [log] [blame]
Pablo Tello181e6512017-11-15 13:28:27 +00001
2/*
3 * Copyright (c) 2017 ARM Limited.
4 *
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"
32#include "arm_compute/runtime/Tensor.h"
33
34#include <memory>
35
36namespace arm_compute
37{
38class ITensor;
39
40/** Basic function to execute matrix multiply assembly kernels.
41 *
42*/
43class NEGEMMLowpAssemblyMatrixMultiplyCore : public IFunction
44{
45public:
46 /** Constructor */
47 NEGEMMLowpAssemblyMatrixMultiplyCore(std::shared_ptr<IMemoryManager> memory_manager = nullptr);
48 /** Initialise the kernel's inputs, output
Anthony Barbierf202e502017-11-23 18:02:04 +000049 *
50 * @param[in] a First input tensor (Matrix A). Data type supported: U8, S8.
51 * @param[in] b Second input tensor (Matrix B). Data type supported: same as @p a
52 * @param[out] output Output tensor. Data type supported: Data type supported: S32
53 */
Pablo Tello181e6512017-11-15 13:28:27 +000054 void configure(const ITensor *a, const ITensor *b, ITensor *output);
55
56 // Inherited methods overridden:
57 void run() override;
58
59private:
60 MemoryGroup _memory_group;
61 std::unique_ptr<INEKernel> _mm_kernel;
62 std::unique_ptr<INEKernel> _mtx_a_reshape_kernel;
63 std::unique_ptr<INEKernel> _mtx_b_reshape_kernel;
64 Tensor _tmp_a;
65 Tensor _tmp_b;
66 Tensor _workspace;
67};
68}
69#endif /*__ARM_COMPUTE_NEGEMMLOWPASSEMBLYMATRIXMULTIPLYCORE_H__ */