From b41e9b5d4c5b30a750aa243f94493f60d174c2d3 Mon Sep 17 00:00:00 2001 From: Maajid khan Date: Thu, 18 Feb 2021 03:19:03 +0530 Subject: [PATCH] [OpenVINO-EP] Fixes OpenVINO-EP build on windows (#6726) * Fixes OpenVINO-EP windows build Openvino EP build is broken on windows. The issue is wchar_t is UTF-16 on windows while on other platforms such as Linux and MacOS, wchar_t is UTF-32. so wide Unicode string has to be converted to an UTF8 string for sure on windows. This commit fixes this issue. --- onnxruntime/test/perftest/ort_test_session.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/onnxruntime/test/perftest/ort_test_session.cc b/onnxruntime/test/perftest/ort_test_session.cc index a88f6e349c..26f0bfc021 100644 --- a/onnxruntime/test/perftest/ort_test_session.cc +++ b/onnxruntime/test/perftest/ort_test_session.cc @@ -73,7 +73,12 @@ OnnxRuntimeTestSession::OnnxRuntimeTestSession(Ort::Env& env, std::random_device std::string device_id = ""; // [enable_vpu_fast_compile]: Fast-compile may be optionally enabled to speeds up the model's compilation to VPU device specific format. size_t num_of_threads = 8; // [num_of_threads]: Overrides the accelerator default value of number of threads with this value at runtime. - std::istringstream ss(performance_test_config.run_config.ep_runtime_config_string); + #ifdef _MSC_VER + std::string ov_string = ToMBString(performance_test_config.run_config.ep_runtime_config_string); + #else + std::string ov_string = performance_test_config.run_config.ep_runtime_config_string; + #endif + std::istringstream ss(ov_string); std::string token; while (ss >> token) { if(token == "") {