ONE - On-device Neural Engine
Loading...
Searching...
No Matches
KernelGenerator.cc
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
#include "
KernelGenerator.h
"
18
19
#include <arm_compute/runtime/CL/CLFunctions.h>
// Include all ARM Compute CL functions
20
#include <
arm_compute/runtime/CL/CLFunctionsEx.h
>
// Include all ARM Compute EX CL functions
21
22
#include <Convert.h>
23
#include <
Swizzle.h
>
24
25
#include "ir/Index.h"
26
#include "ir/DataType.h"
27
#include "
ir/InternalType.h
"
28
#include "
exec/NopFunction.h
"
29
#include "
exec/FunctionSequence.h
"
30
#include "
util/logging.h
"
31
#include "
AclKernelGen.h
"
32
33
namespace
onert::backend::acl_cl
34
{
35
36
KernelGenerator::KernelGenerator
(
37
const
ir::Graph
&graph,
const
std::shared_ptr<TensorBuilder> &tensor_builder,
38
const
std::shared_ptr<
acl_common::AclTensorRegistry<TensorManager>
> &tensor_reg)
39
: basic::KernelGeneratorBase{graph}, _ctx(graph.operands()), _operations_ctx(graph.operations()),
40
_tensor_builder(tensor_builder), _tensor_reg(tensor_reg)
41
{
42
// DO NOTHING
43
}
44
45
std::unique_ptr<exec::FunctionSequence>
KernelGenerator::generate
(
ir::OperationIndex
ind)
46
{
47
auto
ret = std::make_unique<exec::FunctionSequence>();
48
ret->enableDynamicShapeInferer(
false
);
49
50
const
auto
&op =
_graph
.
operations
().
at
(ind);
51
op.accept(*
this
);
52
ret->append(
releaseFunction
());
53
return
ret;
54
}
55
56
}
// namespace onert::backend::acl_cl
AclKernelGen.h
CLFunctionsEx.h
FunctionSequence.h
InternalType.h
NopFunction.h
This file defines NopFunction.
Swizzle.h
onert::backend::acl_cl::KernelGenerator::generate
std::unique_ptr< exec::FunctionSequence > generate(ir::OperationIndex ind) override
Definition
KernelGenerator.cc:45
onert::backend::acl_cl::KernelGenerator::KernelGenerator
KernelGenerator(const ir::Graph &graph, const std::shared_ptr< TensorBuilder > &tensor_builder, const std::shared_ptr< acl_common::AclTensorRegistry< TensorManager > > &_tensor_reg)
Definition
KernelGenerator.cc:36
onert::backend::acl_common::AclTensorRegistry
Tensor registry class for acl backends.
Definition
AclTensorRegistry.h:31
onert::backend::basic::KernelGeneratorBase::releaseFunction
std::unique_ptr< exec::IFunction > releaseFunction()
Definition
KernelGeneratorBase.h:52
onert::backend::basic::KernelGeneratorBase::_graph
const ir::Graph & _graph
Definition
KernelGeneratorBase.h:59
onert::ir::Graph
Definition
Graph.h:32
onert::ir::Graph::operations
const Operations & operations() const override
Definition
Graph.h:105
onert::util::Index< uint32_t, OperationIndexTag >
onert::util::ObjectManager::at
const Object & at(const Index &index) const
Get the object that is associated with the given index.
Definition
ObjectManager.h:119
KernelGenerator.h
onert::backend::acl_cl
Definition
Backend.h:33
logging.h
runtime
onert
backend
acl_cl
KernelGenerator.cc
Generated by
1.9.8