2 // Copyright (c) 2018 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 "training_kernel_base.h"
20 #include "kernel_selector_params.h"
22 namespace kernel_selector
24 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
25 // convolution_grad_weights_params
26 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
27 struct convolution_grad_weights_params : public training_params
29 convolution_grad_weights_params() : training_params(KernelType::CONVOLUTION_GRAD_WEIGHTS) {}
36 bool depthwise_separable_opt = false;
37 bool output_grad_w = false;
39 virtual std::string to_string() const override;
41 virtual ParamsKey GetParamsKey() const override
43 ParamsKey k = training_params::GetParamsKey();
47 k.EnableSplitSupport();
50 if (dilation.x != 1 ||
56 if (depthwise_separable_opt)
58 k.EnableDepthwiseSeparableOpt();
64 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
65 // convolution_grad_weights_optional_params
66 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
67 struct convolution_grad_weights_optional_params : training_optional_params
69 convolution_grad_weights_optional_params() : training_optional_params(KernelType::CONVOLUTION_GRAD_WEIGHTS) {}
72 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
73 // ConvolutionGradWeightsKernelBase
74 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
75 class ConvolutionGradWeightsKernelBase : public training_kernel_base
78 using training_kernel_base::training_kernel_base;
79 virtual ~ConvolutionGradWeightsKernelBase() {}
81 using DispatchData = CommonDispatchData;
84 virtual KernelsData GetKernelsData(const Params& params, const optional_params& options) const;
85 virtual JitConstants GetJitConstants(const convolution_grad_weights_params& params) const;
86 virtual DispatchData SetDefault(const convolution_grad_weights_params& params) const;