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 "lstm_gemv_gpu_subgroup1x64_bfyx_hh_SIMD16.h"
18 #include "kernel_selector_utils.h"
20 namespace kernel_selector {
22 ParamsKey LSTMGemvKernel_subgroup1x64_bfyx_hh_SIMD16::GetSupportedKey() const
25 k.EnableInputDataType(Datatype::F16);
26 k.EnableOutputDataType(Datatype::F16);
27 k.EnableDifferentTypes();
28 k.EnableInputLayout(DataLayout::bfyx);
29 k.EnableOutputLayout(DataLayout::bfyx);
30 k.EnableTensorOffset();
31 k.EnableTensorPitches();
33 k.EnableLSTMGEMMBias();
34 k.EnableLSTMGEMMHidden();
39 KernelsData LSTMGemvKernel_subgroup1x64_bfyx_hh_SIMD16::GetKernelsData(const Params& params, const optional_params& options) const
41 KernelsData kernelsData = GetCommonKernelsData(params, options);
42 auto &kernel = kernelsData[0].kernels[0];
44 // This kernel is good if
46 // 2) The input size y-x size is 64x1
47 const lstm_gemm_params& orgParams = static_cast<const lstm_gemm_params&>(params);
48 const auto& input = orgParams.inputs[0];
50 if ( (input.Batch().v == 1)
51 && (input.X().v >= 64)
52 && (input.Y().v == 1))
54 auto out = orgParams.output;
56 kernel.workGroups.global = { 16, out.X().v, out.Batch().v };
57 kernelsData[0].estimatedTime = FORCE_PRIORITY_1;