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.
19 #include "common_kernel_base.h"
20 #include "kernel_selector_params.h"
22 namespace kernel_selector
24 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
25 // concatenation_params
26 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
27 struct concatenation_params : public base_params
29 concatenation_params() : base_params(KernelType::CONCATENATION) {}
31 ConcatAxis axis = ConcatAxis::FEATURE;
33 virtual ParamsKey GetParamsKey() const
35 auto k = base_params::GetParamsKey();
36 k.EnableConcatAxis(axis);
41 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
42 // concatenation_optional_params
43 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
44 struct concatenation_optional_params : optional_params
46 concatenation_optional_params() : optional_params(KernelType::CONCATENATION) {}
47 bool kernelPerInput = true;
51 virtual ParamsKey GetSupportedKey() const
53 ParamsKey k = optional_params::GetSupportedKey();
57 k.EnableConcatKernelPerInput();
61 k.EnableConcatOneKernel();
68 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
69 // ConcatenationKernelBase
70 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
71 class ConcatenationKernelBase : public common_kernel_base
74 using common_kernel_base::common_kernel_base;
75 virtual ~ConcatenationKernelBase() {}
77 using DispatchData = CommonDispatchData;
80 virtual bool Validate(const Params&, const optional_params&) const override;
81 virtual JitConstants GetJitConstants(const concatenation_params& params) const;
82 virtual DispatchData SetDefault(const concatenation_params& params) const;
83 KernelsData GetCommonKernelsData(const Params& params, const optional_params&) const;