Georgios Pinitas | 4074c99 | 2018-01-30 18:13:46 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 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 | */ |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame^] | 24 | #include "impl_fp32_fp32.hpp" |
Georgios Pinitas | 4074c99 | 2018-01-30 18:13:46 +0000 | [diff] [blame] | 25 | |
| 26 | namespace depthwise |
| 27 | { |
| 28 | using Conv = DepthwiseConvolution<2, 2, 3, 3, 2, 2, float, float>; |
| 29 | using ConvImpl = DepthwiseConvolutionImpl<2, 2, 3, 3, 2, 2, float, float>; |
| 30 | |
| 31 | template <> |
Georgios Pinitas | be0ae93 | 2018-03-13 13:08:12 +0000 | [diff] [blame] | 32 | const Conv::TileFn Conv::tilefn_unpadded = ConvImpl::template process_tile<true, 0, 0, 0, 0, 0, 0>; |
| 33 | |
| 34 | template <> |
| 35 | const Conv::TileFn Conv::tilefn_top[n_in_pad_top_fns] = { |
| 36 | ConvImpl::template process_tile<true, 0, 0, 0, 0, 0, 0>, |
| 37 | ConvImpl::template process_tile<true, 1, 0, 0, 0, 0, 0>, |
Georgios Pinitas | 4074c99 | 2018-01-30 18:13:46 +0000 | [diff] [blame] | 38 | }; |
| 39 | |
Georgios Pinitas | be0ae93 | 2018-03-13 13:08:12 +0000 | [diff] [blame] | 40 | template <> |
| 41 | const Conv::TileFn Conv::tilefn_left[n_in_pad_left_fns] = { |
| 42 | ConvImpl::template process_tile<true, 0, 0, 0, 0, 0, 0>, |
| 43 | ConvImpl::template process_tile<true, 0, 1, 0, 0, 0, 0>, |
| 44 | }; |
| 45 | |
| 46 | template <> |
| 47 | const Conv::TileFn Conv::tilefn_bottom[n_in_pad_bottom_fns][n_out_pad_bottom_fns] = { |
| 48 | { |
| 49 | ConvImpl::template process_tile<true, 0, 0, 0, 0, 0, 0>, |
| 50 | ConvImpl::template process_tile<true, 0, 0, 0, 0, 1, 0>, |
| 51 | }, |
| 52 | { |
| 53 | ConvImpl::template process_tile<true, 0, 0, 1, 0, 0, 0>, |
| 54 | ConvImpl::template process_tile<true, 0, 0, 1, 0, 1, 0>, |
| 55 | }, |
| 56 | { |
| 57 | ConvImpl::template process_tile<true, 0, 0, 2, 0, 0, 0>, |
| 58 | ConvImpl::template process_tile<true, 0, 0, 2, 0, 1, 0>, |
| 59 | }, |
| 60 | { |
| 61 | ConvImpl::template process_tile<true, 0, 0, 3, 0, 0, 0>, |
| 62 | ConvImpl::template process_tile<true, 0, 0, 3, 0, 1, 0>, |
| 63 | }, |
| 64 | { |
| 65 | ConvImpl::template process_tile<true, 0, 0, 4, 0, 0, 0>, |
| 66 | ConvImpl::template process_tile<true, 0, 0, 4, 0, 1, 0>, |
| 67 | }, |
| 68 | }; |
| 69 | |
| 70 | template <> |
| 71 | const Conv::TileFn Conv::tilefn_right[n_in_pad_right_fns][n_out_pad_right_fns] = { |
| 72 | { |
| 73 | ConvImpl::template process_tile<true, 0, 0, 0, 0, 0, 0>, |
| 74 | ConvImpl::template process_tile<true, 0, 0, 0, 0, 0, 1>, |
| 75 | }, |
| 76 | { |
| 77 | ConvImpl::template process_tile<true, 0, 0, 0, 1, 0, 0>, |
| 78 | ConvImpl::template process_tile<true, 0, 0, 0, 1, 0, 1>, |
| 79 | }, |
| 80 | { |
| 81 | ConvImpl::template process_tile<true, 0, 0, 0, 2, 0, 0>, |
| 82 | ConvImpl::template process_tile<true, 0, 0, 0, 2, 0, 1>, |
| 83 | }, |
| 84 | { |
| 85 | ConvImpl::template process_tile<true, 0, 0, 0, 3, 0, 0>, |
| 86 | ConvImpl::template process_tile<true, 0, 0, 0, 3, 0, 1>, |
| 87 | }, |
| 88 | { |
| 89 | ConvImpl::template process_tile<true, 0, 0, 0, 4, 0, 0>, |
| 90 | ConvImpl::template process_tile<true, 0, 0, 0, 4, 0, 1>, |
| 91 | }, |
| 92 | }; |
| 93 | |
| 94 | template <> |
| 95 | const Conv::TileFn Conv::tilefn_generic = ConvImpl::template process_tile<false>; |
Georgios Pinitas | 4074c99 | 2018-01-30 18:13:46 +0000 | [diff] [blame] | 96 | |
| 97 | template class DepthwiseConvolution<2, 2, 3, 3, 2, 2, float, float>; |
| 98 | } // namespace depthwise |