MNN/source/backend/opencl/execution/buffer/RasterBufExecution.hpp

50 lines
1.4 KiB
C++
Raw Normal View History

2020-11-05 16:41:56 +08:00
//
// RasterBufExecution.hpp
2020-11-05 16:41:56 +08:00
// MNN
//
// Created by MNN on 2020/05/12.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef MNN_OPENCL_BUFFER_CLOSED
#ifndef RaterBufExecution_hpp
#define RaterBufExecution_hpp
#include "backend/opencl/execution/image/CommonExecution.hpp"
2020-11-05 16:41:56 +08:00
namespace MNN {
namespace OpenCL {
class RasterBufExecution : public CommonExecution {
2020-11-05 16:41:56 +08:00
public:
2025-01-22 14:47:50 +08:00
class CanCombineInfo {
public:
CanCombineInfo(const Tensor::InsideDescribe::Region region, const int src_offset, const int dst_offset, const int canCombineNum) : mRegion(region), mSrc_offset(src_offset), mDst_offset(dst_offset), mCanCombineNum(canCombineNum){
// Do nothing
}
int mSrc_offset;
int mDst_offset;
int mCanCombineNum;
Tensor::InsideDescribe::Region mRegion;
};
2021-09-27 11:18:24 +08:00
RasterBufExecution(const std::vector<Tensor *> &inputs, const MNN::Op *op, Backend *backend);
virtual ~RasterBufExecution() = default;
2020-11-05 16:41:56 +08:00
2024-04-19 11:58:21 +08:00
virtual ErrorCode onEncode(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
2020-11-05 16:41:56 +08:00
private:
2025-01-22 14:47:50 +08:00
void CanCombine(const std::vector<Tensor *> &outputs);
2020-11-05 16:41:56 +08:00
std::map<Tensor*, cl::Buffer *> mTempInput;
cl::Buffer *mTempOutput;
OpenCLBackend *mOpenCLBackend;
bool mNeedZero = false;
bool mFast = false;
2025-01-22 14:47:50 +08:00
std::vector<CanCombineInfo> mCombineInfo;
2020-11-05 16:41:56 +08:00
};
} // namespace OpenCL
} // namespace MNN
#endif
#endif /* MNN_OPENCL_BUFFER_CLOSED */