• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2019 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 
25 #pragma once
26 #include "depthwise_dilated.hpp"
27 #include "depthwise_quantized.hpp"
28 
29 namespace depthwise {
30 
31 template <unsigned int OutputTileRows, unsigned int OutputTileCols,
32           unsigned int KernelRows, unsigned int KernelCols,
33           unsigned int StrideRows, unsigned int StrideCols>
34 class QAsymm8DilatedDepthwiseConvolution
35     : public DilatedDepthwiseConvolution<
36           OutputTileRows, OutputTileCols, KernelRows, KernelCols, StrideRows,
37           StrideCols, uint8_t, int32_t, uint8_t> {
38 public:
39   /** Create a new dilated depthwise convolution engine.
40    */
41   QAsymm8DilatedDepthwiseConvolution(
42       int n_batches, int n_input_rows, int n_input_cols, int n_channels,
43       int dilation_factor, nck::ActivationFunction activation,
44       const qasymm8::QAsymm8Params &weight_quantisation,
45       const qasymm8::QAsymm8Params &input_quantisation,
46       const qasymm8::QAsymm8Params &output_quantisation,
47       unsigned int padding_top, unsigned int padding_left,
48       unsigned int padding_bottom, unsigned int padding_right);
49 
50   /** Create a new dilated depthwise convolution engine.
51    */
52   QAsymm8DilatedDepthwiseConvolution(
53       int n_batches, int n_input_rows, int n_input_cols, int n_channels,
54       int dilation_factor, int n_output_rows, int n_output_cols,
55       nck::ActivationFunction activation,
56       const qasymm8::QAsymm8Params &weight_quantisation,
57       const qasymm8::QAsymm8Params &input_quantisation,
58       const qasymm8::QAsymm8Params &output_quantisation,
59       unsigned int padding_top, unsigned int padding_left,
60       unsigned int padding_bottom, unsigned int padding_right);
61 
62   /** Create a new dilated depthwise convolution engine.
63    */
64   QAsymm8DilatedDepthwiseConvolution(
65       int n_batches, int n_input_rows, int n_input_cols, int n_channels,
66       int dilation_factor, nck::ActivationFunction activation,
67       const qasymm8::QAsymm8Params &weight_quantisation,
68       const qasymm8::QAsymm8Params &input_quantisation,
69       const qasymm8::QAsymm8Params &output_quantisation,
70       const qasymm8::QAsymm8RescaleParams &rescale_parameters,
71       unsigned int padding_top, unsigned int padding_left,
72       unsigned int padding_bottom, unsigned int padding_right);
73 
74   /** Create a new dilated depthwise convolution engine.
75    */
76   QAsymm8DilatedDepthwiseConvolution(
77       int n_batches, int n_input_rows, int n_input_cols, int n_channels,
78       int dilation_factor, int n_output_rows, int n_output_cols,
79       nck::ActivationFunction activation,
80       const qasymm8::QAsymm8Params &weight_quantisation,
81       const qasymm8::QAsymm8Params &input_quantisation,
82       const qasymm8::QAsymm8Params &output_quantisation,
83       const qasymm8::QAsymm8RescaleParams& rescale_parameters,
84       unsigned int padding_top, unsigned int padding_left,
85       unsigned int padding_bottom, unsigned int padding_right);
86 };
87 
88 }  // namespace depthwise
89