Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/dnn/src/vkcom/include/op_concat.hpp
16354 views
1
// This file is part of OpenCV project.
2
// It is subject to the license terms in the LICENSE file found in the top-level directory
3
// of this distribution and at http://opencv.org/license.html.
4
//
5
// Copyright (C) 2018, Intel Corporation, all rights reserved.
6
// Third party copyrights are property of their respective owners.
7
8
#ifndef OPENCV_DNN_VKCOM_OP_CONCAT_HPP
9
#define OPENCV_DNN_VKCOM_OP_CONCAT_HPP
10
11
#include "vkcom.hpp"
12
#include "op_base.hpp"
13
14
namespace cv { namespace dnn { namespace vkcom {
15
16
#ifdef HAVE_VULKAN
17
18
struct ConcatShaderConfig
19
{
20
int local_size_x;
21
int local_size_y;
22
int local_size_z;
23
int block_height;
24
int block_width;
25
int block_depth;
26
};
27
28
class OpConcat: public OpBase
29
{
30
public:
31
OpConcat(const int axis);
32
bool forward(std::vector<Tensor>& ins, Tensor& out);
33
void reshapeOutTensor(std::vector<Tensor *>& in, Tensor& out);
34
virtual bool forward(std::vector<Tensor>& ins,
35
std::vector<Tensor>& blobs,
36
std::vector<Tensor>& outs) CV_OVERRIDE;
37
38
private:
39
bool init(const int axis);
40
bool computeGroupCount();
41
42
ConcatShaderConfig config_;
43
int axis_;
44
int out_concat_axis_;
45
int accumulated_concat_axis_;
46
int concat_size_;
47
int total_concat_size_;
48
int thread_num_;
49
};
50
51
#endif // HAVE_VULKAN
52
53
}}} // namespace cv::dnn::vkcom
54
55
#endif // OPENCV_DNN_VKCOM_OP_CONCAT_HPP
56
57