2 * Copyright (c) 2021 Samsung Electronics Co., Ltd. All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __LUCI_CIRCLE_IMPORT_METADATA_H__
18 #define __LUCI_CIRCLE_IMPORT_METADATA_H__
20 #include "luci/Import/CircleReader.h"
22 #include <luci/Profile/CircleNodeOrigin.h>
23 #include <luci/IR/ExecutionPlanTable.h>
32 using OriginTable = std::map<uint32_t, std::shared_ptr<CircleNodeOrigin>>;
34 class CircleImportMetadata
37 CircleImportMetadata() = delete;
39 CircleImportMetadata(const luci::CircleReader &reader);
43 * @brief Create origin table using _source_table and _op_table in CircleImportMetadata
44 * @note For creating origin table, both _op_table and _source_table should exist.
45 * If one of them does not exist, empty table is returned.
47 const OriginTable origin_table(void);
49 const std::map<uint32_t, std::string> &source_table(void) const { return _source_table; }
51 const luci::ExecutionPlanTable &execution_plan_table(void) const { return _execution_plan_table; }
54 // Decoded metadata is stored
55 std::map<uint32_t, std::string> _source_table;
56 std::map<uint32_t, std::set<uint32_t>> _op_table;
57 // _execution_plan_table stores for node with node_id order of execution,
58 // and offsets output tensors
59 luci::ExecutionPlanTable _execution_plan_table;
64 #endif // __LUCI_CIRCLE_IMPORT_METADATA_H__