Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / kernel_selector / core / actual_kernels / region_yolo / region_yolo_kernel_ref.h
1 /*
2 // Copyright (c) 2018 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 #pragma once
18
19 #include "common_kernel_base.h"
20 #include "kernel_selector_params.h"
21  
22 namespace kernel_selector 
23 {    
24     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
25     // region_yolo_params
26     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
27     struct region_yolo_params : public base_params
28     {
29         region_yolo_params() : base_params(KernelType::REGION_YOLO) {}
30
31         uint32_t coords;
32         uint32_t classes;
33         uint32_t num;
34         uint32_t mask_size;
35         bool do_softmax;
36
37         virtual ParamsKey GetParamsKey() const
38         {
39             auto k = base_params::GetParamsKey();
40             return k;
41         }
42     };
43
44     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
45     // region_yolo_optional_params
46     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
47     struct region_yolo_optional_params : optional_params
48     {
49         region_yolo_optional_params() : optional_params(KernelType::REGION_YOLO) {}
50     };
51
52     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
53     // RegionYoloKernelRef
54     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
55     class RegionYoloKernelRef : public common_kernel_base
56     {
57     public:
58         RegionYoloKernelRef() : common_kernel_base("region_yolo_gpu_ref") {}
59         virtual ~RegionYoloKernelRef() {}
60
61         using DispatchData = CommonDispatchData;        
62         virtual KernelsData GetKernelsData(const Params& params, const optional_params& options) const override;
63
64
65     protected:
66         virtual ParamsKey GetSupportedKey() const override;
67         virtual JitConstants GetJitConstants(const region_yolo_params& params) const;
68     };
69 }