Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[NPU] Move vm_runtime_api to utils/vm (#35227)

Dan Liu25cfd3468a55
diff --git a/src/plugins/intel_npu/src/compiler_adapter/CMakeLists.txt b/src/plugins/intel_npu/src/compiler_adapter/CMakeLists.txt
index 3aa5b01104f..08161856f57 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/CMakeLists.txt
+++ b/src/plugins/intel_npu/src/compiler_adapter/CMakeLists.txt
@@ -8,7 +8,7 @@ file(GLOB_RECURSE SOURCES *.cpp *.hpp *.h)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCES})
-add_library(${TARGET_NAME} STATIC ${SOURCES} $<TARGET_OBJECTS:openvino_npu_vcl_utils>)
+add_library(${TARGET_NAME} STATIC ${SOURCES} $<TARGET_OBJECTS:openvino_npu_vcl_utils> $<TARGET_OBJECTS:openvino_npu_vm_utils>)
ov_build_target_faster(${TARGET_NAME}
PCH_HEADER "src/precomp.hpp"
diff --git a/src/plugins/intel_npu/src/compiler_adapter/include/dynamic_graph.hpp b/src/plugins/intel_npu/src/compiler_adapter/include/dynamic_graph.hpp
index 896e6609e82..2c3c6d7a3f0 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/include/dynamic_graph.hpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/include/dynamic_graph.hpp
@@ -10,8 +10,8 @@
#include "intel_npu/common/idynamic_graph.hpp"
#include "intel_npu/common/network_metadata.hpp"
+#include "intel_npu/utils/vm/npu_vm_runtime_api.hpp"
#include "intel_npu/utils/zero/zero_init.hpp"
-#include "npu_vm_runtime_api.hpp"
#include "openvino/runtime/so_ptr.hpp"
namespace intel_npu {
diff --git a/src/plugins/intel_npu/src/compiler_adapter/include/npu_vm_runtime_api.hpp b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/vm/npu_vm_runtime_api.hpp
similarity index 100%
rename from src/plugins/intel_npu/src/compiler_adapter/include/npu_vm_runtime_api.hpp
rename to src/plugins/intel_npu/src/utils/include/intel_npu/utils/vm/npu_vm_runtime_api.hpp
diff --git a/src/plugins/intel_npu/src/utils/src/CMakeLists.txt b/src/plugins/intel_npu/src/utils/src/CMakeLists.txt
index ec6493205c1..434523deda8 100644
--- a/src/plugins/intel_npu/src/utils/src/CMakeLists.txt
+++ b/src/plugins/intel_npu/src/utils/src/CMakeLists.txt
@@ -7,4 +7,5 @@ add_subdirectory(logger)
if(ENABLE_NPU_PLUGIN_ENGINE)
add_subdirectory(vcl)
add_subdirectory(zero)
+ add_subdirectory(vm)
endif()
diff --git a/src/plugins/intel_npu/src/utils/src/vcl/CMakeLists.txt b/src/plugins/intel_npu/src/utils/src/vcl/CMakeLists.txt
index ee78f0c0597..7d712cae969 100644
--- a/src/plugins/intel_npu/src/utils/src/vcl/CMakeLists.txt
+++ b/src/plugins/intel_npu/src/utils/src/vcl/CMakeLists.txt
@@ -12,8 +12,6 @@ set_target_properties(
${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
-add_library(openvino::npu_vcl_utils ALIAS ${TARGET_NAME})
-
target_include_directories(${TARGET_NAME}
PUBLIC
$<BUILD_INTERFACE:${NPU_UTILS_SOURCE_DIR}/include>
diff --git a/src/plugins/intel_npu/src/utils/src/vm/CMakeLists.txt b/src/plugins/intel_npu/src/utils/src/vm/CMakeLists.txt
new file mode 100644
index 00000000000..6c077c0b185
--- /dev/null
+++ b/src/plugins/intel_npu/src/utils/src/vm/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+#
+
+set(TARGET_NAME openvino_npu_vm_utils)
+
+file(GLOB_RECURSE SOURCES *.cpp)
+source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCES})
+
+add_library(${TARGET_NAME} OBJECT ${SOURCES})
+
+set_target_properties(${TARGET_NAME} PROPERTIES
+ INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO}
+ EXPORT_NAME npu_vm_utils)
+
+ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
+
+target_include_directories(${TARGET_NAME}
+ PUBLIC
+ $<BUILD_INTERFACE:${NPU_UTILS_SOURCE_DIR}/include>
+ $<TARGET_PROPERTY:openvino::util,INTERFACE_INCLUDE_DIRECTORIES>
+ $<TARGET_PROPERTY:openvino::core::dev,INTERFACE_INCLUDE_DIRECTORIES>
+ $<TARGET_PROPERTY:openvino::runtime::dev,INTERFACE_INCLUDE_DIRECTORIES>
+ $<TARGET_PROPERTY:npu_vm_runtime_api,INTERFACE_INCLUDE_DIRECTORIES>
+ $<TARGET_PROPERTY:openvino_npu_zero_utils,INTERFACE_INCLUDE_DIRECTORIES>
+)
+
+if(NOT BUILD_SHARED_LIBS)
+ target_compile_definitions(${TARGET_NAME} PRIVATE OPENVINO_STATIC_LIBRARY)
+endif()
diff --git a/src/plugins/intel_npu/src/compiler_adapter/src/npu_vm_runtime_api.cpp b/src/plugins/intel_npu/src/utils/src/vm/npu_vm_runtime_api.cpp
similarity index 97%
rename from src/plugins/intel_npu/src/compiler_adapter/src/npu_vm_runtime_api.cpp
rename to src/plugins/intel_npu/src/utils/src/vm/npu_vm_runtime_api.cpp
index 4ae9f6dccff..de616c8f04d 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/src/npu_vm_runtime_api.cpp
+++ b/src/plugins/intel_npu/src/utils/src/vm/npu_vm_runtime_api.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
//
-#include "npu_vm_runtime_api.hpp"
+#include "intel_npu/utils/vm/npu_vm_runtime_api.hpp"
#include "openvino/util/file_util.hpp"
#include "openvino/util/shared_object.hpp"