Pablo Tello | 181e651 | 2017-11-15 13:28:27 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 3 | * Copyright (c) 2017-2018 ARM Limited. |
Pablo Tello | 181e651 | 2017-11-15 13:28:27 +0000 | [diff] [blame] | 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" |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 32 | #include "arm_compute/runtime/NEON/AssemblyHelper.h" |
Pablo Tello | 181e651 | 2017-11-15 13:28:27 +0000 | [diff] [blame] | 33 | #include "arm_compute/runtime/Tensor.h" |
| 34 | |
| 35 | #include <memory> |
| 36 | |
| 37 | namespace arm_compute |
| 38 | { |
| 39 | class ITensor; |
| 40 | |
| 41 | /** Basic function to execute matrix multiply assembly kernels. |
| 42 | * |
| 43 | */ |
| 44 | class NEGEMMLowpAssemblyMatrixMultiplyCore : public IFunction |
| 45 | { |
| 46 | public: |
| 47 | /** Constructor */ |
| 48 | NEGEMMLowpAssemblyMatrixMultiplyCore(std::shared_ptr<IMemoryManager> memory_manager = nullptr); |
| 49 | /** Initialise the kernel's inputs, output |
Anthony Barbier | f202e50 | 2017-11-23 18:02:04 +0000 | [diff] [blame] | 50 | * |
| 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 Tello | 181e651 | 2017-11-15 13:28:27 +0000 | [diff] [blame] | 55 | void configure(const ITensor *a, const ITensor *b, ITensor *output); |
| 56 | |
| 57 | // Inherited methods overridden: |
| 58 | void run() override; |
| 59 | |
| 60 | private: |
| 61 | MemoryGroup _memory_group; |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 62 | AssemblyKernelGlueU8U32 _asm_glue_unsigned; |
| 63 | AssemblyKernelGlueS8S32 _asm_glue_signed; |
Pablo Tello | 181e651 | 2017-11-15 13:28:27 +0000 | [diff] [blame] | 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; |
| 69 | Tensor _workspace; |
| 70 | }; |
| 71 | } |
| 72 | #endif /*__ARM_COMPUTE_NEGEMMLOWPASSEMBLYMATRIXMULTIPLYCORE_H__ */ |