forked from alibaba/MNN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGLConvolutionIm2col.hpp
More file actions
46 lines (41 loc) · 1.33 KB
/
Copy pathGLConvolutionIm2col.hpp
File metadata and controls
46 lines (41 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// GLConvolutionIm2col.hpp
// MNN
//
// Created by MNN on 2019/01/31.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef GLCONVOLUTION_IM2COL_H
#define GLCONVOLUTION_IM2COL_H
#include <functional>
#include "Execution.hpp"
#include "GLProgram.hpp"
#include "GLSSBOBuffer.hpp"
#include "GLTexture.hpp"
#include "MNN_generated.h"
namespace MNN {
namespace OpenGL {
class GLConvolutionIm2col : public GPUConvolution {
public:
GLConvolutionIm2col(const std::vector<Tensor *> &inputs, const Op *convOp, Backend *b);
virtual ~GLConvolutionIm2col();
virtual ErrorCode onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
virtual ErrorCode onResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
private:
GLBackend * mGLBackend;
std::shared_ptr<GLTexture> mKernelTexture;
std::shared_ptr<GLTexture> mSrcTexture;
std::shared_ptr<GLTexture> mDstTexture;
std::shared_ptr<GLSSBOBuffer> mBiasBuffer;
std::shared_ptr<GLProgram> mIm2ColProgram;
std::shared_ptr<GLProgram> mGemm16x16Program;
std::shared_ptr<GLProgram> mCol2ImProgram;
int obxohxow_4;
int mIm2colSize[3];
int mGemmSize[3];
int mCol2imSize[3];
bool mIsConv1x1;
};
} // namespace OpenGL
} // namespace MNN
#endif // GLCONVOLUTION_IM2COL_H