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.
17 #include "reorder_kernel_byxf_f32_to_byx8_f4_i8.h"
18 #include "kernel_selector_utils.h"
20 namespace kernel_selector
22 ParamsKey reorder_kernel_byxf_f32_to_byx8_f4_i8::GetSupportedKey() const
25 k.EnableInputDataType(Datatype::F32);
26 k.EnableOutputDataType(Datatype::INT8);
27 k.EnableDifferentTypes();
28 k.EnableInputLayout(DataLayout::byxf);
29 k.EnableOutputLayout(DataLayout::byx8_f4);
30 k.EnableTensorOffset();
31 k.EnableTensorPitches();
36 bool reorder_kernel_byxf_f32_to_byx8_f4_i8::Validate(const Params& p, const optional_params& o) const
38 if (!ReorderKernelBase::Validate(p, o))
43 const reorder_params& params = static_cast<const reorder_params&>(p);
45 if (params.output.X().v % 16 != 0)
48 if (params.inputs[0].Feature().v != 3)
54 reorder_kernel_byxf_f32_to_byx8_f4_i8::DispatchData reorder_kernel_byxf_f32_to_byx8_f4_i8::SetDefault(const reorder_params& params) const
58 const auto& input = params.inputs[0];
60 kd.gws0 = input.X().v;
61 kd.gws1 = input.Y().v;
62 kd.gws2 = input.Batch().v;
71 JitConstants reorder_kernel_byxf_f32_to_byx8_f4_i8::GetJitConstants(const reorder_params& params) const
73 auto jit = ReorderKernelBase::GetJitConstants(params);
74 jit.Merge(GetTensorFriendlyWorkGroupsJit(params.inputs[0]));
78 KernelsData reorder_kernel_byxf_f32_to_byx8_f4_i8::GetKernelsData(const Params& params, const optional_params& options) const
80 const reorder_params& orgParams = static_cast<const reorder_params&>(params);
81 return GetCommonKernelsData(orgParams, options, FORCE_PRIORITY_5);