MNN/source/backend/opencl/execution/image/ReductionExecution.hpp

36 lines
921 B
C++
Raw Permalink Normal View History

2019-12-27 22:16:57 +08:00
//
// ReductionExecution.hpp
// MNN
//
// Created by MNN on 2019/10/25.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef ReductionExecution_hpp
#define ReductionExecution_hpp
2024-04-19 11:58:21 +08:00
#include "CommonExecution.hpp"
2019-12-27 22:16:57 +08:00
namespace MNN {
namespace OpenCL {
class ReductionExecution : public CommonExecution {
public:
2024-04-19 11:58:21 +08:00
ReductionExecution(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs, const MNN::Op* op, Backend* backend);
2019-12-27 22:16:57 +08:00
virtual ~ReductionExecution() = default;
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;
2020-11-05 16:41:56 +08:00
int mReductType;
2023-09-04 10:42:11 +08:00
int mAxis;
2020-11-05 16:41:56 +08:00
bool mUseLocal = false;
2023-12-27 17:26:44 +08:00
uint32_t mMaxWorkGroupSize;
2019-12-27 22:16:57 +08:00
};
} // namespace OpenCL
} // namespace MNN
#endif /* ReductionExecution_hpp */