From 20c246a60869bada4051bd14eb9a3862be5330d7 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 12 Sep 2018 16:45:53 +0100 Subject: COMPMID-1532: Add DepthwiseConvolution3x3 FP16 on NEON Change-Id: I780970f317b979b3230e2b471ac01df7fda9ee14 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/148168 Tested-by: bsgcomp Reviewed-by: Anthony Barbier --- .../depthwise/depthwise_4x4_3x3_1x1_fp16_fp16.cpp | 130 +++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 src/core/NEON/kernels/convolution/depthwise/depthwise_4x4_3x3_1x1_fp16_fp16.cpp (limited to 'src/core/NEON/kernels/convolution/depthwise/depthwise_4x4_3x3_1x1_fp16_fp16.cpp') diff --git a/src/core/NEON/kernels/convolution/depthwise/depthwise_4x4_3x3_1x1_fp16_fp16.cpp b/src/core/NEON/kernels/convolution/depthwise/depthwise_4x4_3x3_1x1_fp16_fp16.cpp new file mode 100644 index 0000000000..33b55df449 --- /dev/null +++ b/src/core/NEON/kernels/convolution/depthwise/depthwise_4x4_3x3_1x1_fp16_fp16.cpp @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "impl_fp16_fp16.hpp" + +#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +namespace depthwise +{ +using Conv = DepthwiseConvolution<4, 4, 3, 3, 1, 1, float16_t, float16_t>; +using ConvImpl = DepthwiseConvolutionImpl<4, 4, 3, 3, 1, 1, float16_t, float16_t>; + +template <> +const Conv::TileFn Conv::tilefn_unpadded = ConvImpl::template process_tile; + +template <> +const Conv::TileFn Conv::tilefn_top[n_in_pad_top_fns] = { + ConvImpl::template process_tile, +}; + +template <> +const Conv::TileFn Conv::tilefn_left[n_in_pad_left_fns] = { + ConvImpl::template process_tile, +}; + +template <> +const Conv::TileFn Conv::tilefn_bottom[n_in_pad_bottom_fns][n_out_pad_bottom_fns] = { + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, +}; + +template <> +const Conv::TileFn Conv::tilefn_right[n_in_pad_right_fns][n_out_pad_right_fns] = { + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, + { + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + ConvImpl::template process_tile, + }, +}; + +template <> +const Conv::TileFn Conv::tilefn_generic = ConvImpl::template process_tile; + +template class DepthwiseConvolution<4, 4, 3, 3, 1, 1, float16_t, float16_t>; +} // namespace depthwise +#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC -- cgit v1.2.1