Path: blob/master/modules/dnn/src/vkcom/include/op_lrn.hpp
16350 views
// This file is part of OpenCV project.1// It is subject to the license terms in the LICENSE file found in the top-level directory2// of this distribution and at http://opencv.org/license.html.3//4// Copyright (C) 2018, Intel Corporation, all rights reserved.5// Third party copyrights are property of their respective owners.67#ifndef OPENCV_DNN_VKCOM_OP_LRN_HPP8#define OPENCV_DNN_VKCOM_OP_LRN_HPP910#include "vkcom.hpp"11#include "op_base.hpp"1213namespace cv { namespace dnn { namespace vkcom {1415#ifdef HAVE_VULKAN1617enum LRNShaderType18{19kLRNShaderTypeBasic = 0,20kLRNShaderTypeNum21};2223struct LRNShaderConfig24{25int local_size_x;26int local_size_y;27int local_size_z;28int block_height;29int block_width;30int block_depth;31LRNShaderType shader_type;32};3334class OpLRN : public OpBase35{36public:37OpLRN(const int radius, const float bias,38const float alpha, const float beta,39const bool norm_by_size);40void reshapeOutTensor(Tensor& in, Tensor& out);41bool forward(Tensor& in, Tensor& out);42virtual bool forward(std::vector<Tensor>& ins,43std::vector<Tensor>& blobs,44std::vector<Tensor>& outs) CV_OVERRIDE;4546private:47bool init(const int radius, const float bias,48const float alpha, const float beta,49const bool norm_by_size);50bool computeGroupCount();51int batch_;52int height_;53int width_;54int channels_;55int radius_;56float bias_;57float alpha_;58float beta_;59int filter_len_;60int thread_num_;61bool norm_by_size_;62LRNShaderConfig config_;63};6465#endif // HAVE_VULKAN6667}}} // namespace cv::dnn::vkcom6869#endif // OPENCV_DNN_VKCOM_OP_LRN_HPP707172