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

47 lines
1.4 KiB
C++
Raw Normal View History

2019-04-17 10:49:11 +08:00
//
// PoolBufExecution.hpp
2019-04-17 10:49:11 +08:00
// MNN
//
// Created by MNN on 2019/01/31.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef MNN_OPENCL_BUFFER_CLOSED
#ifndef PoolBufExecution_hpp
#define PoolBufExecution_hpp
2019-04-17 10:49:11 +08:00
2024-04-19 11:58:21 +08:00
#include "backend/opencl/execution/image/CommonExecution.hpp"
2019-04-17 10:49:11 +08:00
namespace MNN {
namespace OpenCL {
2024-04-19 11:58:21 +08:00
class PoolBufExecution : public CommonExecution {
2019-04-17 10:49:11 +08:00
public:
PoolBufExecution(const std::vector<Tensor *> &inputs, const MNN::Op *op, Backend *backend);
virtual ~PoolBufExecution() = default;
2019-04-17 10:49:11 +08:00
2024-04-19 11:58:21 +08:00
virtual ErrorCode onEncode(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
2024-02-29 16:21:40 +08:00
int getLocalSize(int size, int maxGroupSize);
2019-04-17 10:49:11 +08:00
private:
2023-07-31 14:24:48 +08:00
#ifdef MNN_SUPPORT_INTEL_SUBGROUP
ErrorCode SubgrouponResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs);
#endif /* MNN_SUPPORT_INTEL_SUBGROUP */
2019-04-17 10:49:11 +08:00
const Pool *mPoolParams;
std::vector<uint32_t> mGlobalWorkSize{1, 1, 1};
std::vector<uint32_t> mLocalWorkSize{1, 1, 1, 1};
PoolType mPoolType;
PoolPadType mPadType;
std::vector<int> mStrides{1, 1};
std::vector<int> mKernels{1, 1};
std::vector<int> mPaddings{0, 0};
std::vector<int> mDilations{1, 1};
uint32_t mMaxWorkGroupSize;
OpenCLBackend *mOpenCLBackend;
};
} // namespace OpenCL
} // namespace MNN
#endif /* PoolBufExecution_hpp */
#endif /* MNN_OPENCL_BUFFER_CLOSED */