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