blob: 9ce43f949bc44919b740ff5ee630c3bc4f9c8227 [file] [log] [blame]
Georgios Pinitas4074c992018-01-30 18:13:46 +00001/*
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 Pinitas20c246a2018-09-12 16:45:53 +010024#include "impl_fp32_fp32.hpp"
Georgios Pinitas4074c992018-01-30 18:13:46 +000025
26namespace depthwise
27{
28using Conv = DepthwiseConvolution<2, 2, 3, 3, 2, 2, float, float>;
29using ConvImpl = DepthwiseConvolutionImpl<2, 2, 3, 3, 2, 2, float, float>;
30
31template <>
Georgios Pinitasbe0ae932018-03-13 13:08:12 +000032const Conv::TileFn Conv::tilefn_unpadded = ConvImpl::template process_tile<true, 0, 0, 0, 0, 0, 0>;
33
34template <>
35const 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 Pinitas4074c992018-01-30 18:13:46 +000038};
39
Georgios Pinitasbe0ae932018-03-13 13:08:12 +000040template <>
41const 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
46template <>
47const 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
70template <>
71const 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
94template <>
95const Conv::TileFn Conv::tilefn_generic = ConvImpl::template process_tile<false>;
Georgios Pinitas4074c992018-01-30 18:13:46 +000096
97template class DepthwiseConvolution<2, 2, 3, 3, 2, 2, float, float>;
98} // namespace depthwise