Skip to content

Commit

Permalink
[luci/export] Introduce clear methods (#13802)
Browse files Browse the repository at this point in the history
This will add clear methods to CircleExportMetadata and SerializedModelData.

ONE-DCO-1.0-Signed-off-by: SaeHie Park <[email protected]>
  • Loading branch information
seanshpark authored Aug 28, 2024
1 parent 523d27b commit c5319b6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
37 changes: 37 additions & 0 deletions compiler/luci/export/src/SerializedData.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "SerializedData.h"

namespace luci
{

void CircleExportMetadata::clear(void)
{
_source_table.clear();
_op_table.clear();
_execution_plan_table.clear();
}

void SerializedModelData::clear(void)
{
_operator_codes.clear();
_buffers.clear();
_metadata.clear();
_cached_buffer_id.clear();
}

} // namespace luci
4 changes: 4 additions & 0 deletions compiler/luci/export/src/SerializedData.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class CircleExportMetadata
_execution_plan_table[node_id] = execution_plan_inform;
}

void clear(void);

public:
const std::vector<uint8_t> encoded_source_table(void);
const std::vector<uint8_t> encoded_op_table(void);
Expand Down Expand Up @@ -133,6 +135,8 @@ struct SerializedModelData final
*/
uint32_t registerBuiltinOpcode(circle::BuiltinOperator builtin_code,
const std::string &custom_code, const int32_t op_version);

void clear(void);
};

// Prerequisites for circle::Model object creation
Expand Down

0 comments on commit c5319b6

Please sign in to comment.