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

42 lines
1.1 KiB
C++
Raw Normal View History

2019-04-17 10:49:11 +08:00
//
// UnaryBufExecution.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 UnaryBufExecution_hpp
#define UnaryBufExecution_hpp
2019-04-17 10:49:11 +08:00
2019-12-27 22:16:57 +08:00
#include "core/Execution.hpp"
2019-04-17 10:49:11 +08:00
#include <vector>
#include "MNN_generated.h"
2019-12-27 22:16:57 +08:00
#include "backend/opencl/core/OpenCLBackend.hpp"
#include "backend/opencl/core/OpenCLRunningUtils.hpp"
2019-04-17 10:49:11 +08:00
namespace MNN {
namespace OpenCL {
class UnaryBufExecution : public Execution {
2019-04-17 10:49:11 +08:00
public:
UnaryBufExecution(const std::string &compute, Backend *backend);
virtual ~UnaryBufExecution() = default;
2019-04-17 10:49:11 +08:00
2019-12-27 22:16:57 +08:00
virtual ErrorCode onResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
2019-04-17 10:49:11 +08:00
virtual ErrorCode onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
private:
cl::Kernel mKernel;
uint32_t mMaxWorkGroupSize;
std::vector<uint32_t> mGlobalWorkSize = {1, 1, 1};
2019-12-27 22:16:57 +08:00
std::vector<uint32_t> mLocalSize = {1, 1, 1};
2019-04-17 10:49:11 +08:00
};
} // namespace OpenCL
} // namespace MNN
#endif /* UnaryBufExecution_hpp */
#endif/* MNN_OPENCL_BUFFER_CLOSED */