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
20
#include <
backend/basic/KernelGeneratorBase.h
>
21
22
#include "
TensorBuilder.h
"
23
#include "
AclTensorRegistry.h
"
24
#include "
TensorManager.h
"
25
26
namespace
onert
27
{
28
namespace
backend
29
{
30
namespace
acl_cl
31
{
32
33
class
KernelGenerator
:
public
basic::KernelGeneratorBase
34
{
35
public
:
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
41
private
:
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
89
private
:
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__
AclTensorRegistry.h
KernelGeneratorBase.h
onert::backend::acl_cl::KernelGenerator
Definition
KernelGenerator.h:34
onert::backend::acl_cl::KernelGenerator::generate
std::unique_ptr< exec::FunctionSequence > generate(ir::OperationIndex ind) override
Definition
KernelGenerator.cc:55
onert::backend::acl_common::AclTensorRegistry
Tensor registry class for acl backends.
Definition
AclTensorRegistry.h:35
onert::backend::basic::KernelGeneratorBase
Definition
KernelGeneratorBase.h:37
onert::ir::Graph
Definition
Graph.h:34
onert::ir::Operands
Definition
Operands.h:33
onert::ir::Operations
Definition
Operations.h:30
onert::ir::operation::ArgMinMax
Definition
ArgMinMax.h:30
onert::ir::operation::BatchToSpaceND
Definition
BatchToSpaceND.h:30
onert::ir::operation::BinaryArithmetic
Definition
BinaryArithmetic.h:31
onert::ir::operation::Comparison
Definition
Comparison.h:30
onert::ir::operation::Concat
Definition
Concat.h:32
onert::ir::operation::Conv2D
Definition
Conv2D.h:34
onert::ir::operation::ConvertFp16ToFp32
Definition
ConvertFp16ToFp32.h:30
onert::ir::operation::ConvertFp32ToFp16
Definition
ConvertFp32ToFp16.h:30
onert::ir::operation::DepthToSpace
Definition
DepthToSpace.h:32
onert::ir::operation::DepthwiseConv2D
Definition
DepthwiseConv2D.h:34
onert::ir::operation::ElementwiseActivation
Definition
ElementwiseActivation.h:30
onert::ir::operation::ElementwiseBinary
Definition
ElementwiseBinary.h:30
onert::ir::operation::ElementwiseUnary
Definition
ElementwiseUnary.h:30
onert::ir::operation::EmbeddingLookup
Definition
EmbeddingLookup.h:30
onert::ir::operation::ExpandDims
Definition
ExpandDims.h:32
onert::ir::operation::FullyConnected
Definition
FullyConnected.h:33
onert::ir::operation::Gather
Definition
Gather.h:32
onert::ir::operation::HashtableLookup
Definition
HashtableLookup.h:30
onert::ir::operation::InstanceNorm
Definition
InstanceNorm.h:31
onert::ir::operation::L2Normalization
Definition
L2Normalization.h:30
onert::ir::operation::LSTM
Definition
LSTM.h:31
onert::ir::operation::LocalResponseNormalization
Definition
LocalResponseNormalization.h:32
onert::ir::operation::OneHot
Definition
OneHot.h:30
onert::ir::operation::PReLU
Definition
PReLU.h:30
onert::ir::operation::Pack
Definition
Pack.h:28
onert::ir::operation::Pad
Definition
Pad.h:30
onert::ir::operation::Pool2D
Definition
Pool2D.h:34
onert::ir::operation::RNN
Definition
RNN.h:30
onert::ir::operation::Reduce
Definition
Reduce.h:32
onert::ir::operation::Reshape
Definition
Reshape.h:32
onert::ir::operation::ResizeBilinear
Definition
ResizeBilinear.h:32
onert::ir::operation::ResizeNearestNeighbor
Definition
ResizeNearestNeighbor.h:32
onert::ir::operation::Reverse
Definition
Reverse.h:30
onert::ir::operation::Slice
Definition
Slice.h:30
onert::ir::operation::Softmax
Definition
Softmax.h:32
onert::ir::operation::SpaceToBatchND
Definition
SpaceToBatchND.h:32
onert::ir::operation::SpaceToDepth
Definition
SpaceToDepth.h:32
onert::ir::operation::Split
Definition
Split.h:28
onert::ir::operation::SplitV
Definition
SplitV.h:28
onert::ir::operation::SquaredDifference
Definition
SquaredDifference.h:30
onert::ir::operation::Squeeze
Definition
Squeeze.h:30
onert::ir::operation::StridedSlice
Definition
StridedSlice.h:32
onert::ir::operation::TopKV2
Definition
TopKV2.h:32
onert::ir::operation::TransposeConv
Definition
TransposeConv.h:34
onert::ir::operation::Transpose
Definition
Transpose.h:32
onert::ir::operation::Unpack
Definition
Unpack.h:28
onert::util::Index< uint32_t, OperationIndexTag >
TensorBuilder.h
onert
Definition
CustomKernel.cc:20
TensorManager.h
runtime
onert
backend
acl_cl
KernelGenerator.h
Generated by
1.9.8