Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / kernel_selector / core / actual_kernels / convolution / convolution_kernel_byxf_af32_depthwise.cpp
1 /*
2 // Copyright (c) 2016 Intel Corporation
3 //
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
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 */
16
17 #include "convolution_kernel_byxf_af32_depthwise.h"
18
19 namespace kernel_selector {
20     
21     ParamsKey ConvolutionKernel_byxf_af32_depthiwise::GetSupportedKey() const
22     {
23         ParamsKey k;
24         k.EnableInputDataType(Datatype::INT8);
25         k.EnableOutputDataType(Datatype::INT8);
26         k.EnableInputWeightsType(WeightsType::INT8);
27         k.EnableInputLayout(DataLayout::byxf_af32);
28         k.EnableOutputLayout(DataLayout::byxf_af32);
29         k.EnableTensorOffset();
30         k.EnableTensorPitches();
31         k.EnableDilation();
32         k.EnableBiasPerFeature();
33         k.EnableBiasPerOutput();
34         k.EnableNonBiasTerm();
35         k.EnableBatching();
36         k.EnableSplitSupport();
37         k.EnableInt8Quantization();
38         k.EnableOutputCalibration();
39         k.EnableDepthwiseSeparableOpt();
40         k.DisableTuning();
41         return k;
42     }
43
44     bool ConvolutionKernel_byxf_af32_depthiwise::Validate(const Params& p, const optional_params& o) const
45     {
46         if (!Parent::Validate(p, o))
47         {
48             return false;
49         }
50
51         const convolution_params& params = static_cast<const convolution_params&>(p);
52
53         // this kernel is designed for quantization use case
54         if (!params.depthwise_separable_opt)
55             return false;
56
57         return true;
58     }
59
60     KernelsData ConvolutionKernel_byxf_af32_depthiwise::GetKernelsData(const Params& params, const optional_params& options) const
61     {
62         KernelsData kd = GetTunedKernelsDataByIndex(params, options);
63         if(!kd.empty())
64             kd[0].estimatedTime = FORCE_PRIORITY_3;
65         return kd;
66     }
67 }