Path: blob/master/modules/dnn/src/vkcom/include/op_pool.hpp
16344 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_POOL_HPP8#define OPENCV_DNN_VKCOM_OP_POOL_HPP910#include "vkcom.hpp"11#include "op_base.hpp"1213namespace cv { namespace dnn { namespace vkcom {1415#ifdef HAVE_VULKAN1617enum PoolType { kPoolTypeAvg, kPoolTypeMax, kPoolTypeNum };1819struct PoolShaderConfig20{21int local_size_x;22int local_size_y;23int local_size_z;24int block_height;25int block_width;26int block_depth;27};2829class OpPool: public OpBase30{31public:32OpPool(const int* filter_size, const int* pad, const int* stride,33const int padding_mode, const PoolType pool_type,34const bool avg_pool_padded_area);35bool forward(Tensor& in, Tensor& out, Tensor& mask);36void reshapeOutTensor(Tensor& in, Tensor& out);37virtual bool forward(std::vector<Tensor>& ins,38std::vector<Tensor>& blobs,39std::vector<Tensor>& outs) CV_OVERRIDE;40private:41bool init(const int* filter_size, const int* pad, const int* stride,42const int padding_mode, const PoolType type, const bool avg_pool_padded_area);43bool computeGroupCount();4445int batch_;46int channels_;47int in_height_;48int in_width_;49int out_height_;50int out_width_;51int filter_height_;52int filter_width_;53int stride_height_;54int stride_width_;55int padding_left_;56int padding_top_;57PoolType pool_type_;58int avg_pool_padded_area_;59int need_mask_;60PaddingMode padding_mode_;61int activation_;62PoolShaderConfig config_;63};6465#endif // HAVE_VULKAN6667}}} // namespace cv::dnn::vkcom6869#endif // OPENCV_DNN_VKCOM_OP_POOL_HPP707172