2019-12-27 22:16:57 +08:00
|
|
|
//
|
2021-03-12 18:41:50 +08:00
|
|
|
// ReductionBufExecution.hpp
|
2019-12-27 22:16:57 +08:00
|
|
|
// MNN
|
|
|
|
//
|
|
|
|
// Created by MNN on 2019/10/25.
|
|
|
|
// Copyright © 2018, Alibaba Group Holding Limited
|
|
|
|
//
|
|
|
|
|
2021-03-12 18:41:50 +08:00
|
|
|
#ifndef MNN_OPENCL_BUFFER_CLOSED
|
|
|
|
|
|
|
|
#ifndef ReductionBufExecution_hpp
|
|
|
|
#define ReductionBufExecution_hpp
|
2019-12-27 22:16:57 +08:00
|
|
|
|
2021-03-12 18:41:50 +08:00
|
|
|
#include "backend/opencl/execution/image/CommonExecution.hpp"
|
2019-12-27 22:16:57 +08:00
|
|
|
|
|
|
|
namespace MNN {
|
|
|
|
namespace OpenCL {
|
|
|
|
|
2021-03-12 18:41:50 +08:00
|
|
|
class ReductionBufExecution : public CommonExecution {
|
2019-12-27 22:16:57 +08:00
|
|
|
public:
|
2024-04-19 11:58:21 +08:00
|
|
|
ReductionBufExecution(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs, const MNN::Op* op, Backend* backend);
|
2021-03-12 18:41:50 +08:00
|
|
|
virtual ~ReductionBufExecution() = default;
|
2019-12-27 22:16:57 +08:00
|
|
|
|
2024-04-19 11:58:21 +08:00
|
|
|
virtual ErrorCode onEncode(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
|
2019-12-27 22:16:57 +08:00
|
|
|
private:
|
2023-09-04 10:42:11 +08:00
|
|
|
int getLocalSize(int size, int maxGroupSize);
|
2019-12-27 22:16:57 +08:00
|
|
|
OpenCLBackend *mOpenCLBackend;
|
|
|
|
MNN::DataType mdataType;
|
2023-09-04 10:42:11 +08:00
|
|
|
int mAxis;
|
2019-12-27 22:16:57 +08:00
|
|
|
std::vector<uint32_t> mGlobalWorkSize = {1, 1, 1};
|
|
|
|
std::vector<uint32_t> mLocalWorkSize{1, 1, 1};
|
2023-12-27 17:26:44 +08:00
|
|
|
uint32_t mMaxWorkGroupSize;
|
2024-09-12 12:57:57 +08:00
|
|
|
std::set<std::string> mBuildOptions;
|
2019-12-27 22:16:57 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace OpenCL
|
|
|
|
} // namespace MNN
|
2021-03-12 18:41:50 +08:00
|
|
|
#endif /* ReductionBufExecution_hpp */
|
|
|
|
#endif /* MNN_OPENCL_BUFFER_CLOSED */
|