Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017-2018 ARM Limited. |
| 3 | * |
| 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 | #ifdef __aarch64__ |
| 25 | |
| 26 | #include "arm_gemm.hpp" |
| 27 | #include "gemm_common.hpp" |
David Mansell | e39334c | 2018-07-06 17:53:35 +0100 | [diff] [blame] | 28 | #include "gemm_implementation.hpp" |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 29 | #include "gemm_interleaved.hpp" |
| 30 | |
| 31 | #include "kernels/a64_gemm_s16_12x8.hpp" |
| 32 | |
Anthony Barbier | 5f70773 | 2018-07-03 16:22:02 +0100 | [diff] [blame] | 33 | namespace arm_gemm { |
| 34 | |
David Mansell | e39334c | 2018-07-06 17:53:35 +0100 | [diff] [blame] | 35 | class GemmImpl_gemm_s16_interleaved : public GemmImplementation<int16_t, int32_t> { |
| 36 | public: |
| 37 | UniqueGemmCommon<int16_t, int32_t> instantiate(const GemmArgs<int32_t> &args) override { |
| 38 | return UniqueGemmCommon<int16_t, int32_t>(new GemmInterleaved<gemm_s16_12x8, int16_t, int32_t>(args)); |
| 39 | } |
| 40 | |
| 41 | GemmImpl_gemm_s16_interleaved() : GemmImplementation<int16_t, int32_t>(GemmMethod::GEMM_INTERLEAVED) { } |
| 42 | }; |
| 43 | |
Anthony Barbier | 92d2081 | 2018-07-13 11:35:30 +0100 | [diff] [blame] | 44 | static GemmImpl_gemm_s16_interleaved gemm_s16_interleaved_impl{}; |
| 45 | |
David Mansell | e39334c | 2018-07-06 17:53:35 +0100 | [diff] [blame] | 46 | static std::vector<GemmImplementation<int16_t, int32_t> *> gemm_s16_methods = { |
Anthony Barbier | 92d2081 | 2018-07-13 11:35:30 +0100 | [diff] [blame] | 47 | &gemm_s16_interleaved_impl |
David Mansell | e39334c | 2018-07-06 17:53:35 +0100 | [diff] [blame] | 48 | }; |
| 49 | |
Anthony Barbier | 5f70773 | 2018-07-03 16:22:02 +0100 | [diff] [blame] | 50 | template<> |
David Mansell | e39334c | 2018-07-06 17:53:35 +0100 | [diff] [blame] | 51 | std::vector<GemmImplementation<int16_t, int32_t> *> &gemm_implementation_list<int16_t, int32_t>() { |
| 52 | return gemm_s16_methods; |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 53 | } |
| 54 | |
David Mansell | e39334c | 2018-07-06 17:53:35 +0100 | [diff] [blame] | 55 | /* Explicitly instantiate the external functions for these types. */ |
| 56 | template UniqueGemmCommon<int16_t, int32_t> gemm<int16_t, int32_t>(GemmArgs<int32_t> &args, GemmConfig *cfg); |
| 57 | template GemmMethod get_gemm_method<int16_t, int32_t>(GemmArgs<int32_t> &args); |
| 58 | template bool method_is_compatible<int16_t, int32_t>(GemmMethod method, GemmArgs<int32_t> &args); |
| 59 | |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 60 | } // namespace arm_gemm |
| 61 | |
Georgios Pinitas | 421405b | 2018-10-26 19:05:32 +0100 | [diff] [blame] | 62 | #endif // __aarch64__ |