2 // Copyright (c) 2018 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 // detection_output_params
26 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
27 struct detection_output_params : public base_params
29 detection_output_params() : base_params(KernelType::DETECTION_OUTPUT), detectOutParams() {}
31 struct DedicatedParams
37 int32_t background_label_id;
41 int32_t conf_padding_x;
42 int32_t conf_padding_y;
43 int32_t elements_per_thread;
46 int32_t prior_coordinates_offset;
47 int32_t prior_info_size;
48 bool prior_is_normalized;
50 bool variance_encoded_in_target;
53 float confidence_threshold;
56 DedicatedParams detectOutParams;
58 virtual ParamsKey GetParamsKey() const
60 return base_params::GetParamsKey();
64 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
65 // detection_output_optional_params
66 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
67 struct detection_output_optional_params : optional_params
69 detection_output_optional_params() : optional_params(KernelType::DETECTION_OUTPUT) {}
72 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
73 // DetectionOutputKernelBase
74 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
75 class DetectionOutputKernelBase : public common_kernel_base
78 using common_kernel_base :: common_kernel_base;
79 virtual ~DetectionOutputKernelBase() {}
81 using DispatchData = CommonDispatchData;
84 JitConstants GetJitConstants(const detection_output_params& params) const;
85 virtual DispatchData SetDefault(const detection_output_params& params) const;