ONE - On-device Neural Engine
Loading...
Searching...
No Matches
KernelGenerator.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __ONERT_BACKEND_ACL_CL_KERNEL_GENERATOR_H__
18#define __ONERT_BACKEND_ACL_CL_KERNEL_GENERATOR_H__
19
21
22#include "TensorBuilder.h"
23#include "AclTensorRegistry.h"
24#include "TensorManager.h"
25
26namespace onert
27{
28namespace backend
29{
30namespace acl_cl
31{
32
34{
35public:
36 KernelGenerator(const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
37 const std::shared_ptr<acl_common::AclTensorRegistry<TensorManager>> &_tensor_reg);
38
39 std::unique_ptr<exec::FunctionSequence> generate(ir::OperationIndex ind) override;
40
41private:
42 void visit(const ir::operation::ArgMinMax &) override;
43 void visit(const ir::operation::BatchToSpaceND &) override;
44 void visit(const ir::operation::BinaryArithmetic &) override;
45 void visit(const ir::operation::Comparison &) override;
46 void visit(const ir::operation::Concat &) override;
47 void visit(const ir::operation::Conv2D &) override;
48 void visit(const ir::operation::ConvertFp16ToFp32 &) override;
49 void visit(const ir::operation::ConvertFp32ToFp16 &) override;
50 void visit(const ir::operation::DepthToSpace &) override;
51 void visit(const ir::operation::DepthwiseConv2D &) override;
52 void visit(const ir::operation::ElementwiseActivation &) override;
53 void visit(const ir::operation::ElementwiseBinary &) override;
54 void visit(const ir::operation::ElementwiseUnary &) override;
55 void visit(const ir::operation::EmbeddingLookup &) override;
56 void visit(const ir::operation::ExpandDims &) override;
57 void visit(const ir::operation::FullyConnected &) override;
58 void visit(const ir::operation::Gather &) override;
59 void visit(const ir::operation::HashtableLookup &) override;
60 void visit(const ir::operation::InstanceNorm &) override;
61 void visit(const ir::operation::L2Normalization &) override;
62 void visit(const ir::operation::LocalResponseNormalization &) override;
63 void visit(const ir::operation::LSTM &) override;
64 void visit(const ir::operation::OneHot &) override;
65 void visit(const ir::operation::Pack &) override;
66 void visit(const ir::operation::Pad &) override;
67 void visit(const ir::operation::Pool2D &) override;
68 void visit(const ir::operation::PReLU &) override;
69 void visit(const ir::operation::Reduce &) override;
70 void visit(const ir::operation::Reshape &) override;
71 void visit(const ir::operation::ResizeBilinear &) override;
72 void visit(const ir::operation::ResizeNearestNeighbor &) override;
73 void visit(const ir::operation::Reverse &) override;
74 void visit(const ir::operation::RNN &) override;
75 void visit(const ir::operation::Slice &) override;
76 void visit(const ir::operation::Softmax &) override;
77 void visit(const ir::operation::SpaceToBatchND &) override;
78 void visit(const ir::operation::SpaceToDepth &) override;
79 void visit(const ir::operation::Split &) override;
80 void visit(const ir::operation::SplitV &) override;
81 void visit(const ir::operation::SquaredDifference &) override;
82 void visit(const ir::operation::Squeeze &) override;
83 void visit(const ir::operation::StridedSlice &) override;
84 void visit(const ir::operation::TopKV2 &) override;
85 void visit(const ir::operation::Transpose &) override;
86 void visit(const ir::operation::TransposeConv &) override;
87 void visit(const ir::operation::Unpack &) override;
88
89private:
90 const ir::Operands &_ctx;
91 const ir::Operations &_operations_ctx;
92 std::shared_ptr<TensorBuilder> _tensor_builder;
93 std::shared_ptr<acl_common::AclTensorRegistry<TensorManager>> _tensor_reg;
94};
95
96} // namespace acl_cl
97} // namespace backend
98} // namespace onert
99
100#endif // __ONERT_BACKEND_ACL_CL_KERNEL_GENERATOR_H__
std::unique_ptr< exec::FunctionSequence > generate(ir::OperationIndex ind) override
Tensor registry class for acl backends.