From e0d6140a9b35b7535e08fec366efccc05e37b6e6 Mon Sep 17 00:00:00 2001 From: SaeHie Park Date: Fri, 30 Aug 2024 19:11:27 +0900 Subject: [PATCH] [luci/export] Revise SerializedData for extended Buffer (#13860) This will revise SerializedData for extended Buffer support. ONE-DCO-1.0-Signed-off-by: SaeHie Park --- compiler/luci/export/src/SerializedData.cpp | 5 +++++ compiler/luci/export/src/SerializedData.h | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/compiler/luci/export/src/SerializedData.cpp b/compiler/luci/export/src/SerializedData.cpp index e18d8ea6dd9..0593fc9e6cc 100644 --- a/compiler/luci/export/src/SerializedData.cpp +++ b/compiler/luci/export/src/SerializedData.cpp @@ -32,6 +32,11 @@ void SerializedModelData::clear(void) _buffers.clear(); _metadata.clear(); _cached_buffer_id.clear(); + + // clear extended buffer mode + _ext_buffer = false; + _require_ext_buffer = false; + _buffer_data_map.clear(); } } // namespace luci diff --git a/compiler/luci/export/src/SerializedData.h b/compiler/luci/export/src/SerializedData.h index 04e5b546b35..32fa481ab9d 100644 --- a/compiler/luci/export/src/SerializedData.h +++ b/compiler/luci/export/src/SerializedData.h @@ -128,6 +128,16 @@ struct SerializedModelData final // This is used for removing buffers with same values std::map _cached_buffer_id; + // flag to use extended Buffer mode for file size > 2G + bool _ext_buffer = false; + // flag to indicate flatbuffer area got size > 2G + bool _require_ext_buffer = false; + + using BufferData = std::vector; + using MapBufferData = std::map; + // temporary store for BufferData to put after flatbuffers area + MapBufferData _buffer_data_map; + /** * @brief if opcode is not registered in table of opcodes add it * @param builtin_code