From 7c3d3da3494009e14727e5b30acb097f87c7ec73 Mon Sep 17 00:00:00 2001 From: Sun Xiaoxia Date: Wed, 22 Nov 2023 19:50:54 +0800 Subject: [PATCH] Change threading related interface from API 1.0 to 2.0 (#766) * change thrading related interface from API 1.0 to 2.0 * restore the order of header files * change <> to quotation marks --- modules/nvidia_plugin/src/cuda_compiled_model.cpp | 10 ++++------ modules/nvidia_plugin/src/cuda_config.hpp | 2 +- modules/nvidia_plugin/src/cuda_infer_request.cpp | 2 +- modules/nvidia_plugin/src/cuda_plugin.cpp | 6 ++++-- modules/nvidia_plugin/src/cuda_thread_pool.hpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/nvidia_plugin/src/cuda_compiled_model.cpp b/modules/nvidia_plugin/src/cuda_compiled_model.cpp index f0e139991..0add8e16e 100644 --- a/modules/nvidia_plugin/src/cuda_compiled_model.cpp +++ b/modules/nvidia_plugin/src/cuda_compiled_model.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include "cuda_compiled_model.hpp" @@ -26,16 +25,15 @@ #include "memory_manager/model/cuda_memory_model_builder.hpp" #include "nvidia/nvidia_config.hpp" #include "nvidia/properties.hpp" - +#include "openvino/runtime/exec_model_info.hpp" +#include "openvino/runtime/internal_properties.hpp" +#include "openvino/runtime/iplugin.hpp" +#include "openvino/runtime/threading/executor_manager.hpp" #include "ops/parameter.hpp" #include "ops/result.hpp" #include "transformations/utils/utils.hpp" #include "transformer/cuda_graph_transformer.hpp" -#include "openvino/runtime/exec_model_info.hpp" -#include "openvino/runtime/internal_properties.hpp" -#include "openvino/runtime/iplugin.hpp" - namespace { static constexpr const char* nv_stream_executor_name = "NvidiaStreamExecutor"; static constexpr const char* nv_exclusive_executor = "NvidiaExecutor"; diff --git a/modules/nvidia_plugin/src/cuda_config.hpp b/modules/nvidia_plugin/src/cuda_config.hpp index cca0c2956..94cc18cdd 100644 --- a/modules/nvidia_plugin/src/cuda_config.hpp +++ b/modules/nvidia_plugin/src/cuda_config.hpp @@ -10,7 +10,7 @@ #include "nvidia/nvidia_config.hpp" #include "openvino/runtime/properties.hpp" -#include "threading/ie_istreams_executor.hpp" +#include "openvino/runtime/threading/istreams_executor.hpp" namespace ov { namespace nvidia_gpu { diff --git a/modules/nvidia_plugin/src/cuda_infer_request.cpp b/modules/nvidia_plugin/src/cuda_infer_request.cpp index 0f37f2c68..4098ac389 100644 --- a/modules/nvidia_plugin/src/cuda_infer_request.cpp +++ b/modules/nvidia_plugin/src/cuda_infer_request.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include "cuda_compiled_model.hpp" @@ -25,6 +24,7 @@ #include "cuda_simple_execution_delegator.hpp" #include "nvidia/properties.hpp" #include "openvino/runtime/make_tensor.hpp" +#include "openvino/runtime/threading/executor_manager.hpp" namespace ov { namespace nvidia_gpu { diff --git a/modules/nvidia_plugin/src/cuda_plugin.cpp b/modules/nvidia_plugin/src/cuda_plugin.cpp index ebe27e624..ecb04c9f1 100644 --- a/modules/nvidia_plugin/src/cuda_plugin.cpp +++ b/modules/nvidia_plugin/src/cuda_plugin.cpp @@ -17,7 +17,7 @@ #include "openvino/op/util/op_types.hpp" #include "openvino/runtime/core.hpp" #include "openvino/runtime/properties.hpp" -#include "threading/ie_executor_manager.hpp" +#include "openvino/runtime/threading/executor_manager.hpp" #include "transformations/rt_info/fused_names_attribute.hpp" using namespace ov::nvidia_gpu; @@ -215,7 +215,9 @@ ov::Any Plugin::get_property(const std::string& name, const ov::AnyMap& properti } else if (METRIC_KEY(SUPPORTED_CONFIG_KEYS) == name) { std::vector configKeys = { CONFIG_KEY(DEVICE_ID), CONFIG_KEY(PERF_COUNT), NVIDIA_CONFIG_KEY(THROUGHPUT_STREAMS)}; - auto streamExecutorConfigKeys = InferenceEngine::IStreamsExecutor::Config{}.SupportedKeys(); + auto streamExecutorConfigKeys = ov::threading::IStreamsExecutor::Config{} + .get_property(ov::supported_properties.name()) + .as>(); for (auto&& configKey : streamExecutorConfigKeys) { if (configKey != InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS) { configKeys.emplace_back(configKey); diff --git a/modules/nvidia_plugin/src/cuda_thread_pool.hpp b/modules/nvidia_plugin/src/cuda_thread_pool.hpp index 82ed73904..4dc7c6dc7 100644 --- a/modules/nvidia_plugin/src/cuda_thread_pool.hpp +++ b/modules/nvidia_plugin/src/cuda_thread_pool.hpp @@ -11,9 +11,9 @@ #include #include #include -#include #include "cuda_jthread.hpp" +#include "openvino/runtime/threading/itask_executor.hpp" namespace ov { namespace nvidia_gpu {