Modify logic to determine OV Version (#5701)

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>
This commit is contained in:
Maajid khan 2020-11-06 04:42:02 +05:30 committed by GitHub
parent d1d82065b9
commit d6f9cc181d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 5 deletions

View file

@ -975,17 +975,25 @@ if(onnxruntime_USE_OPENVINO)
add_definitions(-DUSE_OPENVINO=1)
if (EXISTS "$ENV{INTEL_OPENVINO_DIR}/inference_engine/version.txt")
file(READ $ENV{INTEL_OPENVINO_DIR}/inference_engine/version.txt VER)
endif()
if (NOT DEFINED ENV{INTEL_OPENVINO_DIR})
message(FATAL_ERROR "[Couldn't locate OpenVINO] OpenVINO may not have been initialized")
endif()
# Check OpenVINO version for support
if ($ENV{INTEL_OPENVINO_DIR} MATCHES "2020.2")
if (${VER} MATCHES "2020.2" OR $ENV{INTEL_OPENVINO_DIR} MATCHES "2020.2")
set(OPENVINO_VERSION "2020.2")
add_definitions(-DOPENVINO_2020_2=1)
elseif ($ENV{INTEL_OPENVINO_DIR} MATCHES "2020.3")
elseif (${VER} MATCHES "2020.3" OR $ENV{INTEL_OPENVINO_DIR} MATCHES "2020.3")
set(OPENVINO_VERSION "2020.3")
add_definitions(-DOPENVINO_2020_3=1)
elseif ($ENV{INTEL_OPENVINO_DIR} MATCHES "2020.4")
elseif (${VER} MATCHES "2020.4" OR $ENV{INTEL_OPENVINO_DIR} MATCHES "2020.4")
set(OPENVINO_VERSION "2020.4")
add_definitions(-DOPENVINO_2020_4=1)
elseif ($ENV{INTEL_OPENVINO_DIR} MATCHES "2021.1")
elseif (${VER} MATCHES "2021.1" OR $ENV{INTEL_OPENVINO_DIR} MATCHES "2021.1")
set(OPENVINO_VERSION "2021.1")
add_definitions(-DOPENVINO_2021_1=1)
else()

View file

@ -83,7 +83,7 @@ BasicBackend::BasicBackend(const ONNX_NAMESPACE::ModelProto& model_proto,
//The infer_requests_ pool will be intialized with a default value of 8 infer_request's
//The nireq value can also be configured to any num_of_threads during runtime
size_t nireq = global_context_.num_of_threads;
LOGS_DEFAULT(INFO) << "The value of nireq being used is: " << nireq;
LOGS_DEFAULT(INFO) << log_tag << "The value of nireq being used is: " << nireq;
#ifndef NDEBUG
if (openvino_ep::backend_utils::IsDebugEnabled()) {
std::cout << "The value of nireq being used is: " << nireq << std::endl;