2019-04-17 10:49:11 +08:00
|
|
|
//
|
|
|
|
// CommonExecution.hpp
|
|
|
|
// MNN
|
|
|
|
//
|
|
|
|
// Created by MNN on 2019/02/28.
|
|
|
|
// Copyright © 2018, Alibaba Group Holding Limited
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef CommonExecution_hpp
|
|
|
|
#define CommonExecution_hpp
|
2019-12-27 22:16:57 +08:00
|
|
|
#include "core/Execution.hpp"
|
|
|
|
#include "backend/opencl/core/OpenCLBackend.hpp"
|
2019-04-17 10:49:11 +08:00
|
|
|
namespace MNN {
|
|
|
|
namespace OpenCL {
|
|
|
|
|
|
|
|
class CommonExecution : public Execution {
|
|
|
|
public:
|
|
|
|
CommonExecution(Backend *backend);
|
|
|
|
virtual ~CommonExecution() = default;
|
|
|
|
|
|
|
|
virtual ErrorCode onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
struct Unit {
|
|
|
|
cl::Kernel kernel;
|
|
|
|
cl::NDRange globalWorkSize;
|
|
|
|
cl::NDRange localWorkSize;
|
|
|
|
};
|
|
|
|
std::vector<Unit> mUnits;
|
2020-11-05 16:41:56 +08:00
|
|
|
const MNN::Op *mOp;
|
2023-04-27 15:11:05 +08:00
|
|
|
OpType mOpType;
|
2019-04-17 10:49:11 +08:00
|
|
|
};
|
|
|
|
} // namespace OpenCL
|
|
|
|
} // namespace MNN
|
|
|
|
#endif /* CommonExecution_hpp */
|