Imported Upstream version 1.25.0
[platform/core/ml/nnfw.git] / onert-micro / luci-interpreter / src / kernels / KernelBuilder.cpp
1 /*
2  * Copyright (c) 2023 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 "KernelBuilder.h"
18
19 namespace luci_interpreter
20 {
21
22 void KernelConfigureRegistry::configure_kernel(const circle::Operator *cur_op,
23                                                circle::BuiltinOperator opcode,
24                                                BaseRuntimeGraph *runtime_graph) const
25 {
26   auto specific_configure_func = get_kernel_configure_func(opcode);
27   if (specific_configure_func == nullptr)
28     assert(false && "Unsupported operator");
29
30   specific_configure_func(cur_op, runtime_graph);
31 }
32
33 void KernelExecuteRegistry::execute_kernel(const circle::Operator *cur_op,
34                                            circle::BuiltinOperator opcode,
35                                            BaseRuntimeGraph *runtime_graph) const
36 {
37   auto specific_execute_func = get_kernel_execute_func(opcode);
38   if (specific_execute_func == nullptr)
39     assert(false && "Unsupported operator");
40
41   specific_execute_func(cur_op, runtime_graph);
42 }
43
44 } // namespace luci_interpreter