From eabdee5e2d846812a5ca14b0b3f9d6d02c5fa6ac Mon Sep 17 00:00:00 2001 From: "Liu, Dan1" Date: Wed, 7 Aug 2024 17:21:11 +0800 Subject: [PATCH] first to build --- src/plugins/intel_npu/src/al/CMakeLists.txt | 1 + src/plugins/intel_npu/src/plugin/include/metrics.hpp | 4 +++- src/plugins/intel_npu/src/plugin/src/backends.cpp | 4 +++- src/plugins/intel_npu/src/plugin/src/plugin.cpp | 12 +++++++++++- .../intel_npu/tools/compile_tool/CMakeLists.txt | 8 +++++++- src/plugins/intel_npu/tools/compile_tool/main.cpp | 8 +++++--- 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/plugins/intel_npu/src/al/CMakeLists.txt b/src/plugins/intel_npu/src/al/CMakeLists.txt index b7eff57de3172c..fded6086207f6e 100644 --- a/src/plugins/intel_npu/src/al/CMakeLists.txt +++ b/src/plugins/intel_npu/src/al/CMakeLists.txt @@ -14,6 +14,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME npu_al) target_include_directories(${TARGET_NAME} PUBLIC $ + # ${CMAKE_CURRENT_SOURCE_DIR}/../plugin/include ) if(ENABLE_MLIR_COMPILER) diff --git a/src/plugins/intel_npu/src/plugin/include/metrics.hpp b/src/plugins/intel_npu/src/plugin/include/metrics.hpp index 79e029d0ea3e85..a0b5914064578d 100644 --- a/src/plugins/intel_npu/src/plugin/include/metrics.hpp +++ b/src/plugins/intel_npu/src/plugin/include/metrics.hpp @@ -17,6 +17,8 @@ namespace intel_npu { +static std::vector Metrics_internalSupportedProperties = {ov::internal::caching_properties.name()}; + class Metrics final { public: Metrics(const std::shared_ptr& backends); @@ -42,7 +44,7 @@ class Metrics final { ov::device::Type GetDeviceType(const std::string& specifiedDeviceName) const; std::vector GetCachingProperties() const; - static std::vector GetInternalSupportedProperties(); + std::vector GetInternalSupportedProperties() const; ~Metrics() = default; diff --git a/src/plugins/intel_npu/src/plugin/src/backends.cpp b/src/plugins/intel_npu/src/plugin/src/backends.cpp index 716d808691e4c0..e29ba139e3564a 100644 --- a/src/plugins/intel_npu/src/plugin/src/backends.cpp +++ b/src/plugins/intel_npu/src/plugin/src/backends.cpp @@ -67,7 +67,9 @@ ov::SoPtr loadBackend(const std::string& libpath, const Config& namespace intel_npu { NPUBackends::NPUBackends() : _logger("NPUBackends", Logger::global().level()) { - _backend = nullptr; + std::vector> registeredBackends; + registeredBackends.emplace_back(nullptr); + _backend = *registeredBackends.begin(); } // TODO Config will be useless here, since only default values will be used diff --git a/src/plugins/intel_npu/src/plugin/src/plugin.cpp b/src/plugins/intel_npu/src/plugin/src/plugin.cpp index 6b1c22defefd2b..07f46aec34271a 100644 --- a/src/plugins/intel_npu/src/plugin/src/plugin.cpp +++ b/src/plugins/intel_npu/src/plugin/src/plugin.cpp @@ -568,7 +568,7 @@ void Plugin::initPluginWithoutBackend(){ {false, ov::PropertyMutability::RO, [&](const Config&) { - return Metrics::GetInternalSupportedProperties(); + return Metrics_internalSupportedProperties; }}}); //this part seems not need. } @@ -589,6 +589,11 @@ Plugin::Plugin() Logger::global().setLevel(_globalConfig.get()); bool flag_Dryon = false; + if (flag_Dryon) + std::printf(" flag_Dryon is flase"); + else + std::printf(" flag_Dryon is true"); + if (flag_Dryon) initPluginWithoutBackend(); else @@ -669,6 +674,11 @@ std::shared_ptr Plugin::compile_model(const std::shared_ptr< std::shared_ptr compiledModel; bool flag_Dryon = false; + if (flag_Dryon) + std::printf(" flag_Dryon is flase"); + else + std::printf(" flag_Dryon is true"); + if (flag_Dryon){ std::shared_ptr device = nullptr; OV_ITT_TASK_NEXT(PLUGIN_COMPILE_MODEL, "compile"); diff --git a/src/plugins/intel_npu/tools/compile_tool/CMakeLists.txt b/src/plugins/intel_npu/tools/compile_tool/CMakeLists.txt index a5e90dc52b0a50..07e664a197410b 100644 --- a/src/plugins/intel_npu/tools/compile_tool/CMakeLists.txt +++ b/src/plugins/intel_npu/tools/compile_tool/CMakeLists.txt @@ -6,7 +6,9 @@ set(TARGET_NAME compile_tool) message("==========1============") # find_package(openvino::npu_al) #感觉这部分不需要使用 +file(GLOB_RECURSE DRYONEXECUTION_HEADERS ${PROJECT_SOURCE_DIR}/src/plugins/intel_npu/src/*.hpp) message("==========2============") +message("@@@@${DRYONEXECUTION_HEADERS}@@@@") if (NOT DEFINED PROJECT_NAME) cmake_minimum_required(VERSION 3.13 FATAL_ERROR) @@ -18,11 +20,15 @@ endif() # # Define the target # - +message("${CMAKE_CURRENT_SOURCE_DIR} is what???") +message("${PROJECT_SOURCE_DIR} is what???") ov_add_target(ADD_CPPLINT TYPE EXECUTABLE NAME ${TARGET_NAME} ROOT ${CMAKE_CURRENT_SOURCE_DIR} + INCLUDES + /home/dl5w0502/vpux/openvino/src/plugins/intel_npu/src/al/include/ + ${PROJECT_SOURCE_DIR}/src/plugins/intel_npu/src/al/include/ LINK_LIBRARIES PRIVATE openvino::runtime diff --git a/src/plugins/intel_npu/tools/compile_tool/main.cpp b/src/plugins/intel_npu/tools/compile_tool/main.cpp index 8adb680d092855..a90fc0cf19c864 100644 --- a/src/plugins/intel_npu/tools/compile_tool/main.cpp +++ b/src/plugins/intel_npu/tools/compile_tool/main.cpp @@ -19,7 +19,9 @@ #include "tools_helpers.hpp" -#include "al/include/update_flage.hpp" + +#include "update_dryon_flag.hpp" + static constexpr char help_message[] = "Optional. Print the usage message."; @@ -52,7 +54,7 @@ static constexpr char iop_message[] = " Overwrites precision from ip and op options for specified " "layers."; -static constexpr char inputs_l ayout_message[] = "Optional. Specifies layout for all input layers of the network."; +static constexpr char inputs_layout_message[] = "Optional. Specifies layout for all input layers of the network."; static constexpr char outputs_layout_message[] = "Optional. Specifies layout for all output layers of the network."; @@ -420,7 +422,7 @@ static bool parseCommandLine(int* argc, char*** argv) { } if (!FLAGS_dryon.empty()) { - intel_npu::update_fflag(true); + intel_npu::update_dryon_flag(true); } if (1 < *argc) {