Skip to content

Commit c0c347c

Browse files
Add Config for Release build
* fix model save config * resolve unused variables error * fix model save for various configs in ovep * use generator exp to work with multi config build
1 parent 2e4d541 commit c0c347c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

cmake/onnxruntime_providers_openvino.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,18 @@
3737

3838
source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_openvino_cc_srcs})
3939
onnxruntime_add_shared_library_module(onnxruntime_providers_openvino ${onnxruntime_providers_openvino_cc_srcs} "${ONNXRUNTIME_ROOT}/core/dll/onnxruntime.rc")
40+
4041
onnxruntime_add_include_to_target(onnxruntime_providers_openvino onnxruntime_common onnx nlohmann_json::nlohmann_json)
4142
install(FILES ${PROJECT_SOURCE_DIR}/../include/onnxruntime/core/providers/openvino/openvino_provider_factory.h
4243
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/)
4344
set_target_properties(onnxruntime_providers_openvino PROPERTIES CXX_STANDARD 20)
4445
set_target_properties(onnxruntime_providers_openvino PROPERTIES LINKER_LANGUAGE CXX)
4546
set_target_properties(onnxruntime_providers_openvino PROPERTIES FOLDER "ONNXRuntime")
47+
48+
target_compile_options(onnxruntime_providers_openvino PRIVATE
49+
$<$<NOT:$<CONFIG:Release>>:-DNOT_RELEASE>
50+
)
51+
4652
if(NOT MSVC)
4753
target_compile_options(onnxruntime_providers_openvino PRIVATE "-Wno-parentheses")
4854
endif()

onnxruntime/core/providers/openvino/backend_manager.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,10 @@ static bool IsQDQGraph(const onnxruntime::GraphViewer& graph_viewer) {
321321
return false;
322322
}
323323

324-
static void DumpOpenVINOEPModel(const std::filesystem::path& onnx_model_path_name,
325-
ONNX_NAMESPACE::ModelProto* model_proto,
326-
const onnxruntime::Node& fused_node) {
324+
static void DumpOpenVINOEPModel([[maybe_unused]] const std::filesystem::path& onnx_model_path_name,
325+
[[maybe_unused]] ONNX_NAMESPACE::ModelProto* model_proto,
326+
[[maybe_unused]] const onnxruntime::Node& fused_node) {
327+
#ifdef NOT_RELEASE
327328
if (openvino_ep::backend_utils::IsDebugEnabled()) {
328329
auto model_name = onnx_model_path_name.empty() ? "unknown.onnx" : onnx_model_path_name.filename();
329330

@@ -338,6 +339,7 @@ static void DumpOpenVINOEPModel(const std::filesystem::path& onnx_model_path_nam
338339
std::fstream dump(model_name, std::ios::out | std::ios::trunc | std::ios::binary);
339340
model_proto->SerializeToOstream(dump);
340341
}
342+
#endif
341343
}
342344

343345
std::unique_ptr<ONNX_NAMESPACE::ModelProto>

0 commit comments

Comments
 (0)