Path: blob/master/modules/dnn/src/vkcom/include/op_permute.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_PERMUTE_HPP8#define OPENCV_DNN_VKCOM_OP_PERMUTE_HPP910#include "vkcom.hpp"11#include "op_base.hpp"1213namespace cv { namespace dnn { namespace vkcom {1415#ifdef HAVE_VULKAN1617class OpPermute: public OpBase18{19public:20OpPermute(std::vector<size_t>& order);21bool forward(std::vector<Tensor>& ins, std::vector<Tensor>& outs);22void reshapeOutTensor(std::vector<Tensor *>& in, std::vector<Tensor>& outs);23virtual bool forward(std::vector<Tensor>& ins,24std::vector<Tensor>& blobs,25std::vector<Tensor>& outs) CV_OVERRIDE;2627private:28void prepareStrides(const Shape &shape_before, const Shape &shape_after);29bool computeGroupCount();3031std::vector<int> order_;32bool need_permute_;33int global_size_;34int nthreads_;35int dims_;36Tensor tensor_order_;37Tensor tensor_old_stride_;38Tensor tensor_new_stride_;39std::vector<int> old_stride_;40std::vector<int> new_stride_;41Shape in_shape_;42Shape out_shape_;43};4445#endif // HAVE_VULKAN4647}}} // namespace cv::dnn::vkcom4849#endif // OPENCV_DNN_VKCOM_OP_PERMUTE_HPP505152