From 067baf84aeeec1fe747b0e8513d1992cd1c1ea14 Mon Sep 17 00:00:00 2001 From: SaeHie Park Date: Mon, 28 Oct 2024 13:34:35 +0900 Subject: [PATCH] [luci/import] model_data as const (#14260) This will revise importModule method to accept const argument. Signed-off-by: SaeHie Park --- compiler/luci/import/include/luci/ImporterEx.h | 2 +- compiler/luci/import/src/ImporterEx.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/luci/import/include/luci/ImporterEx.h b/compiler/luci/import/include/luci/ImporterEx.h index e00712c724c..52d808a92d1 100644 --- a/compiler/luci/import/include/luci/ImporterEx.h +++ b/compiler/luci/import/include/luci/ImporterEx.h @@ -50,7 +50,7 @@ class ImporterEx final // embedded-import-value-test uses constant data from file(actually ROM) // so unloading file will break the precondition // TODO remove this after embedded-import-value-test has moved to onert-micro - std::unique_ptr importModule(std::vector &model_data) const; + std::unique_ptr importModule(const std::vector &model_data) const; private: const GraphBuilderSource *_source = nullptr; diff --git a/compiler/luci/import/src/ImporterEx.cpp b/compiler/luci/import/src/ImporterEx.cpp index 88b125f1657..1a67f7a7610 100644 --- a/compiler/luci/import/src/ImporterEx.cpp +++ b/compiler/luci/import/src/ImporterEx.cpp @@ -65,9 +65,9 @@ std::unique_ptr ImporterEx::importVerifyModule(const std::string &input_ return importer.importModule(data_data, data_size); } -std::unique_ptr ImporterEx::importModule(std::vector &model_data) const +std::unique_ptr ImporterEx::importModule(const std::vector &model_data) const { - auto data_data = reinterpret_cast(model_data.data()); + auto data_data = reinterpret_cast(model_data.data()); auto data_size = model_data.size(); Importer importer(_source);