Skip to content

Commit

Permalink
first to build
Browse files Browse the repository at this point in the history
  • Loading branch information
DanLiu2Intel committed Aug 7, 2024
1 parent 14c0f0f commit eabdee5
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/plugins/intel_npu/src/al/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME npu_al)
target_include_directories(${TARGET_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
# ${CMAKE_CURRENT_SOURCE_DIR}/../plugin/include
)

if(ENABLE_MLIR_COMPILER)
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/intel_npu/src/plugin/include/metrics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

namespace intel_npu {

static std::vector<ov::PropertyName> Metrics_internalSupportedProperties = {ov::internal::caching_properties.name()};

class Metrics final {
public:
Metrics(const std::shared_ptr<const NPUBackends>& backends);
Expand All @@ -42,7 +44,7 @@ class Metrics final {
ov::device::Type GetDeviceType(const std::string& specifiedDeviceName) const;

std::vector<ov::PropertyName> GetCachingProperties() const;
static std::vector<ov::PropertyName> GetInternalSupportedProperties();
std::vector<ov::PropertyName> GetInternalSupportedProperties() const;

~Metrics() = default;

Expand Down
4 changes: 3 additions & 1 deletion src/plugins/intel_npu/src/plugin/src/backends.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ ov::SoPtr<IEngineBackend> loadBackend(const std::string& libpath, const Config&

namespace intel_npu {
NPUBackends::NPUBackends() : _logger("NPUBackends", Logger::global().level()) {
_backend = nullptr;
std::vector<ov::SoPtr<IEngineBackend>> registeredBackends;
registeredBackends.emplace_back(nullptr);
_backend = *registeredBackends.begin();
}

// TODO Config will be useless here, since only default values will be used
Expand Down
12 changes: 11 additions & 1 deletion src/plugins/intel_npu/src/plugin/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ void Plugin::initPluginWithoutBackend(){
{false,
ov::PropertyMutability::RO,
[&](const Config&) {
return Metrics::GetInternalSupportedProperties();
return Metrics_internalSupportedProperties;
}}}); //this part seems not need.
}

Expand All @@ -589,6 +589,11 @@ Plugin::Plugin()
Logger::global().setLevel(_globalConfig.get<LOG_LEVEL>());

bool flag_Dryon = false;
if (flag_Dryon)
std::printf(" <compile_tool>flag_Dryon is flase");
else
std::printf(" <compile_tool>flag_Dryon is true");

if (flag_Dryon)
initPluginWithoutBackend();
else
Expand Down Expand Up @@ -669,6 +674,11 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
std::shared_ptr<ov::ICompiledModel> compiledModel;
bool flag_Dryon = false;

if (flag_Dryon)
std::printf(" <compile_tool>flag_Dryon is flase");
else
std::printf(" <compile_tool>flag_Dryon is true");

if (flag_Dryon){
std::shared_ptr<IDevice> device = nullptr;
OV_ITT_TASK_NEXT(PLUGIN_COMPILE_MODEL, "compile");
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/intel_npu/tools/compile_tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions src/plugins/intel_npu/tools/compile_tool/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.";

Expand Down Expand Up @@ -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.";

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit eabdee5

Please sign in to comment.