MNN/source/backend/cuda/execution/PoolExecution.hpp

42 lines
1.1 KiB
C++

//
// PoolExecution.hpp
// MNN
//
// Created by MNN on 2020/07/29.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef PoolExecution_hpp
#define PoolExecution_hpp
#include <vector>
#include "backend/cuda/core/CUDABackend.hpp"
#include "core/Execution.hpp"
#include "bf16/PoolBf16.cuh"
namespace MNN {
namespace CUDA {
class PoolExecution : public Execution {
public:
PoolExecution(const Pool *pool, Backend *backend) : Execution(backend) {
mParameter = pool;
}
virtual ~PoolExecution() {
// Do nothing
}
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;
private:
const Pool *mParameter;
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};
};
}; // namespace CUDA
}; // namespace MNN
#endif