1 //
2 //  UnaryExecution.hpp
3 //  MNN
4 //
5 //  Created by MNN on 2019/01/31.
6 //  Copyright © 2018, Alibaba Group Holding Limited
7 //
8 
9 #ifndef UnaryExecution_hpp
10 #define UnaryExecution_hpp
11 
12 #include "core/Execution.hpp"
13 
14 #include <vector>
15 #include "MNN_generated.h"
16 #include "backend/opencl/core/OpenCLBackend.hpp"
17 #include "backend/opencl/core/OpenCLRunningUtils.hpp"
18 
19 namespace MNN {
20 namespace OpenCL {
21 
22 class UnaryExecution : public Execution {
23 public:
24     UnaryExecution(const std::string &compute, Backend *backend);
25     virtual ~UnaryExecution() = default;
26 
27     virtual ErrorCode onResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
28     virtual ErrorCode onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
29 
30 private:
31     cl::Kernel mKernel;
32     uint32_t mMaxWorkGroupSize;
33     std::vector<uint32_t> mGlobalWorkSize = {1, 1, 1};
34     std::vector<uint32_t> mLocalSize = {1, 1, 1};
35 };
36 
37 } // namespace OpenCL
38 } // namespace MNN
39 #endif /* UnaryExecution_hpp */
40