updated readme file due to moving CMake scripts to the root folder
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / kernel_selector / core / actual_kernels / activation / activation_kernel_base.h
1 // Copyright (c) 2016 Intel Corporation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15
16 #pragma once
17
18 #include "common_kernel_base.h"
19
20 namespace kernel_selector {
21 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
22 // activation_params
23 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
24 struct activation_params : public base_params {
25     activation_params() : base_params(KernelType::ACTIVATION) {}
26
27     MultiDataTensor inputActivationParams;
28
29     virtual ParamsKey GetParamsKey() const {
30         auto k = base_params::GetParamsKey();
31         if (!inputActivationParams.empty()) {
32             k.EnableActivationAdditionalParamsAsInput();
33         }
34         return k;
35     }
36 };
37
38 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
39 // activation_optional_params
40 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
41 struct activation_optional_params : optional_params {
42     activation_optional_params() : optional_params(KernelType::ACTIVATION) {}
43 };
44
45 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
46 // ActivationKernelBase
47 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
48 class ActivationKernelBase : public common_kernel_base {
49 public:
50     using DispatchData = CommonDispatchData;
51     using common_kernel_base::common_kernel_base;
52
53     virtual ~ActivationKernelBase() {}
54
55 protected:
56     bool Validate(const Params& p, const optional_params& o) const override;
57     virtual JitConstants GetJitConstants(const activation_params& params, DispatchData kd) const;
58     virtual DispatchData SetDefault(const activation_params& arg) const;
59     KernelsData GetCommonKernelsData(const Params& params, const optional_params& options) const;
60 };
61 }  // namespace kernel_selector