Skip to content

Commit

Permalink
update test code
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorSVC committed Dec 18, 2023
1 parent 8a00784 commit 16058a8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 9 additions & 3 deletions onnxruntime/test/framework/session_state_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ TEST_P(SessionStateTestP, TestInitializerProcessing) {
AllocatorPtr cpu_allocator = std::make_shared<CPUAllocator>();
return layout_transformation::TransformLayoutForEP(
graph, modified, execution_provider, std::move(cpu_allocator), debug_graph_fn);
}));
},
sess_options.config_options,
DefaultLoggingManager().DefaultLogger()));

ASSERT_STATUS_OK(session_state.FinalizeSessionState(oss.str(), krm));

Expand Down Expand Up @@ -256,7 +258,9 @@ TEST(SessionStateTest, TestInitializerMemoryAllocatedUsingNonArenaMemory) {
const layout_transformation::DebugGraphFn& debug_graph_fn) -> Status {
return layout_transformation::TransformLayoutForEP(graph, modified, execution_provider,
cpu_allocator, debug_graph_fn);
}));
},
sess_options.config_options,
DefaultLoggingManager().DefaultLogger()));

ASSERT_STATUS_OK(session_state.FinalizeSessionState(oss.str(), krm));

Expand Down Expand Up @@ -313,7 +317,9 @@ TEST(SessionStateTest, TestInitializerMemoryAllocatedUsingNonArenaMemory) {
const layout_transformation::DebugGraphFn& debug_graph_fn) -> Status {
return layout_transformation::TransformLayoutForEP(
graph, modified, execution_provider, cpu_allocator, debug_graph_fn);
}));
},
sess_options.config_options,
DefaultLoggingManager().DefaultLogger()));

// Finalize the session state
ASSERT_STATUS_OK(session_state.FinalizeSessionState(oss.str(), krm));
Expand Down
10 changes: 2 additions & 8 deletions onnxruntime/test/onnx/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,6 @@ int real_main(int argc, char* argv[], Ort::Env& env) {
if (value != "0") {
ORT_THROW("Set to 0 to disable qnn_context_embed_mode.");
}
} else if (key == "qnn_context_cache_enable") {
if (value != "1") {
ORT_THROW("Set to 1 to enable qnn_context_cache_enable.");
}
} else if (key == "qnn_context_cache_path") {
// no validation
} else if (key == "profiling_level") {
std::set<std::string> supported_profiling_level = {"off", "basic", "detailed"};
if (supported_profiling_level.find(value) == supported_profiling_level.end()) {
Expand Down Expand Up @@ -519,8 +513,8 @@ int real_main(int argc, char* argv[], Ort::Env& env) {
ORT_THROW("Wrong value for htp_graph_finalization_optimization_mode. select from: " + str);
}
} else {
ORT_THROW(R"(Wrong key type entered. Choose from options: ['backend_path', 'qnn_context_cache_enable',
'qnn_context_cache_path', 'profiling_level', 'rpc_control_latency', 'vtcm_mb', 'htp_performance_mode',
ORT_THROW(R"(Wrong key type entered. Choose from options: ['backend_path',
'profiling_level', 'rpc_control_latency', 'vtcm_mb', 'htp_performance_mode',
'qnn_saver_path', 'htp_graph_finalization_optimization_mode', 'qnn_context_priority'])");
}

Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/test/perftest/ort_test_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ OnnxRuntimeTestSession::OnnxRuntimeTestSession(Ort::Env& env, std::random_device
ORT_THROW("Supported qnn_context_priority: low, normal, normal_high, high");
}
} else {
ORT_THROW(R"(Wrong key type entered. Choose from options: ['backend_path', 'qnn_context_cache_enable',
'qnn_context_cache_path', 'profiling_level', 'rpc_control_latency', 'vtcm_mb', 'htp_performance_mode',
ORT_THROW(R"(Wrong key type entered. Choose from options: ['backend_path',
'profiling_level', 'rpc_control_latency', 'vtcm_mb', 'htp_performance_mode',
'qnn_saver_path', 'htp_graph_finalization_optimization_mode', 'qnn_context_priority'])");
}

Expand Down

0 comments on commit 16058a8

Please sign in to comment.