Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / kernel_selector / core / actual_kernels / convolution / convolution_kernel_byx8_f4__fs_bs_yx_bsv4_fsv32.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_byx8_f4__fs_bs_yx_bsv4_fsv32.h"
18 #include "kernel_selector_utils.h"
19
20 namespace kernel_selector {
21
22     ParamsKey ConvolutionKernel_byx8_f4__fs_bs_yx_bsv4_fsv32::GetSupportedKey() const
23     {
24         ParamsKey k;
25         k.EnableInputDataType(Datatype::INT8);
26         k.EnableOutputDataType(Datatype::INT8);
27         k.EnableInputWeightsType(WeightsType::INT8);
28         k.EnableInputLayout(DataLayout::byx8_f4);
29         k.EnableOutputLayout(DataLayout::fs_bs_yx_bsv4_fsv32);
30         k.EnableTensorOffset();
31         k.EnableTensorPitches();
32         k.EnableDilation();
33         k.EnableBiasPerFeature();
34         k.EnableBatching();
35         k.EnableInt8Quantization();
36         k.EnableOutputCalibration();
37         k.DisableTuning();
38         return k;
39     }
40
41     bool ConvolutionKernel_byx8_f4__fs_bs_yx_bsv4_fsv32::Validate(const Params& p, const optional_params& o) const
42     {
43         if (!Parent::Validate(p, o))
44         {
45             return false;
46         }
47
48         const convolution_params& params = static_cast<const convolution_params&>(p);
49
50         // this kernel is designed for quantization use case
51         if (!params.int8_quantization)
52             return false;
53
54         return true;
55     }
56
57     ConvolutionKernelBase::DispatchData ConvolutionKernel_byx8_f4__fs_bs_yx_bsv4_fsv32::SetDefault(const convolution_params& arg, int) const
58     {
59         DispatchData runInfo = ConvolutionKernelBase::SetDefault(arg);
60
61         runInfo.effiency = FORCE_PRIORITY_1;
62
63         runInfo.gws0 = (arg.output.Batch().v * arg.output.Feature().v) / 4;
64         runInfo.gws1 = arg.output.X().v / 8;
65         runInfo.gws2 = arg.output.Y().v / 4;
66
67         runInfo.lws0 = 8;
68         runInfo.lws1 = 1;
69         runInfo.lws2 = 1;
70
71         return runInfo;
72     }
73
74     KernelsData ConvolutionKernel_byx8_f4__fs_bs_yx_bsv4_fsv32::GetKernelsData(const Params& params, const optional_params& options) const
75     {
76         KernelsData kd = GetCommonKernelsData(params, options, " -Dcl_intel_subgroups_char");
77         if (!kd.empty())
78             kd[0].estimatedTime = FORCE_PRIORITY_3;
79         return kd;
80     }
81 }