2 // Copyright (c) 2016 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
19 #include "weight_bias_kernel_base.h"
20 #include "kernel_selector_params.h"
22 namespace kernel_selector
24 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
25 // deconvolution_params
26 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
27 struct deconvolution_params : public weight_bias_params
29 deconvolution_params() : weight_bias_params(KernelType::DECONVOLUTION) {}
37 bool depthwise_separable_opt = false;
38 bool fused_eltwise = false;
40 virtual std::string to_string() const override;
42 virtual ParamsKey GetParamsKey() const override
44 ParamsKey k = weight_bias_params::GetParamsKey();
48 k.EnableSplitSupport();
51 if (dilation.x != 1 ||
57 if (depthwise_separable_opt)
59 k.EnableDepthwiseSeparableOpt();
62 if (groups > 1 && !depthwise_separable_opt)
64 k.EnableGroupedConvolution();
71 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
72 // deconvolution_optional_params
73 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
74 struct deconvolution_optional_params : weight_bias_optional_params
76 deconvolution_optional_params() : weight_bias_optional_params(KernelType::DECONVOLUTION) {}
79 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
80 // DeconvolutionKernelBase
81 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
82 class DeconvolutionKernelBase : public WeightBiasKernelBase
85 using WeightBiasKernelBase::WeightBiasKernelBase;
86 virtual ~DeconvolutionKernelBase() {}
88 using DispatchData = CommonDispatchData;
91 virtual KernelsData GetKernelsData(const Params& params, const optional_params& options) const;
92 virtual JitConstants GetJitConstants(const deconvolution_params& params) const;
93 virtual DispatchData SetDefault(const deconvolution_params& params) const;