Skip to content

Commit

Permalink
[luci/export] Revise SerializedData for extended Buffer (#13860)
Browse files Browse the repository at this point in the history
This will revise SerializedData for extended Buffer support.

ONE-DCO-1.0-Signed-off-by: SaeHie Park <[email protected]>
  • Loading branch information
seanshpark authored Aug 30, 2024
1 parent 2624ca2 commit e0d6140
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/luci/export/src/SerializedData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions compiler/luci/export/src/SerializedData.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ struct SerializedModelData final
// This is used for removing buffers with same values
std::map<luci::CircleConst *, uint32_t> _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<uint8_t>;
using MapBufferData = std::map<int32_t, BufferData>;
// 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
Expand Down

0 comments on commit e0d6140

Please sign in to comment.