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