ONE - On-device Neural Engine
Loading...
Searching...
No Matches
KernelGenerator.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 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_GGML_KERNEL_GENERATOR_H__
18#define __ONERT_BACKEND_GGML_KERNEL_GENERATOR_H__
19
20#include "ExternalContext.h"
21#include "TensorBuilder.h"
23#include "Tensor.h"
24
26#include <ir/Operands.h>
27#include <ir/Operations.h>
28
30{
31
33{
34public:
35 KernelGenerator(const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
36 const std::shared_ptr<basic::TensorRegistry> &tensor_reg,
37 const std::shared_ptr<ExternalContext> &external_context);
38
39 std::unique_ptr<exec::FunctionSequence> generate(ir::OperationIndex ind) override;
40
41private:
42#define OP(InternalName) void visit(const ir::operation::InternalName &) override;
43#include "Operation.lst"
44#undef OP
45
46private:
47 const ir::Operands &_ctx;
48 const ir::Operations &_operations_ctx;
49 std::shared_ptr<TensorBuilder> _tensor_builder;
50 std::shared_ptr<basic::TensorRegistry> _tensor_reg;
51 const std::shared_ptr<ExternalContext> _external_context;
52};
53
54} // namespace onert::backend::ggml
55
56#endif // __ONERT_BACKEND_GGML_KERNEL_GENERATOR_H__
std::unique_ptr< exec::FunctionSequence > generate(ir::OperationIndex ind) override