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"
30#include "util/logging.h"
31#include "AclKernelGen.h"
32
34{
35
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
45std::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
This file defines NopFunction.
std::unique_ptr< exec::FunctionSequence > generate(ir::OperationIndex ind) override
KernelGenerator(const ir::Graph &graph, const std::shared_ptr< TensorBuilder > &tensor_builder, const std::shared_ptr< acl_common::AclTensorRegistry< TensorManager > > &_tensor_reg)
Tensor registry class for acl backends.
std::unique_ptr< exec::IFunction > releaseFunction()
const Operations & operations() const override
Definition Graph.h:105
const Object & at(const Index &index) const
Get the object that is associated with the given index.