forked from alibaba/MNN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConvWinograd.hpp
More file actions
56 lines (45 loc) · 1.34 KB
/
Copy pathConvWinograd.hpp
File metadata and controls
56 lines (45 loc) · 1.34 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
47
48
49
50
51
52
53
54
55
56
//
// ConvWinograd.hpp
// MNN
//
// Created by MNN on 2019/02/01.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef conv_winograd_hpp
#define conv_winograd_hpp
#include "Execution.hpp"
#include <array>
#include <memory>
#include <vector>
#include "execution/ConvExecution.hpp"
namespace MNN {
namespace OpenCL {
class ConvWinograd : public Execution {
public:
virtual ~ConvWinograd() = default;
ConvWinograd(const MNN::Convolution2D* op, Backend* backend);
virtual ErrorCode onResize(const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs) override;
virtual ErrorCode onExecute(const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs) override;
static bool valid(const Convolution2DCommon* common, const Tensor* input, int limit = 8192);
private:
OpenCLBackend* mOpenCLBackend;
const Convolution2DCommon* mCommon;
int mKernelX;
int mKernelY;
int mPadX;
int mPadY;
int mStrideX;
int mStrideY;
MNN::PadMode mPadMode;
std::shared_ptr<cl::Image2D> mWeight;
std::shared_ptr<cl::Image2D> mBias;
std::shared_ptr<Tensor> mSource;
std::shared_ptr<Tensor> mDest;
cl::Kernel mSourceTransform;
cl::Kernel mDestTransform;
cl::Kernel mMatMul;
int mSliceNumber;
};
} // namespace OpenCL
} // namespace MNN
#endif /* conv_winograd_hpp */