Skip to content

Commit

Permalink
[onert/test] Use file loading API for test (#14479)
Browse files Browse the repository at this point in the history
This commit updates test code to use nnfw_load_model_from_file API instead of nnfw_load_model_from_modelfile internal API.

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
  • Loading branch information
hseok-oh authored Dec 19, 2024
1 parent 3099167 commit 2643791
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/nnfw_api/src/OdcAutoCompilation.test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ TEST(TestOdcAutoCompilation, AutoCompilation_test)
nnfw_session *session = nullptr;
nnfw_create_session(&session);

nnfw_load_model_from_modelfile(session, (model_path + ".circle").c_str());
nnfw_load_model_from_file(session, (model_path + ".circle").c_str());
nnfw_set_available_backends(session, "cpu");
nnfw_prepare(session);

Expand Down Expand Up @@ -171,7 +171,7 @@ TEST(TestOdcAutoCompilation, neg_autoCompilation_no_export_path)
nnfw_session *session = nullptr;
nnfw_create_session(&session);

nnfw_load_model_from_modelfile(session, (model_path + ".circle").c_str());
nnfw_load_model_from_file(session, (model_path + ".circle").c_str());
nnfw_set_available_backends(session, "cpu");
nnfw_prepare(session);

Expand Down
3 changes: 1 addition & 2 deletions tests/tools/onert_run/src/onert_run.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ int main(const int argc, char **argv)
// ModelLoad
phases.run("MODEL_LOAD", [&](const benchmark::Phase &, uint32_t) {
if (args.useSingleModel())
NNPR_ENSURE_STATUS(
nnfw_load_model_from_modelfile(session, args.getModelFilename().c_str()));
NNPR_ENSURE_STATUS(nnfw_load_model_from_file(session, args.getModelFilename().c_str()));
else
NNPR_ENSURE_STATUS(nnfw_load_model_from_file(session, args.getPackageFilename().c_str()));
});
Expand Down
3 changes: 1 addition & 2 deletions tests/tools/onert_train/src/onert_train.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ int main(const int argc, char **argv)
// ModelLoad
measure.run(PhaseType::MODEL_LOAD, [&]() {
if (args.useSingleModel())
NNPR_ENSURE_STATUS(
nnfw_load_model_from_modelfile(session, args.getModelFilename().c_str()));
NNPR_ENSURE_STATUS(nnfw_load_model_from_file(session, args.getModelFilename().c_str()));
else
NNPR_ENSURE_STATUS(nnfw_load_model_from_file(session, args.getPackageFilename().c_str()));
});
Expand Down
2 changes: 1 addition & 1 deletion tests/tools/tflite_comparator/src/tflite_comparator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ int main(const int argc, char **argv)
exit(-1);
}

NNFW_ASSERT_FAIL(nnfw_load_model_from_modelfile(onert_session, tflite_file.c_str()),
NNFW_ASSERT_FAIL(nnfw_load_model_from_file(onert_session, tflite_file.c_str()),
"[ ERROR ] Failure during model load");

uint32_t num_inputs;
Expand Down

0 comments on commit 2643791

Please sign in to comment.