diff --git a/src/plugins/intel_npu/cmake/features.cmake b/src/plugins/intel_npu/cmake/features.cmake index 8a9dce04f071b9..0dde0f9d67f6e5 100644 --- a/src/plugins/intel_npu/cmake/features.cmake +++ b/src/plugins/intel_npu/cmake/features.cmake @@ -4,12 +4,22 @@ ov_option(ENABLE_MLIR_COMPILER "Enable compilation of npu_mlir_compiler libraries" ON) -ov_option(BUILD_COMPILER_FOR_DRIVER "Enable build of npu_driver_compiler" OFF) +ov_option(ENABLE_NPU_RUNTIME_COMMON "Enable compilation of npu runtime common libraries" ON) # if ENABLE_ZEROAPI_BACKEND=ON, it adds the ze_loader dependency for driver compiler -ov_dependent_option(ENABLE_ZEROAPI_BACKEND "Enable zero-api as a plugin backend" ON "NOT BUILD_COMPILER_FOR_DRIVER" OFF) +ov_dependent_option(ENABLE_NPU_PLUGIN_ENGINE "Enable compilation of NPU plugin engine" ON "ENABLE_NPU_RUNTIME_COMMON" OFF) -ov_dependent_option(ENABLE_DRIVER_COMPILER_ADAPTER "Enable NPU Compiler inside driver" ON "NOT BUILD_COMPILER_FOR_DRIVER;ENABLE_ZEROAPI_BACKEND" OFF) +ov_dependent_option(ENABLE_ZEROAPI_BACKEND "Enable zero-api as a plugin backend" ON "ENABLE_NPU_RUNTIME_COMMON;ENABLE_NPU_PLUGIN_ENGINE" OFF) + +ov_dependent_option(ENABLE_DRIVER_COMPILER_ADAPTER "Enable NPU Compiler inside driver" ON "ENABLE_ZEROAPI_BACKEND" OFF) + +if((NOT ENABLE_NPU_PLUGIN_ENGINE OR NOT ENABLE_NPU_RUNTIME_COMMON) AND ENABLE_TESTS) + message(FATAL_ERROR "Tests depends on npu plugin engine and npu runtime common libraries!") +endif() + +if((NOT ENABLE_NPU_PLUGIN_ENGINE OR NOT ENABLE_NPU_RUNTIME_COMMON) AND ENABLE_ZEROAPI_BACKEND) + message(FATAL_ERROR "Zero backend depends on npu plugin engine and npu common libraries!") +endif() if(NOT ENABLE_ZEROAPI_BACKEND AND ENABLE_DRIVER_COMPILER_ADAPTER) message(FATAL_ERROR "Compiler adapter depends on zero backend to use same context!") diff --git a/src/plugins/intel_npu/src/CMakeLists.txt b/src/plugins/intel_npu/src/CMakeLists.txt index c073aa7fbea84e..5530eb1f3e59e5 100644 --- a/src/plugins/intel_npu/src/CMakeLists.txt +++ b/src/plugins/intel_npu/src/CMakeLists.txt @@ -9,6 +9,10 @@ add_subdirectory(utils) add_subdirectory(al) +if (ENABLE_NPU_RUNTIME_COMMON) + add_subdirectory(common) +endif() + if(ENABLE_DRIVER_COMPILER_ADAPTER AND ENABLE_ZEROAPI_BACKEND) add_subdirectory(compiler) endif() @@ -17,6 +21,6 @@ if(ENABLE_ZEROAPI_BACKEND) add_subdirectory(backend) endif() -if (NOT BUILD_COMPILER_FOR_DRIVER) +if (ENABLE_NPU_PLUGIN_ENGINE) add_subdirectory(plugin) endif() diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/al/config/common.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/common.hpp similarity index 98% rename from src/plugins/intel_npu/src/al/include/intel_npu/al/config/common.hpp rename to src/plugins/intel_npu/src/al/include/intel_npu/config/common.hpp index 814764b77ff4fc..07a886adbea0df 100644 --- a/src/plugins/intel_npu/src/al/include/intel_npu/al/config/common.hpp +++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/common.hpp @@ -4,8 +4,8 @@ #pragma once -#include "intel_npu/al/config/config.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/config/config.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "openvino/runtime/internal_properties.hpp" #include "openvino/runtime/properties.hpp" diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/al/config/compiler.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/compiler.hpp similarity index 98% rename from src/plugins/intel_npu/src/al/include/intel_npu/al/config/compiler.hpp rename to src/plugins/intel_npu/src/al/include/intel_npu/config/compiler.hpp index fc7f25d62101d2..a108fc86d97888 100644 --- a/src/plugins/intel_npu/src/al/include/intel_npu/al/config/compiler.hpp +++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/compiler.hpp @@ -7,8 +7,8 @@ #include #include "common.hpp" -#include "intel_npu/al/config/config.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/config/config.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "openvino/runtime/intel_npu/properties.hpp" namespace ov { diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/al/config/config.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/config.hpp similarity index 100% rename from src/plugins/intel_npu/src/al/include/intel_npu/al/config/config.hpp rename to src/plugins/intel_npu/src/al/include/intel_npu/config/config.hpp diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/al/config/npuw.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/npuw.hpp similarity index 97% rename from src/plugins/intel_npu/src/al/include/intel_npu/al/config/npuw.hpp rename to src/plugins/intel_npu/src/al/include/intel_npu/config/npuw.hpp index f315d333d67ae4..3eb7d3df218b41 100644 --- a/src/plugins/intel_npu/src/al/include/intel_npu/al/config/npuw.hpp +++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/npuw.hpp @@ -7,8 +7,8 @@ #include #include "common.hpp" -#include "npu_private_properties.hpp" -#include "npuw_private_properties.hpp" +#include "intel_npu/npu_private_properties.hpp" +#include "intel_npu/npuw_private_properties.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/al/config/runtime.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/runtime.hpp similarity index 98% rename from src/plugins/intel_npu/src/al/include/intel_npu/al/config/runtime.hpp rename to src/plugins/intel_npu/src/al/include/intel_npu/config/runtime.hpp index f3bf6476f79508..d52c25f6a3e6a5 100644 --- a/src/plugins/intel_npu/src/al/include/intel_npu/al/config/runtime.hpp +++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/runtime.hpp @@ -4,8 +4,8 @@ #pragma once -#include "intel_npu/al/config/config.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/config/config.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "openvino/runtime/intel_npu/properties.hpp" #include "openvino/runtime/internal_properties.hpp" #include "openvino/runtime/properties.hpp" diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/al/icompiler.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/icompiler.hpp similarity index 99% rename from src/plugins/intel_npu/src/al/include/intel_npu/al/icompiler.hpp rename to src/plugins/intel_npu/src/al/include/intel_npu/icompiler.hpp index 570e2057d9b5e5..e0a02f12aa2e17 100644 --- a/src/plugins/intel_npu/src/al/include/intel_npu/al/icompiler.hpp +++ b/src/plugins/intel_npu/src/al/include/intel_npu/icompiler.hpp @@ -14,7 +14,7 @@ #include #include -#include "intel_npu/al/config/config.hpp" +#include "intel_npu/config/config.hpp" #include "openvino/core/partial_shape.hpp" #include "openvino/core/type/element_type.hpp" #include "openvino/runtime/common.hpp" diff --git a/src/plugins/intel_npu/src/al/include/npu_private_properties.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/npu_private_properties.hpp similarity index 100% rename from src/plugins/intel_npu/src/al/include/npu_private_properties.hpp rename to src/plugins/intel_npu/src/al/include/intel_npu/npu_private_properties.hpp diff --git a/src/plugins/intel_npu/src/al/include/npuw_private_properties.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/npuw_private_properties.hpp similarity index 100% rename from src/plugins/intel_npu/src/al/include/npuw_private_properties.hpp rename to src/plugins/intel_npu/src/al/include/intel_npu/npuw_private_properties.hpp diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/al/prefix.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/prefix.hpp similarity index 100% rename from src/plugins/intel_npu/src/al/include/intel_npu/al/prefix.hpp rename to src/plugins/intel_npu/src/al/include/intel_npu/prefix.hpp diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/al/profiling.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/profiling.hpp similarity index 100% rename from src/plugins/intel_npu/src/al/include/intel_npu/al/profiling.hpp rename to src/plugins/intel_npu/src/al/include/intel_npu/profiling.hpp diff --git a/src/plugins/intel_npu/src/al/src/config/common.cpp b/src/plugins/intel_npu/src/al/src/config/common.cpp index 04c831a3bffa08..5a3fed496ff84a 100644 --- a/src/plugins/intel_npu/src/al/src/config/common.cpp +++ b/src/plugins/intel_npu/src/al/src/config/common.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" using namespace intel_npu; using namespace ov::intel_npu; diff --git a/src/plugins/intel_npu/src/al/src/config/compiler.cpp b/src/plugins/intel_npu/src/al/src/config/compiler.cpp index f3c37a824353da..22cf050306d0f4 100644 --- a/src/plugins/intel_npu/src/al/src/config/compiler.cpp +++ b/src/plugins/intel_npu/src/al/src/config/compiler.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "intel_npu/al/config/compiler.hpp" +#include "intel_npu/config/compiler.hpp" using namespace intel_npu; using namespace ov::intel_npu; diff --git a/src/plugins/intel_npu/src/al/src/config/config.cpp b/src/plugins/intel_npu/src/al/src/config/config.cpp index 24c84ab6db2f2f..9d4c600351afa6 100644 --- a/src/plugins/intel_npu/src/al/src/config/config.cpp +++ b/src/plugins/intel_npu/src/al/src/config/config.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "intel_npu/al/config/config.hpp" +#include "intel_npu/config/config.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/al/src/config/npuw.cpp b/src/plugins/intel_npu/src/al/src/config/npuw.cpp index b5180633e4357e..3b108c2068b70d 100644 --- a/src/plugins/intel_npu/src/al/src/config/npuw.cpp +++ b/src/plugins/intel_npu/src/al/src/config/npuw.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "intel_npu/al/config/npuw.hpp" +#include "intel_npu/config/npuw.hpp" using namespace intel_npu; using namespace ov::intel_npu; diff --git a/src/plugins/intel_npu/src/al/src/config/runtime.cpp b/src/plugins/intel_npu/src/al/src/config/runtime.cpp index 6b0d9b8fc4ddc1..10f9b4a7c7222b 100644 --- a/src/plugins/intel_npu/src/al/src/config/runtime.cpp +++ b/src/plugins/intel_npu/src/al/src/config/runtime.cpp @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "intel_npu/al/config/runtime.hpp" +#include "intel_npu/config/runtime.hpp" #include -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #include "openvino/runtime/properties.hpp" using namespace intel_npu; diff --git a/src/plugins/intel_npu/src/al/src/icompiler.cpp b/src/plugins/intel_npu/src/al/src/icompiler.cpp index 632a466d17d442..3d3860e84c3669 100644 --- a/src/plugins/intel_npu/src/al/src/icompiler.cpp +++ b/src/plugins/intel_npu/src/al/src/icompiler.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "intel_npu/al/icompiler.hpp" +#include "intel_npu/icompiler.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/backend/CMakeLists.txt b/src/plugins/intel_npu/src/backend/CMakeLists.txt index e093386eae126a..aadee8998a60c0 100644 --- a/src/plugins/intel_npu/src/backend/CMakeLists.txt +++ b/src/plugins/intel_npu/src/backend/CMakeLists.txt @@ -24,6 +24,7 @@ target_include_directories(${TARGET_NAME} target_link_libraries(${TARGET_NAME} PRIVATE openvino::npu_al + openvino::npu_common openvino_npu_zero_result_parser ze_loader ) diff --git a/src/plugins/intel_npu/src/backend/include/zero_backend.hpp b/src/plugins/intel_npu/src/backend/include/zero_backend.hpp index 7323553f6dc88e..ba187da8faf689 100644 --- a/src/plugins/intel_npu/src/backend/include/zero_backend.hpp +++ b/src/plugins/intel_npu/src/backend/include/zero_backend.hpp @@ -7,8 +7,8 @@ #include #include +#include "intel_npu/common/npu.hpp" #include "intel_npu/utils/logger/logger.hpp" -#include "npu.hpp" #include "zero_init.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/backend/include/zero_device.hpp b/src/plugins/intel_npu/src/backend/include/zero_device.hpp index 9d034b1bb4038b..1bf5d391d23533 100644 --- a/src/plugins/intel_npu/src/backend/include/zero_device.hpp +++ b/src/plugins/intel_npu/src/backend/include/zero_device.hpp @@ -7,9 +7,9 @@ #include #include -#include "intel_npu/al/icompiled_model.hpp" +#include "intel_npu/common/icompiled_model.hpp" +#include "intel_npu/common/npu.hpp" #include "intel_npu/utils/logger/logger.hpp" -#include "npu.hpp" #include "openvino/runtime/intel_npu/remote_properties.hpp" #include "zero_init.hpp" #include "zero_types.hpp" diff --git a/src/plugins/intel_npu/src/backend/include/zero_executor.hpp b/src/plugins/intel_npu/src/backend/include/zero_executor.hpp index c3f4cc14eb4945..eeb96defc16441 100644 --- a/src/plugins/intel_npu/src/backend/include/zero_executor.hpp +++ b/src/plugins/intel_npu/src/backend/include/zero_executor.hpp @@ -9,8 +9,8 @@ #include +#include "intel_npu/common/npu.hpp" #include "intel_npu/utils/logger/logger.hpp" -#include "npu.hpp" #include "openvino/runtime/properties.hpp" #include "zero_init.hpp" #include "zero_wrappers.hpp" diff --git a/src/plugins/intel_npu/src/backend/include/zero_host_tensor.hpp b/src/plugins/intel_npu/src/backend/include/zero_host_tensor.hpp index ce28bf572541bc..52000930e2a751 100644 --- a/src/plugins/intel_npu/src/backend/include/zero_host_tensor.hpp +++ b/src/plugins/intel_npu/src/backend/include/zero_host_tensor.hpp @@ -4,7 +4,7 @@ #pragma once -#include "intel_npu/al/config/config.hpp" +#include "intel_npu/config/config.hpp" #include "openvino/runtime/itensor.hpp" #include "zero_init.hpp" #include "zero_remote_tensor.hpp" diff --git a/src/plugins/intel_npu/src/backend/include/zero_infer_request.hpp b/src/plugins/intel_npu/src/backend/include/zero_infer_request.hpp index 6d0b343bf8d7b7..c4860a83d9e822 100644 --- a/src/plugins/intel_npu/src/backend/include/zero_infer_request.hpp +++ b/src/plugins/intel_npu/src/backend/include/zero_infer_request.hpp @@ -7,8 +7,9 @@ #include #include +#include "intel_npu/common/npu.hpp" +#include "intel_npu/common/sync_infer_request.hpp" #include "intel_npu/utils/logger/logger.hpp" -#include "npu.hpp" #include "zero_executor.hpp" #include "zero_pipeline.hpp" #include "zero_profiling.hpp" diff --git a/src/plugins/intel_npu/src/backend/include/zero_profiling.hpp b/src/plugins/intel_npu/src/backend/include/zero_profiling.hpp index 53263d9491d44c..505a7f0185e135 100644 --- a/src/plugins/intel_npu/src/backend/include/zero_profiling.hpp +++ b/src/plugins/intel_npu/src/backend/include/zero_profiling.hpp @@ -10,7 +10,7 @@ #include #include -#include "intel_npu/al/config/compiler.hpp" +#include "intel_npu/config/compiler.hpp" #include "intel_npu/utils/logger/logger.hpp" #include "openvino/runtime/profiling_info.hpp" #include "zero_types.hpp" diff --git a/src/plugins/intel_npu/src/backend/include/zero_remote_tensor.hpp b/src/plugins/intel_npu/src/backend/include/zero_remote_tensor.hpp index ca65d99eff806b..0211bd5bd08962 100644 --- a/src/plugins/intel_npu/src/backend/include/zero_remote_tensor.hpp +++ b/src/plugins/intel_npu/src/backend/include/zero_remote_tensor.hpp @@ -8,8 +8,8 @@ #include #include +#include "intel_npu/common/remote_tensor.hpp" #include "openvino/runtime/intel_npu/remote_properties.hpp" -#include "remote_tensor.hpp" #include "zero_init.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/backend/include/zero_types.hpp b/src/plugins/intel_npu/src/backend/include/zero_types.hpp index 32c67988bfb565..2b8738b245a8d4 100644 --- a/src/plugins/intel_npu/src/backend/include/zero_types.hpp +++ b/src/plugins/intel_npu/src/backend/include/zero_types.hpp @@ -11,7 +11,7 @@ #include -#include "intel_npu/al/config/runtime.hpp" +#include "intel_npu/config/runtime.hpp" /** * @brief Last version of Table of Graph Extension functions used within plugin diff --git a/src/plugins/intel_npu/src/backend/include/zero_utils.hpp b/src/plugins/intel_npu/src/backend/include/zero_utils.hpp index af10fe88fe7480..4df4a9c502b946 100644 --- a/src/plugins/intel_npu/src/backend/include/zero_utils.hpp +++ b/src/plugins/intel_npu/src/backend/include/zero_utils.hpp @@ -8,7 +8,7 @@ #include #include -#include "intel_npu/al/config/runtime.hpp" +#include "intel_npu/config/runtime.hpp" #include "intel_npu/utils/logger/logger.hpp" #include "intel_npu/utils/zero/zero_result.hpp" diff --git a/src/plugins/intel_npu/src/backend/src/zero_backend.cpp b/src/plugins/intel_npu/src/backend/src/zero_backend.cpp index ccb232b16c79ba..01e425aba61132 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_backend.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_backend.cpp @@ -6,7 +6,7 @@ #include -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #include "zero_device.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/backend/src/zero_device.cpp b/src/plugins/intel_npu/src/backend/src/zero_device.cpp index 2df37a59ae1d27..7fd0eaf31b1751 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_device.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_device.cpp @@ -4,7 +4,7 @@ #include "zero_device.hpp" -#include "intel_npu/al/itt.hpp" +#include "intel_npu/common/itt.hpp" #include "intel_npu/utils/zero/zero_api.hpp" #include "zero_executor.hpp" #include "zero_host_tensor.hpp" diff --git a/src/plugins/intel_npu/src/backend/src/zero_executor.cpp b/src/plugins/intel_npu/src/backend/src/zero_executor.cpp index 3655f0b611d5f9..2d6779aed56392 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_executor.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_executor.cpp @@ -11,9 +11,9 @@ #include #include -#include "intel_npu/al/config/common.hpp" -#include "intel_npu/al/itt.hpp" -#include "intel_npu/al/prefix.hpp" +#include "intel_npu/common/itt.hpp" +#include "intel_npu/config/common.hpp" +#include "intel_npu/prefix.hpp" #include "openvino/runtime/properties.hpp" #include "ze_command_queue_npu_ext.h" #include "zero_device.hpp" diff --git a/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp b/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp index 2c954151a4f652..7a4754fb0bd7e9 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp @@ -4,11 +4,11 @@ #include "zero_infer_request.hpp" -#include "intel_npu/al/config/common.hpp" -#include "intel_npu/al/config/compiler.hpp" -#include "intel_npu/al/config/runtime.hpp" -#include "intel_npu/al/itt.hpp" -#include "intel_npu/al/prefix.hpp" +#include "intel_npu/common/itt.hpp" +#include "intel_npu/config/common.hpp" +#include "intel_npu/config/compiler.hpp" +#include "intel_npu/config/runtime.hpp" +#include "intel_npu/prefix.hpp" #include "intel_npu/utils/zero/zero_api.hpp" #include "openvino/op/util/op_types.hpp" #include "openvino/runtime/intel_npu/remote_properties.hpp" diff --git a/src/plugins/intel_npu/src/backend/src/zero_init.cpp b/src/plugins/intel_npu/src/backend/src/zero_init.cpp index 39d0613ec64daa..17b916f232ad16 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_init.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_init.cpp @@ -4,7 +4,7 @@ #include "zero_init.hpp" -#include "intel_npu/al/itt.hpp" +#include "intel_npu/common/itt.hpp" #include "intel_npu/utils/zero/zero_api.hpp" #include "ze_api.h" #include "ze_command_queue_npu_ext.h" diff --git a/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp b/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp index cfc80d48c50707..009eee6541e8ef 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp @@ -7,8 +7,8 @@ #include #include -#include "intel_npu/al/itt.hpp" -#include "intel_npu/al/prefix.hpp" +#include "intel_npu/common/itt.hpp" +#include "intel_npu/prefix.hpp" #include "intel_npu/utils/logger/logger.hpp" #include "intel_npu/utils/zero/zero_api.hpp" #include "zero_types.hpp" diff --git a/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp b/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp index a99c9315b74cdb..525ffb2ce96abf 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp @@ -6,8 +6,8 @@ #include -#include "intel_npu/al/config/compiler.hpp" -#include "intel_npu/al/profiling.hpp" +#include "intel_npu/config/compiler.hpp" +#include "intel_npu/profiling.hpp" #include "intel_npu/utils/zero/zero_api.hpp" #include "zero_profiling.hpp" #include "zero_utils.hpp" diff --git a/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp b/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp index e47b454e11c427..e95b14c8777ddc 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp @@ -6,7 +6,7 @@ #include -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #include "intel_npu/utils/zero/zero_api.hpp" #include "openvino/core/type/element_iterator.hpp" #include "zero_utils.hpp" diff --git a/src/plugins/intel_npu/src/backend/src/zero_wrappers.cpp b/src/plugins/intel_npu/src/backend/src/zero_wrappers.cpp index 8478eccb774f24..e793dc7378d3c1 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_wrappers.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_wrappers.cpp @@ -4,7 +4,7 @@ #include "zero_wrappers.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #include "intel_npu/utils/zero/zero_api.hpp" #include "zero_types.hpp" diff --git a/src/plugins/intel_npu/src/common/CMakeLists.txt b/src/plugins/intel_npu/src/common/CMakeLists.txt new file mode 100644 index 00000000000000..2d1f5d9cbb39ea --- /dev/null +++ b/src/plugins/intel_npu/src/common/CMakeLists.txt @@ -0,0 +1,36 @@ +# Copyright (C) 2018-2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +set(TARGET_NAME openvino_npu_common) + +file(GLOB_RECURSE SOURCES *.cpp *.hpp *.h) +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCES}) + +add_library(${TARGET_NAME} STATIC ${SOURCES}) +add_library(openvino::npu_common ALIAS ${TARGET_NAME}) +set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME npu_common) + +target_include_directories(${TARGET_NAME} + PUBLIC + $ +) + +target_link_libraries(${TARGET_NAME} + PUBLIC + openvino::npu_al + openvino::npu_logger_utils + openvino::runtime::dev +) + +set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO}) +ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}) + +# +# targets install +# +ov_install_static_lib(${TARGET_NAME} ${NPU_PLUGIN_COMPONENT}) + +ov_developer_package_export_targets(TARGET openvino::npu_common + INSTALL_INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/src/plugins/intel_npu/src/al/include/device_helpers.hpp b/src/plugins/intel_npu/src/common/include/intel_npu/common/device_helpers.hpp similarity index 87% rename from src/plugins/intel_npu/src/al/include/device_helpers.hpp rename to src/plugins/intel_npu/src/common/include/intel_npu/common/device_helpers.hpp index 43b9ccf93ce035..f9d262f65fb9d7 100644 --- a/src/plugins/intel_npu/src/al/include/device_helpers.hpp +++ b/src/plugins/intel_npu/src/common/include/intel_npu/common/device_helpers.hpp @@ -7,7 +7,7 @@ #include #include -#include "npu_private_properties.hpp" +#include "intel_npu/npu_private_properties.hpp" namespace utils { bool isNPUDevice(const uint32_t deviceId); diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/al/icompiled_model.hpp b/src/plugins/intel_npu/src/common/include/intel_npu/common/icompiled_model.hpp similarity index 92% rename from src/plugins/intel_npu/src/al/include/intel_npu/al/icompiled_model.hpp rename to src/plugins/intel_npu/src/common/include/intel_npu/common/icompiled_model.hpp index 6d3625477859e3..eb6a3de57e41fc 100644 --- a/src/plugins/intel_npu/src/al/include/intel_npu/al/icompiled_model.hpp +++ b/src/plugins/intel_npu/src/common/include/intel_npu/common/icompiled_model.hpp @@ -7,8 +7,8 @@ #include #include -#include "intel_npu/al/config/common.hpp" -#include "intel_npu/al/icompiler.hpp" +#include "intel_npu/config/common.hpp" +#include "intel_npu/icompiler.hpp" #include "openvino/runtime/icompiled_model.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/al/itt.hpp b/src/plugins/intel_npu/src/common/include/intel_npu/common/itt.hpp similarity index 100% rename from src/plugins/intel_npu/src/al/include/intel_npu/al/itt.hpp rename to src/plugins/intel_npu/src/common/include/intel_npu/common/itt.hpp diff --git a/src/plugins/intel_npu/src/al/include/npu.hpp b/src/plugins/intel_npu/src/common/include/intel_npu/common/npu.hpp similarity index 96% rename from src/plugins/intel_npu/src/al/include/npu.hpp rename to src/plugins/intel_npu/src/common/include/intel_npu/common/npu.hpp index 570eedc5fa3393..3259a51b25bc97 100644 --- a/src/plugins/intel_npu/src/al/include/npu.hpp +++ b/src/plugins/intel_npu/src/common/include/intel_npu/common/npu.hpp @@ -6,13 +6,13 @@ #include -#include "intel_npu/al/config/config.hpp" -#include "intel_npu/al/icompiled_model.hpp" -#include "intel_npu/al/icompiler.hpp" +#include "intel_npu/common/icompiled_model.hpp" +#include "intel_npu/common/sync_infer_request.hpp" +#include "intel_npu/config/config.hpp" +#include "intel_npu/icompiler.hpp" #include "openvino/runtime/intel_npu/remote_properties.hpp" #include "openvino/runtime/iremote_context.hpp" #include "openvino/runtime/properties.hpp" -#include "sync_infer_request.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/al/include/remote_tensor.hpp b/src/plugins/intel_npu/src/common/include/intel_npu/common/remote_tensor.hpp similarity index 97% rename from src/plugins/intel_npu/src/al/include/remote_tensor.hpp rename to src/plugins/intel_npu/src/common/include/intel_npu/common/remote_tensor.hpp index 3f4df1868e7647..d485052c989183 100644 --- a/src/plugins/intel_npu/src/al/include/remote_tensor.hpp +++ b/src/plugins/intel_npu/src/common/include/intel_npu/common/remote_tensor.hpp @@ -8,7 +8,7 @@ #include #include -#include "intel_npu/al/config/config.hpp" +#include "intel_npu/config/config.hpp" #include "openvino/runtime/iremote_context.hpp" #include "openvino/runtime/iremote_tensor.hpp" diff --git a/src/plugins/intel_npu/src/al/include/sync_infer_request.hpp b/src/plugins/intel_npu/src/common/include/intel_npu/common/sync_infer_request.hpp similarity index 98% rename from src/plugins/intel_npu/src/al/include/sync_infer_request.hpp rename to src/plugins/intel_npu/src/common/include/intel_npu/common/sync_infer_request.hpp index ade70f9b67dc0f..99f9ce7cb0eb28 100644 --- a/src/plugins/intel_npu/src/al/include/sync_infer_request.hpp +++ b/src/plugins/intel_npu/src/common/include/intel_npu/common/sync_infer_request.hpp @@ -4,11 +4,11 @@ #pragma once -#include "intel_npu/al/icompiled_model.hpp" -#include "intel_npu/al/icompiler.hpp" +#include "intel_npu/common/icompiled_model.hpp" +#include "intel_npu/common/variable_state.hpp" +#include "intel_npu/icompiler.hpp" #include "openvino/runtime/iinfer_request.hpp" #include "openvino/runtime/iplugin.hpp" -#include "variable_state.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/al/include/variable_state.hpp b/src/plugins/intel_npu/src/common/include/intel_npu/common/variable_state.hpp similarity index 100% rename from src/plugins/intel_npu/src/al/include/variable_state.hpp rename to src/plugins/intel_npu/src/common/include/intel_npu/common/variable_state.hpp diff --git a/src/plugins/intel_npu/src/al/src/device_helpers.cpp b/src/plugins/intel_npu/src/common/src/device_helpers.cpp similarity index 95% rename from src/plugins/intel_npu/src/al/src/device_helpers.cpp rename to src/plugins/intel_npu/src/common/src/device_helpers.cpp index f06c74971bb2b8..32d405ca4bc63e 100644 --- a/src/plugins/intel_npu/src/al/src/device_helpers.cpp +++ b/src/plugins/intel_npu/src/common/src/device_helpers.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "device_helpers.hpp" +#include "intel_npu/common/device_helpers.hpp" #include "openvino/core/except.hpp" diff --git a/src/plugins/intel_npu/src/al/src/npu.cpp b/src/plugins/intel_npu/src/common/src/npu.cpp similarity index 97% rename from src/plugins/intel_npu/src/al/src/npu.cpp rename to src/plugins/intel_npu/src/common/src/npu.cpp index 8912a4e6e4f7c7..9f1fc7be003730 100644 --- a/src/plugins/intel_npu/src/al/src/npu.cpp +++ b/src/plugins/intel_npu/src/common/src/npu.cpp @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "npu.hpp" +#include "intel_npu/common/npu.hpp" -#include "intel_npu/al/itt.hpp" +#include "intel_npu/common/itt.hpp" #include "openvino/util/shared_object.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/al/src/remote_tensor.cpp b/src/plugins/intel_npu/src/common/src/remote_tensor.cpp similarity index 96% rename from src/plugins/intel_npu/src/al/src/remote_tensor.cpp rename to src/plugins/intel_npu/src/common/src/remote_tensor.cpp index 1055e6a57dc537..2d81de4aae65bf 100644 --- a/src/plugins/intel_npu/src/al/src/remote_tensor.cpp +++ b/src/plugins/intel_npu/src/common/src/remote_tensor.cpp @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "remote_tensor.hpp" +#include "intel_npu/common/remote_tensor.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #include "openvino/core/type/element_iterator.hpp" #include "openvino/runtime/intel_npu/remote_properties.hpp" diff --git a/src/plugins/intel_npu/src/al/src/sync_infer_request.cpp b/src/plugins/intel_npu/src/common/src/sync_infer_request.cpp similarity index 99% rename from src/plugins/intel_npu/src/al/src/sync_infer_request.cpp rename to src/plugins/intel_npu/src/common/src/sync_infer_request.cpp index 04e9ce0d9bbcf8..0ae0832fe29d72 100644 --- a/src/plugins/intel_npu/src/al/src/sync_infer_request.cpp +++ b/src/plugins/intel_npu/src/common/src/sync_infer_request.cpp @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "sync_infer_request.hpp" +#include "intel_npu/common/sync_infer_request.hpp" -#include "intel_npu/al/prefix.hpp" +#include "intel_npu/prefix.hpp" #include "openvino/op/util/op_types.hpp" #include "openvino/runtime/make_tensor.hpp" #include "openvino/runtime/plugin_itt.hpp" diff --git a/src/plugins/intel_npu/src/compiler/CMakeLists.txt b/src/plugins/intel_npu/src/compiler/CMakeLists.txt index 3f478de4f3e560..5c81e00945bd58 100644 --- a/src/plugins/intel_npu/src/compiler/CMakeLists.txt +++ b/src/plugins/intel_npu/src/compiler/CMakeLists.txt @@ -24,6 +24,7 @@ target_include_directories(${TARGET_NAME} target_link_libraries(${TARGET_NAME} PUBLIC openvino::npu_al + openvino::npu_common PRIVATE openvino_npu_zero_result_parser openvino_npu_level_zero_backend diff --git a/src/plugins/intel_npu/src/compiler/include/driver_compiler_adapter.hpp b/src/plugins/intel_npu/src/compiler/include/driver_compiler_adapter.hpp index 99de755e1c49aa..addd9ca5308c65 100644 --- a/src/plugins/intel_npu/src/compiler/include/driver_compiler_adapter.hpp +++ b/src/plugins/intel_npu/src/compiler/include/driver_compiler_adapter.hpp @@ -6,9 +6,9 @@ #include -#include "intel_npu/al/icompiler.hpp" +#include "intel_npu/common/npu.hpp" +#include "intel_npu/icompiler.hpp" #include "intel_npu/utils/logger/logger.hpp" -#include "npu.hpp" namespace intel_npu { namespace driverCompilerAdapter { diff --git a/src/plugins/intel_npu/src/compiler/include/zero_compiler_in_driver.hpp b/src/plugins/intel_npu/src/compiler/include/zero_compiler_in_driver.hpp index 65f7e8e3bee6c7..d681e43fa5b99c 100644 --- a/src/plugins/intel_npu/src/compiler/include/zero_compiler_in_driver.hpp +++ b/src/plugins/intel_npu/src/compiler/include/zero_compiler_in_driver.hpp @@ -8,7 +8,7 @@ #include #include -#include "intel_npu/al/icompiler.hpp" +#include "intel_npu/icompiler.hpp" #include "intel_npu/utils/logger/logger.hpp" #include "intel_npu/utils/zero/zero_api.hpp" #include "zero_executor.hpp" diff --git a/src/plugins/intel_npu/src/compiler/src/driver_compiler_adapter.cpp b/src/plugins/intel_npu/src/compiler/src/driver_compiler_adapter.cpp index ad7efd701cfde6..84bca75106483d 100644 --- a/src/plugins/intel_npu/src/compiler/src/driver_compiler_adapter.cpp +++ b/src/plugins/intel_npu/src/compiler/src/driver_compiler_adapter.cpp @@ -5,7 +5,7 @@ #include "driver_compiler_adapter.hpp" #include "graph_transformations.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #include "intel_npu/utils/zero/zero_api.hpp" #include "intel_npu/utils/zero/zero_result.hpp" #include "ze_intel_npu_uuid.h" diff --git a/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp b/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp index d768a4322f7a9b..8d3afb4aa51f69 100644 --- a/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp +++ b/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp @@ -8,11 +8,11 @@ #include #include "graph_transformations.hpp" -#include "intel_npu/al/config/common.hpp" -#include "intel_npu/al/config/compiler.hpp" -#include "intel_npu/al/config/runtime.hpp" -#include "intel_npu/al/itt.hpp" -#include "intel_npu/al/prefix.hpp" +#include "intel_npu/common/itt.hpp" +#include "intel_npu/config/common.hpp" +#include "intel_npu/config/compiler.hpp" +#include "intel_npu/config/runtime.hpp" +#include "intel_npu/prefix.hpp" #include "intel_npu/utils/zero/zero_result.hpp" #include "openvino/core/model.hpp" diff --git a/src/plugins/intel_npu/src/plugin/CMakeLists.txt b/src/plugins/intel_npu/src/plugin/CMakeLists.txt index 749819b457c82c..2e80ed41f82545 100644 --- a/src/plugins/intel_npu/src/plugin/CMakeLists.txt +++ b/src/plugins/intel_npu/src/plugin/CMakeLists.txt @@ -49,6 +49,7 @@ endif() target_link_libraries(${TARGET_NAME} PRIVATE openvino::npu_al + openvino::npu_common openvino::npu_logger_utils openvino::runtime openvino::runtime::dev @@ -60,11 +61,13 @@ target_include_directories(${TARGET_NAME} PRIVATE $ ) -target_include_directories(${TARGET_NAME} - SYSTEM PRIVATE - $ - $ -) +if(ENABLE_ZEROAPI_BACKEND) + target_include_directories(${TARGET_NAME} + SYSTEM PRIVATE + $ + $ + ) +endif() cross_compiled_file(${TARGET_NAME} ARCH AVX2 ANY diff --git a/src/plugins/intel_npu/src/plugin/include/async_infer_request.hpp b/src/plugins/intel_npu/src/plugin/include/async_infer_request.hpp index 51763e16f904e6..5446613443566d 100644 --- a/src/plugins/intel_npu/src/plugin/include/async_infer_request.hpp +++ b/src/plugins/intel_npu/src/plugin/include/async_infer_request.hpp @@ -4,8 +4,8 @@ #pragma once +#include "intel_npu/common/sync_infer_request.hpp" #include "openvino/runtime/iasync_infer_request.hpp" -#include "sync_infer_request.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/plugin/include/backends.hpp b/src/plugins/intel_npu/src/plugin/include/backends.hpp index 177c0b96eb22a1..f8568f676947cd 100644 --- a/src/plugins/intel_npu/src/plugin/include/backends.hpp +++ b/src/plugins/intel_npu/src/plugin/include/backends.hpp @@ -12,9 +12,9 @@ #include "openvino/runtime/so_ptr.hpp" // Plugin +#include "intel_npu/common/npu.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "intel_npu/utils/logger/logger.hpp" -#include "npu.hpp" -#include "npu_private_properties.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/plugin/include/compiled_model.hpp b/src/plugins/intel_npu/src/plugin/include/compiled_model.hpp index 1e4a2463750a2d..8b01b2246f1793 100644 --- a/src/plugins/intel_npu/src/plugin/include/compiled_model.hpp +++ b/src/plugins/intel_npu/src/plugin/include/compiled_model.hpp @@ -6,9 +6,9 @@ #include -#include "intel_npu/al/icompiled_model.hpp" +#include "intel_npu/common/icompiled_model.hpp" +#include "intel_npu/common/npu.hpp" #include "intel_npu/utils/logger/logger.hpp" -#include "npu.hpp" #include "openvino/runtime/so_ptr.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/plugin/include/compiler.hpp b/src/plugins/intel_npu/src/plugin/include/compiler.hpp index 8a82647f12bffb..22f21ae2570ea4 100644 --- a/src/plugins/intel_npu/src/plugin/include/compiler.hpp +++ b/src/plugins/intel_npu/src/plugin/include/compiler.hpp @@ -7,9 +7,9 @@ #pragma once #include "backends.hpp" -#include "intel_npu/al/icompiler.hpp" +#include "intel_npu/icompiler.hpp" +#include "intel_npu/npu_private_properties.hpp" // AL #include "intel_npu/utils/logger/logger.hpp" -#include "npu_private_properties.hpp" // AL #include "openvino/runtime/so_ptr.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/plugin/include/metrics.hpp b/src/plugins/intel_npu/src/plugin/include/metrics.hpp index e09966ba270fca..541bc39a6cd47f 100644 --- a/src/plugins/intel_npu/src/plugin/include/metrics.hpp +++ b/src/plugins/intel_npu/src/plugin/include/metrics.hpp @@ -9,8 +9,8 @@ #include #include "backends.hpp" -#include "npu.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/common/npu.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "openvino/runtime/intel_npu/properties.hpp" #include "openvino/runtime/internal_properties.hpp" #include "openvino/runtime/properties.hpp" diff --git a/src/plugins/intel_npu/src/plugin/include/plugin.hpp b/src/plugins/intel_npu/src/plugin/include/plugin.hpp index 360dd0adaf4d1d..b3ad816ff2ff97 100644 --- a/src/plugins/intel_npu/src/plugin/include/plugin.hpp +++ b/src/plugins/intel_npu/src/plugin/include/plugin.hpp @@ -9,11 +9,11 @@ #include #include "backends.hpp" -#include "intel_npu/al/config/config.hpp" -#include "intel_npu/al/icompiler.hpp" +#include "intel_npu/common/npu.hpp" +#include "intel_npu/config/config.hpp" +#include "intel_npu/icompiler.hpp" #include "intel_npu/utils/logger/logger.hpp" #include "metrics.hpp" -#include "npu.hpp" #include "openvino/runtime/iplugin.hpp" #include "openvino/runtime/so_ptr.hpp" diff --git a/src/plugins/intel_npu/src/plugin/include/remote_context.hpp b/src/plugins/intel_npu/src/plugin/include/remote_context.hpp index 2fce44526c358e..b6b8df5915382f 100644 --- a/src/plugins/intel_npu/src/plugin/include/remote_context.hpp +++ b/src/plugins/intel_npu/src/plugin/include/remote_context.hpp @@ -9,7 +9,7 @@ #include #include "backends.hpp" -#include "intel_npu/al/config/config.hpp" +#include "intel_npu/config/config.hpp" #include "openvino/runtime/iremote_context.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/plugin/npuw/base_sync_infer_request.cpp b/src/plugins/intel_npu/src/plugin/npuw/base_sync_infer_request.cpp index b52b61d44a2cd2..02422e8c72a199 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/base_sync_infer_request.cpp +++ b/src/plugins/intel_npu/src/plugin/npuw/base_sync_infer_request.cpp @@ -5,7 +5,7 @@ #include "base_sync_infer_request.hpp" #include "compiled_model.hpp" -#include "intel_npu/al/config/npuw.hpp" +#include "intel_npu/config/npuw.hpp" #include "logging.hpp" #include "util.hpp" diff --git a/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp b/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp index 6ae61fc42410b8..c6ef93ff1044be 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp +++ b/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp @@ -7,9 +7,9 @@ #include #include "accuracy/comparator.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "just_sync_infer_request.hpp" #include "logging.hpp" -#include "npu_private_properties.hpp" #include "openvino/core/parallel.hpp" #include "openvino/op/util/op_types.hpp" #include "openvino/pass/constant_folding.hpp" @@ -23,10 +23,9 @@ #include "util.hpp" // required for get_properties_per_device() -#include -#include -#include - +#include "intel_npu/config/config.hpp" +#include "intel_npu/config/npuw.hpp" +#include "intel_npu/npuw_private_properties.hpp" #include "openvino/runtime/device_id_parser.hpp" #include "openvino/runtime/internal_properties.hpp" #include "openvino/runtime/properties.hpp" diff --git a/src/plugins/intel_npu/src/plugin/npuw/compiled_model.hpp b/src/plugins/intel_npu/src/plugin/npuw/compiled_model.hpp index 7a02ae1c8a485a..9f07998166e480 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/compiled_model.hpp +++ b/src/plugins/intel_npu/src/plugin/npuw/compiled_model.hpp @@ -7,8 +7,8 @@ #include #include "common.hpp" -#include "intel_npu/al/config/config.hpp" -#include "intel_npu/al/config/npuw.hpp" +#include "intel_npu/config/config.hpp" +#include "intel_npu/config/npuw.hpp" #include "openvino/openvino.hpp" #include "openvino/runtime/icompiled_model.hpp" #include "openvino/runtime/so_ptr.hpp" diff --git a/src/plugins/intel_npu/src/plugin/npuw/partitioning/online/compiler.cpp b/src/plugins/intel_npu/src/plugin/npuw/partitioning/online/compiler.cpp index 173091011d38fe..89a0e0d2da9b23 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/partitioning/online/compiler.cpp +++ b/src/plugins/intel_npu/src/plugin/npuw/partitioning/online/compiler.cpp @@ -10,8 +10,8 @@ #include "../../logging.hpp" #include "../../util.hpp" #include "group.hpp" -#include "intel_npu/al/config/config.hpp" -#include "intel_npu/al/config/npuw.hpp" +#include "intel_npu/config/config.hpp" +#include "intel_npu/config/npuw.hpp" #include "pugixml.hpp" #include "snapshot.hpp" diff --git a/src/plugins/intel_npu/src/plugin/npuw/partitioning/online/compiler.hpp b/src/plugins/intel_npu/src/plugin/npuw/partitioning/online/compiler.hpp index 69527222612417..d2ddcdd5c55f53 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/partitioning/online/compiler.hpp +++ b/src/plugins/intel_npu/src/plugin/npuw/partitioning/online/compiler.hpp @@ -7,7 +7,7 @@ #include #include "../partitioning.hpp" // ov::npuw::Ensemble -#include "intel_npu/al/config/config.hpp" +#include "intel_npu/config/config.hpp" #include "openvino/openvino.hpp" namespace ov { diff --git a/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.cpp b/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.cpp index 6c7f996acca22f..c4eb5feb732550 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.cpp +++ b/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.cpp @@ -8,7 +8,7 @@ #include "../logging.hpp" #include "../util.hpp" -#include "intel_npu/al/config/npuw.hpp" +#include "intel_npu/config/npuw.hpp" #include "online/compiler.hpp" #include "online/utils/utils.hpp" // getMetaDesc #include "openvino/core/parallel.hpp" diff --git a/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.hpp b/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.hpp index 5343ba26e6e5aa..d613e9dcc4a0a1 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.hpp +++ b/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.hpp @@ -11,7 +11,7 @@ #include "../lazy_tensor.hpp" #include "../spatial.hpp" -#include "intel_npu/al/config/config.hpp" +#include "intel_npu/config/config.hpp" #include "openvino/openvino.hpp" namespace ov { diff --git a/src/plugins/intel_npu/src/plugin/npuw/util.cpp b/src/plugins/intel_npu/src/plugin/npuw/util.cpp index da62d040c06095..dfef4defb48c04 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/util.cpp +++ b/src/plugins/intel_npu/src/plugin/npuw/util.cpp @@ -4,7 +4,7 @@ #include "util.hpp" -#include +#include #include #include #include diff --git a/src/plugins/intel_npu/src/plugin/src/backends.cpp b/src/plugins/intel_npu/src/plugin/src/backends.cpp index 9b090e4ec91529..9212506e7ec61f 100644 --- a/src/plugins/intel_npu/src/plugin/src/backends.cpp +++ b/src/plugins/intel_npu/src/plugin/src/backends.cpp @@ -7,8 +7,8 @@ #include #include -#include "device_helpers.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/common/device_helpers.hpp" +#include "intel_npu/config/common.hpp" #if defined(ENABLE_ZEROAPI_BACKEND) # include "zero_backend.hpp" diff --git a/src/plugins/intel_npu/src/plugin/src/compiled_model.cpp b/src/plugins/intel_npu/src/plugin/src/compiled_model.cpp index 91aa19499d9de5..bae0cb545b3c9f 100644 --- a/src/plugins/intel_npu/src/plugin/src/compiled_model.cpp +++ b/src/plugins/intel_npu/src/plugin/src/compiled_model.cpp @@ -8,12 +8,12 @@ #include #include "async_infer_request.hpp" -#include "intel_npu/al/config/common.hpp" -#include "intel_npu/al/config/compiler.hpp" -#include "intel_npu/al/config/config.hpp" -#include "intel_npu/al/config/runtime.hpp" -#include "intel_npu/al/icompiler.hpp" -#include "intel_npu/al/itt.hpp" +#include "intel_npu/common/itt.hpp" +#include "intel_npu/config/common.hpp" +#include "intel_npu/config/compiler.hpp" +#include "intel_npu/config/config.hpp" +#include "intel_npu/config/runtime.hpp" +#include "intel_npu/icompiler.hpp" #include "openvino/pass/constant_folding.hpp" #include "openvino/pass/manager.hpp" #include "openvino/runtime/properties.hpp" diff --git a/src/plugins/intel_npu/src/plugin/src/compiler.cpp b/src/plugins/intel_npu/src/plugin/src/compiler.cpp index 6b5a5e1127643d..3e270e7ed4571c 100644 --- a/src/plugins/intel_npu/src/plugin/src/compiler.cpp +++ b/src/plugins/intel_npu/src/plugin/src/compiler.cpp @@ -4,10 +4,10 @@ #include "compiler.hpp" -#include "intel_npu/al/config/compiler.hpp" -#include "intel_npu/al/itt.hpp" +#include "intel_npu/common/itt.hpp" +#include "intel_npu/config/compiler.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "intel_npu/utils/logger/logger.hpp" -#include "npu_private_properties.hpp" #ifdef ENABLE_DRIVER_COMPILER_ADAPTER # include "driver_compiler_adapter.hpp" diff --git a/src/plugins/intel_npu/src/plugin/src/metrics.cpp b/src/plugins/intel_npu/src/plugin/src/metrics.cpp index 15c7bb2bd32d04..b6853bc5a9de9f 100644 --- a/src/plugins/intel_npu/src/plugin/src/metrics.cpp +++ b/src/plugins/intel_npu/src/plugin/src/metrics.cpp @@ -5,8 +5,8 @@ // Plugin #include "metrics.hpp" -#include "device_helpers.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/common/device_helpers.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "openvino/runtime/intel_npu/properties.hpp" namespace intel_npu { diff --git a/src/plugins/intel_npu/src/plugin/src/plugin.cpp b/src/plugins/intel_npu/src/plugin/src/plugin.cpp index 834f45ffd15943..f63bcc8bf3b96e 100644 --- a/src/plugins/intel_npu/src/plugin/src/plugin.cpp +++ b/src/plugins/intel_npu/src/plugin/src/plugin.cpp @@ -8,12 +8,12 @@ #include "compiled_model.hpp" #include "compiler.hpp" -#include "device_helpers.hpp" -#include "intel_npu/al/config/common.hpp" -#include "intel_npu/al/config/compiler.hpp" -#include "intel_npu/al/config/npuw.hpp" -#include "intel_npu/al/config/runtime.hpp" -#include "intel_npu/al/itt.hpp" +#include "intel_npu/common/device_helpers.hpp" +#include "intel_npu/common/itt.hpp" +#include "intel_npu/config/common.hpp" +#include "intel_npu/config/compiler.hpp" +#include "intel_npu/config/npuw.hpp" +#include "intel_npu/config/runtime.hpp" #include "npuw/compiled_model.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" @@ -21,6 +21,7 @@ #include "openvino/runtime/properties.hpp" #include "remote_context.hpp" + using namespace intel_npu; namespace { diff --git a/src/plugins/intel_npu/src/plugin/src/remote_context.cpp b/src/plugins/intel_npu/src/plugin/src/remote_context.cpp index 9539826f985147..938057668a7df0 100644 --- a/src/plugins/intel_npu/src/plugin/src/remote_context.cpp +++ b/src/plugins/intel_npu/src/plugin/src/remote_context.cpp @@ -4,7 +4,7 @@ #include "remote_context.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #include "openvino/runtime/intel_npu/remote_properties.hpp" using namespace ov::intel_npu; diff --git a/src/plugins/intel_npu/src/utils/src/zero/CMakeLists.txt b/src/plugins/intel_npu/src/utils/src/zero/CMakeLists.txt index 74072d21581445..7e99bcf0a46175 100644 --- a/src/plugins/intel_npu/src/utils/src/zero/CMakeLists.txt +++ b/src/plugins/intel_npu/src/utils/src/zero/CMakeLists.txt @@ -20,7 +20,6 @@ target_include_directories( target_link_libraries( ${TARGET_NAME} - PUBLIC openvino::npu_al PRIVATE openvino::runtime openvino::runtime::dev) # # targets install diff --git a/src/plugins/intel_npu/tests/functional/CMakeLists.txt b/src/plugins/intel_npu/tests/functional/CMakeLists.txt index 1d8bf947e63420..eac8166b02be46 100644 --- a/src/plugins/intel_npu/tests/functional/CMakeLists.txt +++ b/src/plugins/intel_npu/tests/functional/CMakeLists.txt @@ -42,6 +42,7 @@ ov_add_test_target( openvino::format_reader openvino::reference openvino::runtime + openvino::npu_common openvino::npu_al) if(WIN32) diff --git a/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.cpp b/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.cpp index 3d7d4eb89eff4c..86a4e636887e1a 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.cpp @@ -6,7 +6,7 @@ #include "common/npu_test_env_cfg.hpp" #include "common/utils.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; diff --git a/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.hpp b/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.hpp index 05e580ab99664c..804ad9b9e05c43 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.hpp +++ b/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.hpp @@ -12,7 +12,7 @@ #include "common/npu_test_env_cfg.hpp" #include "common/utils.hpp" #include "functional_test_utils/ov_plugin_cache.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "openvino/core/any.hpp" #include "openvino/core/node_vector.hpp" #include "openvino/core/type/element_iterator.hpp" diff --git a/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.cpp b/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.cpp index 95405abc0f23da..8856425feac25b 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.cpp @@ -3,9 +3,10 @@ // #include "behavior/fail_gracefully_forward_compatibility.hpp" -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; @@ -17,7 +18,8 @@ namespace { const std::vector configs = {{}}; -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTest, FailGracefullyTest, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTest, + FailGracefullyTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), FailGracefullyTest::getTestCaseName); diff --git a/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.hpp b/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.hpp index 196844cd983f54..2b22475d0743f0 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.hpp +++ b/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.hpp @@ -4,23 +4,22 @@ #pragma once -#include "base/ov_behavior_test_utils.hpp" -#include "common/npu_test_env_cfg.hpp" -#include "common_test_utils/node_builders/constant.hpp" -#include "functional_test_utils/ov_plugin_cache.hpp" - #include #include #include -#include +#include #include #include #include #include #include -#include "intel_npu/al/config/common.hpp" +#include "base/ov_behavior_test_utils.hpp" +#include "common/npu_test_env_cfg.hpp" +#include "common_test_utils/node_builders/constant.hpp" +#include "functional_test_utils/ov_plugin_cache.hpp" +#include "intel_npu/config/common.hpp" using CompilationParams = std::tuple& arg): Op({arg}) { + explicit UnsupportedTestOperation(const ov::Output& arg) : Op({arg}) { constructor_validate_and_infer_types(); } @@ -57,9 +56,8 @@ class UnsupportedTestOperation : public ov::op::Op { } }; -class FailGracefullyTest : - public ov::test::behavior::OVPluginTestBase, - public testing::WithParamInterface { +class FailGracefullyTest : public ov::test::behavior::OVPluginTestBase, + public testing::WithParamInterface { protected: std::shared_ptr core = utils::PluginCache::get().core(); ov::AnyMap configuration; diff --git a/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.cpp b/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.cpp index 433af189a79fdb..5d023fe9d0bee6 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.cpp @@ -6,8 +6,8 @@ #include "common/npu_test_env_cfg.hpp" #include "common/utils.hpp" -#include "intel_npu/al/config/common.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/config/common.hpp" +#include "intel_npu/npu_private_properties.hpp" using namespace ov::test::behavior; diff --git a/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.hpp b/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.hpp index 6b7372223c6bea..20be5ed25edd27 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.hpp +++ b/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.hpp @@ -16,7 +16,7 @@ #include "common/npu_test_env_cfg.hpp" #include "common/utils.hpp" #include "functional_test_utils/ov_plugin_cache.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "openvino/core/any.hpp" #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" diff --git a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/custom_stream.cpp b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/custom_stream.cpp index 5adc454e81f679..3950caa379cf65 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/custom_stream.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/custom_stream.cpp @@ -9,7 +9,7 @@ #include "common/npu_test_env_cfg.hpp" #include "common_test_utils/node_builders/constant.hpp" #include "graph_transformations.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #include "openvino/opsets/opset11.hpp" using CompilationParams = std::tuple configs = { - {{ov::intel_npu::compiler_type(ov::intel_npu::CompilerType::DRIVER)}}, + {{ov::intel_npu::compiler_type(ov::intel_npu::CompilerType::DRIVER)}}, }; -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTest, DriverCompilerAdapterDowngradeInterpolate11TestNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTest, + DriverCompilerAdapterDowngradeInterpolate11TestNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), DriverCompilerAdapterDowngradeInterpolate11TestNPU::getTestCaseName); diff --git a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/expected_throw.cpp b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/expected_throw.cpp index 119c9c36e5177f..1ea360e8f7aca8 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/expected_throw.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/expected_throw.cpp @@ -3,14 +3,16 @@ // #include "expected_throw.hpp" + #include "common/utils.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; const std::vector configs = {{{ov::intel_npu::compiler_type(ov::intel_npu::CompilerType::DRIVER)}}}; -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTest, DriverCompilerAdapterExpectedThrowNPU, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTest, + DriverCompilerAdapterExpectedThrowNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), DriverCompilerAdapterExpectedThrowNPU::getTestCaseName); diff --git a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/inputs_outputs.cpp b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/inputs_outputs.cpp index 138640ed4c619a..7e6bd10d893c53 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/inputs_outputs.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/inputs_outputs.cpp @@ -3,17 +3,19 @@ // #include "inputs_outputs.hpp" -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; const std::vector configs = { - {{ov::intel_npu::compiler_type(ov::intel_npu::CompilerType::DRIVER)}}, + {{ov::intel_npu::compiler_type(ov::intel_npu::CompilerType::DRIVER)}}, }; -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTest, DriverCompilerAdapterInputsOutputsTestNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTest, + DriverCompilerAdapterInputsOutputsTestNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), DriverCompilerAdapterInputsOutputsTestNPU::getTestCaseName); diff --git a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/properties_compatibility.cpp b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/properties_compatibility.cpp index 8f1d58945c1fbb..b74ceec480988d 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/properties_compatibility.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/properties_compatibility.cpp @@ -4,7 +4,7 @@ #include "base/ov_behavior_test_utils.hpp" #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #include "shared_test_classes/subgraph/split_conv_concat.hpp" using CompilationParams = std::tuple + #include + #include "base/ov_behavior_test_utils.hpp" -#include "common/utils.hpp" #include "common/npu_test_env_cfg.hpp" +#include "common/utils.hpp" #include "common_test_utils/node_builders/constant.hpp" #include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #include "common_test_utils/subgraph_builders/conv_pool_relu_non_zero.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" using CompilationParams = std::tuple& arg): Op({arg}) { + explicit UnsupportedTestOp(const ov::Output& arg) : Op({arg}) { constructor_validate_and_infer_types(); } @@ -58,9 +60,8 @@ std::shared_ptr createModelWithUnknownNode() { return std::make_shared(results, ov::ParameterVector{params}, "CustomOpModel"); } -class QueryNetworkTestNPU : - public ov::test::behavior::OVPluginTestBase, - public testing::WithParamInterface { +class QueryNetworkTestNPU : public ov::test::behavior::OVPluginTestBase, + public testing::WithParamInterface { public: ov::SupportedOpsMap testQueryNetwork(std::shared_ptr model) { std::shared_ptr core = utils::PluginCache::get().core(); @@ -105,26 +106,27 @@ class QueryNetworkTestNPU : const std::vector configs = {{}}; -using QueryNetworkTestSuite1NPU = QueryNetworkTestNPU; - -// Test query with a supported OpenVINO model -TEST_P(QueryNetworkTestSuite1NPU, TestQueryNetworkSupported) { - const auto supportedModel = ov::test::utils::make_conv_pool_relu(); - ov::SupportedOpsMap result; - EXPECT_NO_THROW(result = testQueryNetwork(supportedModel)); - std::unordered_set expected, actual; - for (auto& op : supportedModel->get_ops()) { - expected.insert(op->get_friendly_name()); - } - for (auto& name : result) { - actual.insert(name.first); - } - EXPECT_EQ(expected, actual); -} - -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTest, QueryNetworkTestSuite1NPU, - ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), - ::testing::ValuesIn(configs)), +using QueryNetworkTestSuite1NPU = QueryNetworkTestNPU; + +// Test query with a supported OpenVINO model +TEST_P(QueryNetworkTestSuite1NPU, TestQueryNetworkSupported) { + const auto supportedModel = ov::test::utils::make_conv_pool_relu(); + ov::SupportedOpsMap result; + EXPECT_NO_THROW(result = testQueryNetwork(supportedModel)); + std::unordered_set expected, actual; + for (auto& op : supportedModel->get_ops()) { + expected.insert(op->get_friendly_name()); + } + for (auto& name : result) { + actual.insert(name.first); + } + EXPECT_EQ(expected, actual); +} + +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTest, + QueryNetworkTestSuite1NPU, + ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), + ::testing::ValuesIn(configs)), QueryNetworkTestNPU::getTestCaseName); using QueryNetworkTestSuite2NPU = QueryNetworkTestNPU; @@ -149,7 +151,8 @@ TEST_P(QueryNetworkTestSuite2NPU, DISABLED_TestQueryNetworkUnsupported) { } } -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTest, QueryNetworkTestSuite2NPU, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTest, + QueryNetworkTestSuite2NPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), QueryNetworkTestNPU::getTestCaseName); diff --git a/src/plugins/intel_npu/tests/functional/behavior/npuw/behavior_tests.hpp b/src/plugins/intel_npu/tests/functional/behavior/npuw/behavior_tests.hpp index 85658ac4a42dd1..2f579a3593af00 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/npuw/behavior_tests.hpp +++ b/src/plugins/intel_npu/tests/functional/behavior/npuw/behavior_tests.hpp @@ -3,19 +3,18 @@ // #pragma once +#include + #include #include -#include - +#include "generators/model_generator.hpp" +#include "intel_npu/npuw_private_properties.hpp" +#include "mocks/mock_plugins.hpp" +#include "mocks/register_in_ov.hpp" #include "openvino/runtime/core.hpp" #include "openvino/runtime/iplugin.hpp" #include "openvino/runtime/make_tensor.hpp" -#include "npuw_private_properties.hpp" - -#include "mocks/mock_plugins.hpp" -#include "mocks/register_in_ov.hpp" -#include "generators/model_generator.hpp" namespace ov { namespace npuw { @@ -60,8 +59,7 @@ ov::Tensor make_random_tensor(ov::element::Type type, ov::Shape shape, T rand_min = std::numeric_limits::min(), T rand_max = std::numeric_limits::max()) { - size_t tensor_size = - std::accumulate(shape.begin(), shape.end(), std::size_t(1), std::multiplies()); + size_t tensor_size = std::accumulate(shape.begin(), shape.end(), std::size_t(1), std::multiplies()); auto tensor = ov::Tensor(type, shape); auto data = tensor.data(); @@ -73,7 +71,7 @@ ov::Tensor make_random_tensor(ov::element::Type type, return tensor; } -template +template void set_random_inputs(ov::InferRequest infer_request) { for (const auto& input : infer_request.get_compiled_model().inputs()) { // TODO: Extend template header to two types. diff --git a/src/plugins/intel_npu/tests/functional/behavior/npuw/mocks/mock_plugins.cpp b/src/plugins/intel_npu/tests/functional/behavior/npuw/mocks/mock_plugins.cpp index 950d80b279324f..a7f285657b5c10 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/npuw/mocks/mock_plugins.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/npuw/mocks/mock_plugins.cpp @@ -2,26 +2,26 @@ // SPDX-License-Identifier: Apache-2.0 // -#include +#include "mock_plugins.hpp" + #include +#include #include #include -#include "mock_plugins.hpp" +#include "intel_npu/npu_private_properties.hpp" +#include "intel_npu/npuw_private_properties.hpp" #include "openvino/core/version.hpp" #include "openvino/pass/serialize.hpp" #include "openvino/runtime/make_tensor.hpp" -#include "npu_private_properties.hpp" -#include "npuw_private_properties.hpp" - namespace ov { namespace npuw { namespace tests { // Need to also mock async infer request or use infer() call to indicate that start_async() was called. MockInferRequestBase::MockInferRequestBase(const std::shared_ptr& compiled_model) - : ov::ISyncInferRequest(compiled_model) { + : ov::ISyncInferRequest(compiled_model) { OPENVINO_ASSERT(compiled_model); } @@ -39,7 +39,6 @@ void MockInferRequestBase::create_implementation() { set_tensor(outputs[i], ov::get_tensor_impl(out_tensors[i])); } - ON_CALL(*this, query_state()).WillByDefault([]() -> std::vector> { OPENVINO_NOT_IMPLEMENTED; }); @@ -48,17 +47,16 @@ void MockInferRequestBase::create_implementation() { }); } - -MockCompiledModelBase::MockCompiledModelBase(const std::shared_ptr& model, - std::shared_ptr plugin, - const ov::AnyMap& config, - std::shared_ptr, bool>>> infer_reqs_to_expectations_ptr) - : ov::ICompiledModel(model, plugin), - m_infer_reqs_to_expectations_ptr(infer_reqs_to_expectations_ptr), - m_model(model), - m_config(config) { - } - +MockCompiledModelBase::MockCompiledModelBase( + const std::shared_ptr& model, + std::shared_ptr plugin, + const ov::AnyMap& config, + std::shared_ptr, bool>>> + infer_reqs_to_expectations_ptr) + : ov::ICompiledModel(model, plugin), + m_infer_reqs_to_expectations_ptr(infer_reqs_to_expectations_ptr), + m_model(model), + m_config(config) {} void MockCompiledModelBase::create_implementation() { ON_CALL(*this, inputs()).WillByDefault(testing::ReturnRefOfCopy(m_model->inputs())); @@ -81,13 +79,12 @@ void MockCompiledModelBase::create_implementation() { return decltype(ov::supported_properties)::value_type(supported_properties); } else if (name == ov::num_streams) { if (this->m_config.count(ov::internal::exclusive_async_requests.name())) { - auto exclusive_async_requests = - m_config.at(ov::internal::exclusive_async_requests.name()).as(); + auto exclusive_async_requests = m_config.at(ov::internal::exclusive_async_requests.name()).as(); if (exclusive_async_requests) return ov::streams::Num(1); } return this->m_config.count(ov::num_streams.name()) ? m_config.at(ov::num_streams.name()) - : ov::streams::Num(1); + : ov::streams::Num(1); } else if (name == ov::enable_profiling) { return this->m_config.count(ov::enable_profiling.name()) ? m_config.at(ov::enable_profiling.name()) : false; } else { @@ -96,11 +93,10 @@ void MockCompiledModelBase::create_implementation() { }); ON_CALL(*this, create_sync_infer_request).WillByDefault([this]() { std::lock_guard lock(m_mock_creation_mutex); - auto mock_sync_infer_request = std::make_shared( - std::dynamic_pointer_cast(shared_from_this())); + auto mock_sync_infer_request = + std::make_shared(std::dynamic_pointer_cast(shared_from_this())); mock_sync_infer_request->create_implementation(); - if (m_infer_reqs_to_expectations_ptr && - m_infer_reqs_to_expectations_ptr->count(m_num_created_infer_requests)) { + if (m_infer_reqs_to_expectations_ptr && m_infer_reqs_to_expectations_ptr->count(m_num_created_infer_requests)) { auto& expectation_and_status = (*m_infer_reqs_to_expectations_ptr)[m_num_created_infer_requests]; auto& expectation = expectation_and_status.first; auto& status = expectation_and_status.second; @@ -114,8 +110,7 @@ void MockCompiledModelBase::create_implementation() { }); } - -template +template MockPluginBase::MockPluginBase() { m_plugin_name = std::string("openvino_") + std::string(device_name) + std::string("_plugin"); const ov::Version version = {CI_BUILD_NUMBER, m_plugin_name.c_str()}; @@ -124,54 +119,55 @@ MockPluginBase::MockPluginBase() { } namespace { - ov::PropertyName RO_property(const std::string& propertyName) { - return ov::PropertyName(propertyName, ov::PropertyMutability::RO); - }; +ov::PropertyName RO_property(const std::string& propertyName) { + return ov::PropertyName(propertyName, ov::PropertyMutability::RO); +}; - ov::PropertyName RW_property(const std::string& propertyName) { - return ov::PropertyName(propertyName, ov::PropertyMutability::RW); - }; -} // anonymous namespace +ov::PropertyName RW_property(const std::string& propertyName) { + return ov::PropertyName(propertyName, ov::PropertyMutability::RW); +}; +} // anonymous namespace template void MockPluginBase::create_implementation() { ON_CALL(*this, compile_model(testing::A&>(), testing::_)) - .WillByDefault([this](const std::shared_ptr& model, const ov::AnyMap& properties) { - std::lock_guard lock(m_mock_creation_mutex); + .WillByDefault([this](const std::shared_ptr& model, const ov::AnyMap& properties) { + std::lock_guard lock(m_mock_creation_mutex); - std::shared_ptr, bool>>> infer_reqs_to_expectations; - if (m_models_to_reqs_to_expectations.count(m_num_compiled_models)) { - infer_reqs_to_expectations = m_models_to_reqs_to_expectations[m_num_compiled_models]; - } + std::shared_ptr, bool>>> + infer_reqs_to_expectations; + if (m_models_to_reqs_to_expectations.count(m_num_compiled_models)) { + infer_reqs_to_expectations = m_models_to_reqs_to_expectations[m_num_compiled_models]; + } - auto mock_compiled_model = std::make_shared( - model, shared_from_this(), properties, - infer_reqs_to_expectations); + auto mock_compiled_model = + std::make_shared(model, shared_from_this(), properties, infer_reqs_to_expectations); - mock_compiled_model->create_implementation(); + mock_compiled_model->create_implementation(); - if (m_models_to_expectations.count(m_num_compiled_models)) { - auto& expectation_and_status = m_models_to_expectations[m_num_compiled_models]; - auto& expectation = expectation_and_status.first; - auto& status = expectation_and_status.second; - expectation(*mock_compiled_model); - status = true; // Expectation will be checked - } + if (m_models_to_expectations.count(m_num_compiled_models)) { + auto& expectation_and_status = m_models_to_expectations[m_num_compiled_models]; + auto& expectation = expectation_and_status.first; + auto& status = expectation_and_status.second; + expectation(*mock_compiled_model); + status = true; // Expectation will be checked + } - ++m_num_compiled_models; + ++m_num_compiled_models; - return mock_compiled_model; - }); + return mock_compiled_model; + }); ON_CALL(*this, compile_model(testing::A(), testing::_)) - .WillByDefault([](const std::string& model_path, - const ov::AnyMap& properties) -> std::shared_ptr { + .WillByDefault( + [](const std::string& model_path, const ov::AnyMap& properties) -> std::shared_ptr { OPENVINO_NOT_IMPLEMENTED; }); ON_CALL(*this, compile_model(testing::A&>(), testing::_, testing::_)) - .WillByDefault([](const std::shared_ptr& model, const ov::AnyMap& properties, - const ov::SoPtr& context) -> std::shared_ptr { - OPENVINO_NOT_IMPLEMENTED; - }); + .WillByDefault([](const std::shared_ptr& model, + const ov::AnyMap& properties, + const ov::SoPtr& context) -> std::shared_ptr { + OPENVINO_NOT_IMPLEMENTED; + }); ON_CALL(*this, set_property).WillByDefault([this](const ov::AnyMap& properties) { for (const auto& it : properties) { if (it.first == ov::num_streams.name()) @@ -189,14 +185,12 @@ void MockPluginBase::create_implementation() { for (int i = 0; i < DeviceType::num_device_ids; ++i) { device_ids.push_back(std::to_string(i)); }; - const static std::vector roProperties{ - RO_property(ov::supported_properties.name()), RO_property(ov::available_devices.name()), - RO_property(ov::device::uuid.name()), RO_property(ov::device::capabilities.name()) - }; + const static std::vector roProperties{RO_property(ov::supported_properties.name()), + RO_property(ov::available_devices.name()), + RO_property(ov::device::uuid.name()), + RO_property(ov::device::capabilities.name())}; // the whole config is RW before network is loaded. - const static std::vector rwProperties{ - RW_property(ov::num_streams.name()) - }; + const static std::vector rwProperties{RW_property(ov::num_streams.name())}; std::string device_id; if (arguments.find(ov::device::id.name()) != arguments.end()) { @@ -211,7 +205,7 @@ void MockPluginBase::create_implementation() { return decltype(ov::supported_properties)::value_type(supportedProperties); } else if (name == ov::internal::supported_properties) { return decltype(ov::internal::supported_properties)::value_type( - {ov::PropertyName{ov::internal::exclusive_async_requests.name(), ov::PropertyMutability::RW}}); + {ov::PropertyName{ov::internal::exclusive_async_requests.name(), ov::PropertyMutability::RW}}); } else if (name == ov::internal::exclusive_async_requests) { return decltype(ov::internal::exclusive_async_requests)::value_type{exclusive_async_requests}; } else if (name == ov::device::uuid) { @@ -240,45 +234,47 @@ void MockPluginBase::create_implementation() { OPENVINO_THROW("Unsupported property: ", name); }); ON_CALL(*this, create_context) - .WillByDefault([](const ov::AnyMap& remote_properties) -> ov::SoPtr { - OPENVINO_NOT_IMPLEMENTED; - }); + .WillByDefault([](const ov::AnyMap& remote_properties) -> ov::SoPtr { + OPENVINO_NOT_IMPLEMENTED; + }); // This method is utilized for remote tensor allocation in NPUW JustInferRequest and Weight bank. ON_CALL(*this, get_default_context) - .WillByDefault([](const ov::AnyMap& remote_properties) -> ov::SoPtr { - return std::make_shared(device_name); - }); + .WillByDefault([](const ov::AnyMap& remote_properties) -> ov::SoPtr { + return std::make_shared(device_name); + }); ON_CALL(*this, import_model(testing::_, testing::_)) - .WillByDefault([](std::istream& model, const ov::AnyMap& properties) - -> std::shared_ptr { - OPENVINO_NOT_IMPLEMENTED; - }); + .WillByDefault([](std::istream& model, const ov::AnyMap& properties) -> std::shared_ptr { + OPENVINO_NOT_IMPLEMENTED; + }); ON_CALL(*this, import_model(testing::_, testing::_, testing::_)) - .WillByDefault([](std::istream& model, const ov::SoPtr& context, - const ov::AnyMap& properties) -> std::shared_ptr { - OPENVINO_NOT_IMPLEMENTED; - }); + .WillByDefault([](std::istream& model, + const ov::SoPtr& context, + const ov::AnyMap& properties) -> std::shared_ptr { + OPENVINO_NOT_IMPLEMENTED; + }); ON_CALL(*this, query_model) - .WillByDefault([](const std::shared_ptr& model, const ov::AnyMap& properties) - -> ov::SupportedOpsMap{ + .WillByDefault( + [](const std::shared_ptr& model, const ov::AnyMap& properties) -> ov::SupportedOpsMap { OPENVINO_NOT_IMPLEMENTED; }); } template -void MockPluginBase::set_expectations_to_comp_models(int model_idx, std::function expectations) { +void MockPluginBase::set_expectations_to_comp_models(int model_idx, + std::function expectations) { m_models_to_expectations[model_idx] = std::pair, bool>(expectations, false); } template -void MockPluginBase::set_expectations_to_infer_reqs(int model_idx, int req_idx, +void MockPluginBase::set_expectations_to_infer_reqs(int model_idx, + int req_idx, std::function expectations) { if (!m_models_to_reqs_to_expectations.count(model_idx)) { m_models_to_reqs_to_expectations[model_idx] = - std::make_shared, bool>>>(); + std::make_shared, bool>>>(); } - m_models_to_reqs_to_expectations[model_idx]->insert( - {req_idx, std::pair, bool>(expectations, false)}); + m_models_to_reqs_to_expectations[model_idx]->insert( + {req_idx, std::pair, bool>(expectations, false)}); } template @@ -287,7 +283,7 @@ MockPluginBase::~MockPluginBase() { auto idx = idx_to_expectation_and_status.first; auto expectation_and_status = idx_to_expectation_and_status.second; if (!expectation_and_status.second) { - ADD_FAILURE() << DeviceType::name << ": Expectation for model[" << idx + ADD_FAILURE() << DeviceType::name << ": Expectation for model[" << idx << "] was set, but that model was not compiled"; } } @@ -298,9 +294,9 @@ MockPluginBase::~MockPluginBase() { auto expectation_and_status = req_to_expectation_and_status.second; if (!expectation_and_status.second) { auto model_idx = idx_to_reqs_to_expectation_and_status.first; - ADD_FAILURE() << DeviceType::name << ": Expectation for request[" << req_idx - << "] of model[" << model_idx << "] was set, but that request was " - << "not created"; + ADD_FAILURE() << DeviceType::name << ": Expectation for request[" << req_idx << "] of model[" + << model_idx << "] was set, but that request was " + << "not created"; } } } diff --git a/src/plugins/intel_npu/tests/functional/behavior/ov_infer_request/compile_and_infer.cpp b/src/plugins/intel_npu/tests/functional/behavior/ov_infer_request/compile_and_infer.cpp index b26d0fc621a9db..5d308c344056ef 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/ov_infer_request/compile_and_infer.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/ov_infer_request/compile_and_infer.cpp @@ -4,7 +4,7 @@ #include "overload/compile_and_infer.hpp" -#include +#include #include "common/npu_test_env_cfg.hpp" #include "common/utils.hpp" diff --git a/src/plugins/intel_npu/tests/functional/behavior/ov_plugin/internal_properties_tests.cpp b/src/plugins/intel_npu/tests/functional/behavior/ov_plugin/internal_properties_tests.cpp index 006b7a19fb6874..76ba22b26a58a7 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/ov_plugin/internal_properties_tests.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/ov_plugin/internal_properties_tests.cpp @@ -6,7 +6,7 @@ #include "overload/ov_plugin/internal_properties_tests.hpp" #include "common/npu_test_env_cfg.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/npu_private_properties.hpp" namespace ov::test::behavior { diff --git a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/d3dx12_core.h b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/d3dx12_core.h new file mode 100644 index 00000000000000..e20327ccbe3158 --- /dev/null +++ b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/d3dx12_core.h @@ -0,0 +1,1389 @@ +//********************************************************* +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT). +// +//********************************************************* + +#pragma once +#ifdef _WIN32 + +# ifndef __cplusplus +# error D3DX12 requires C++ +# endif + +# include + +# include "d3d12.h" +# include "d3dx12_default.h" + + +//------------------------------------------------------------------------------------------------ +# ifndef D3DX12_ASSERT +# ifdef assert +# define D3DX12_ASSERT(x) assert(x) +# else +# define D3DX12_ASSERT(x) +# endif +# endif + +//------------------------------------------------------------------------------------------------ +template +inline ID3D12CommandList* const* CommandListCast(t_CommandListType* const* pp) noexcept { + // This cast is useful for passing strongly typed command list pointers into + // ExecuteCommandLists. + // This cast is valid as long as the const-ness is respected. D3D12 APIs do + // respect the const-ness of their arguments. + return reinterpret_cast(pp); +} + +//------------------------------------------------------------------------------------------------ +inline bool operator==(const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r) noexcept { + return l.TopLeftX == r.TopLeftX && l.TopLeftY == r.TopLeftY && l.Width == r.Width && l.Height == r.Height && + l.MinDepth == r.MinDepth && l.MaxDepth == r.MaxDepth; +} + +//------------------------------------------------------------------------------------------------ +inline bool operator!=(const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r) noexcept { + return !(l == r); +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RECT : public D3D12_RECT { + CD3DX12_RECT() = default; + explicit CD3DX12_RECT(const D3D12_RECT& o) noexcept : D3D12_RECT(o) {} + explicit CD3DX12_RECT(LONG Left, LONG Top, LONG Right, LONG Bottom) noexcept { + left = Left; + top = Top; + right = Right; + bottom = Bottom; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_VIEWPORT : public D3D12_VIEWPORT { + CD3DX12_VIEWPORT() = default; + explicit CD3DX12_VIEWPORT(const D3D12_VIEWPORT& o) noexcept : D3D12_VIEWPORT(o) {} + explicit CD3DX12_VIEWPORT(FLOAT topLeftX, + FLOAT topLeftY, + FLOAT width, + FLOAT height, + FLOAT minDepth = D3D12_MIN_DEPTH, + FLOAT maxDepth = D3D12_MAX_DEPTH) noexcept { + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = width; + Height = height; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + explicit CD3DX12_VIEWPORT(_In_ ID3D12Resource* pResource, + UINT mipSlice = 0, + FLOAT topLeftX = 0.0f, + FLOAT topLeftY = 0.0f, + FLOAT minDepth = D3D12_MIN_DEPTH, + FLOAT maxDepth = D3D12_MAX_DEPTH) noexcept { +# if defined(_MSC_VER) || !defined(_WIN32) + const auto Desc = pResource->GetDesc(); +# else + D3D12_RESOURCE_DESC tmpDesc; + const auto& Desc = *pResource->GetDesc(&tmpDesc); +# endif + const UINT64 SubresourceWidth = Desc.Width >> mipSlice; + const UINT64 SubresourceHeight = Desc.Height >> mipSlice; + switch (Desc.Dimension) { + case D3D12_RESOURCE_DIMENSION_BUFFER: + TopLeftX = topLeftX; + TopLeftY = 0.0f; + Width = float(Desc.Width) - topLeftX; + Height = 1.0f; + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE1D: + TopLeftX = topLeftX; + TopLeftY = 0.0f; + Width = (SubresourceWidth ? float(SubresourceWidth) : 1.0f) - topLeftX; + Height = 1.0f; + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE2D: + case D3D12_RESOURCE_DIMENSION_TEXTURE3D: + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = (SubresourceWidth ? float(SubresourceWidth) : 1.0f) - topLeftX; + Height = (SubresourceHeight ? float(SubresourceHeight) : 1.0f) - topLeftY; + break; + default: + break; + } + + MinDepth = minDepth; + MaxDepth = maxDepth; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_BOX : public D3D12_BOX { + CD3DX12_BOX() = default; + explicit CD3DX12_BOX(const D3D12_BOX& o) noexcept : D3D12_BOX(o) {} + explicit CD3DX12_BOX(LONG Left, LONG Right) noexcept { + left = static_cast(Left); + top = 0; + front = 0; + right = static_cast(Right); + bottom = 1; + back = 1; + } + explicit CD3DX12_BOX(LONG Left, LONG Top, LONG Right, LONG Bottom) noexcept { + left = static_cast(Left); + top = static_cast(Top); + front = 0; + right = static_cast(Right); + bottom = static_cast(Bottom); + back = 1; + } + explicit CD3DX12_BOX(LONG Left, LONG Top, LONG Front, LONG Right, LONG Bottom, LONG Back) noexcept { + left = static_cast(Left); + top = static_cast(Top); + front = static_cast(Front); + right = static_cast(Right); + bottom = static_cast(Bottom); + back = static_cast(Back); + } +}; +inline bool operator==(const D3D12_BOX& l, const D3D12_BOX& r) noexcept { + return l.left == r.left && l.top == r.top && l.front == r.front && l.right == r.right && l.bottom == r.bottom && + l.back == r.back; +} +inline bool operator!=(const D3D12_BOX& l, const D3D12_BOX& r) noexcept { + return !(l == r); +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DEPTH_STENCIL_DESC : public D3D12_DEPTH_STENCIL_DESC { + CD3DX12_DEPTH_STENCIL_DESC() = default; + explicit CD3DX12_DEPTH_STENCIL_DESC(const D3D12_DEPTH_STENCIL_DESC& o) noexcept : D3D12_DEPTH_STENCIL_DESC(o) {} + explicit CD3DX12_DEPTH_STENCIL_DESC(CD3DX12_DEFAULT) noexcept { + DepthEnable = TRUE; + DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL; + DepthFunc = D3D12_COMPARISON_FUNC_LESS; + StencilEnable = FALSE; + StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK; + StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK; + const D3D12_DEPTH_STENCILOP_DESC defaultStencilOp = {D3D12_STENCIL_OP_KEEP, + D3D12_STENCIL_OP_KEEP, + D3D12_STENCIL_OP_KEEP, + D3D12_COMPARISON_FUNC_ALWAYS}; + FrontFace = defaultStencilOp; + BackFace = defaultStencilOp; + } + explicit CD3DX12_DEPTH_STENCIL_DESC(BOOL depthEnable, + D3D12_DEPTH_WRITE_MASK depthWriteMask, + D3D12_COMPARISON_FUNC depthFunc, + BOOL stencilEnable, + UINT8 stencilReadMask, + UINT8 stencilWriteMask, + D3D12_STENCIL_OP frontStencilFailOp, + D3D12_STENCIL_OP frontStencilDepthFailOp, + D3D12_STENCIL_OP frontStencilPassOp, + D3D12_COMPARISON_FUNC frontStencilFunc, + D3D12_STENCIL_OP backStencilFailOp, + D3D12_STENCIL_OP backStencilDepthFailOp, + D3D12_STENCIL_OP backStencilPassOp, + D3D12_COMPARISON_FUNC backStencilFunc) noexcept { + DepthEnable = depthEnable; + DepthWriteMask = depthWriteMask; + DepthFunc = depthFunc; + StencilEnable = stencilEnable; + StencilReadMask = stencilReadMask; + StencilWriteMask = stencilWriteMask; + FrontFace.StencilFailOp = frontStencilFailOp; + FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; + FrontFace.StencilPassOp = frontStencilPassOp; + FrontFace.StencilFunc = frontStencilFunc; + BackFace.StencilFailOp = backStencilFailOp; + BackFace.StencilDepthFailOp = backStencilDepthFailOp; + BackFace.StencilPassOp = backStencilPassOp; + BackFace.StencilFunc = backStencilFunc; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DEPTH_STENCIL_DESC1 : public D3D12_DEPTH_STENCIL_DESC1 { + CD3DX12_DEPTH_STENCIL_DESC1() = default; + explicit CD3DX12_DEPTH_STENCIL_DESC1(const D3D12_DEPTH_STENCIL_DESC1& o) noexcept : D3D12_DEPTH_STENCIL_DESC1(o) {} + explicit CD3DX12_DEPTH_STENCIL_DESC1(const D3D12_DEPTH_STENCIL_DESC& o) noexcept { + DepthEnable = o.DepthEnable; + DepthWriteMask = o.DepthWriteMask; + DepthFunc = o.DepthFunc; + StencilEnable = o.StencilEnable; + StencilReadMask = o.StencilReadMask; + StencilWriteMask = o.StencilWriteMask; + FrontFace.StencilFailOp = o.FrontFace.StencilFailOp; + FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp; + FrontFace.StencilPassOp = o.FrontFace.StencilPassOp; + FrontFace.StencilFunc = o.FrontFace.StencilFunc; + BackFace.StencilFailOp = o.BackFace.StencilFailOp; + BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp; + BackFace.StencilPassOp = o.BackFace.StencilPassOp; + BackFace.StencilFunc = o.BackFace.StencilFunc; + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC1(CD3DX12_DEFAULT) noexcept { + DepthEnable = TRUE; + DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL; + DepthFunc = D3D12_COMPARISON_FUNC_LESS; + StencilEnable = FALSE; + StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK; + StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK; + const D3D12_DEPTH_STENCILOP_DESC defaultStencilOp = {D3D12_STENCIL_OP_KEEP, + D3D12_STENCIL_OP_KEEP, + D3D12_STENCIL_OP_KEEP, + D3D12_COMPARISON_FUNC_ALWAYS}; + FrontFace = defaultStencilOp; + BackFace = defaultStencilOp; + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC1(BOOL depthEnable, + D3D12_DEPTH_WRITE_MASK depthWriteMask, + D3D12_COMPARISON_FUNC depthFunc, + BOOL stencilEnable, + UINT8 stencilReadMask, + UINT8 stencilWriteMask, + D3D12_STENCIL_OP frontStencilFailOp, + D3D12_STENCIL_OP frontStencilDepthFailOp, + D3D12_STENCIL_OP frontStencilPassOp, + D3D12_COMPARISON_FUNC frontStencilFunc, + D3D12_STENCIL_OP backStencilFailOp, + D3D12_STENCIL_OP backStencilDepthFailOp, + D3D12_STENCIL_OP backStencilPassOp, + D3D12_COMPARISON_FUNC backStencilFunc, + BOOL depthBoundsTestEnable) noexcept { + DepthEnable = depthEnable; + DepthWriteMask = depthWriteMask; + DepthFunc = depthFunc; + StencilEnable = stencilEnable; + StencilReadMask = stencilReadMask; + StencilWriteMask = stencilWriteMask; + FrontFace.StencilFailOp = frontStencilFailOp; + FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; + FrontFace.StencilPassOp = frontStencilPassOp; + FrontFace.StencilFunc = frontStencilFunc; + BackFace.StencilFailOp = backStencilFailOp; + BackFace.StencilDepthFailOp = backStencilDepthFailOp; + BackFace.StencilPassOp = backStencilPassOp; + BackFace.StencilFunc = backStencilFunc; + DepthBoundsTestEnable = depthBoundsTestEnable; + } + operator D3D12_DEPTH_STENCIL_DESC() const noexcept { + D3D12_DEPTH_STENCIL_DESC D; + D.DepthEnable = DepthEnable; + D.DepthWriteMask = DepthWriteMask; + D.DepthFunc = DepthFunc; + D.StencilEnable = StencilEnable; + D.StencilReadMask = StencilReadMask; + D.StencilWriteMask = StencilWriteMask; + D.FrontFace.StencilFailOp = FrontFace.StencilFailOp; + D.FrontFace.StencilDepthFailOp = FrontFace.StencilDepthFailOp; + D.FrontFace.StencilPassOp = FrontFace.StencilPassOp; + D.FrontFace.StencilFunc = FrontFace.StencilFunc; + D.BackFace.StencilFailOp = BackFace.StencilFailOp; + D.BackFace.StencilDepthFailOp = BackFace.StencilDepthFailOp; + D.BackFace.StencilPassOp = BackFace.StencilPassOp; + D.BackFace.StencilFunc = BackFace.StencilFunc; + return D; + } +}; + +//------------------------------------------------------------------------------------------------ +# if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606) +struct CD3DX12_DEPTH_STENCIL_DESC2 : public D3D12_DEPTH_STENCIL_DESC2 { + CD3DX12_DEPTH_STENCIL_DESC2() = default; + explicit CD3DX12_DEPTH_STENCIL_DESC2(const D3D12_DEPTH_STENCIL_DESC2& o) noexcept : D3D12_DEPTH_STENCIL_DESC2(o) {} + explicit CD3DX12_DEPTH_STENCIL_DESC2(const D3D12_DEPTH_STENCIL_DESC1& o) noexcept { + DepthEnable = o.DepthEnable; + DepthWriteMask = o.DepthWriteMask; + DepthFunc = o.DepthFunc; + StencilEnable = o.StencilEnable; + FrontFace.StencilFailOp = o.FrontFace.StencilFailOp; + FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp; + FrontFace.StencilPassOp = o.FrontFace.StencilPassOp; + FrontFace.StencilFunc = o.FrontFace.StencilFunc; + FrontFace.StencilReadMask = o.StencilReadMask; + FrontFace.StencilWriteMask = o.StencilWriteMask; + + BackFace.StencilFailOp = o.BackFace.StencilFailOp; + BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp; + BackFace.StencilPassOp = o.BackFace.StencilPassOp; + BackFace.StencilFunc = o.BackFace.StencilFunc; + BackFace.StencilReadMask = o.StencilReadMask; + BackFace.StencilWriteMask = o.StencilWriteMask; + DepthBoundsTestEnable = o.DepthBoundsTestEnable; + } + explicit CD3DX12_DEPTH_STENCIL_DESC2(const D3D12_DEPTH_STENCIL_DESC& o) noexcept { + DepthEnable = o.DepthEnable; + DepthWriteMask = o.DepthWriteMask; + DepthFunc = o.DepthFunc; + StencilEnable = o.StencilEnable; + + FrontFace.StencilFailOp = o.FrontFace.StencilFailOp; + FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp; + FrontFace.StencilPassOp = o.FrontFace.StencilPassOp; + FrontFace.StencilFunc = o.FrontFace.StencilFunc; + FrontFace.StencilReadMask = o.StencilReadMask; + FrontFace.StencilWriteMask = o.StencilWriteMask; + + BackFace.StencilFailOp = o.BackFace.StencilFailOp; + BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp; + BackFace.StencilPassOp = o.BackFace.StencilPassOp; + BackFace.StencilFunc = o.BackFace.StencilFunc; + BackFace.StencilReadMask = o.StencilReadMask; + BackFace.StencilWriteMask = o.StencilWriteMask; + + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC2(CD3DX12_DEFAULT) noexcept { + DepthEnable = TRUE; + DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL; + DepthFunc = D3D12_COMPARISON_FUNC_LESS; + StencilEnable = FALSE; + const D3D12_DEPTH_STENCILOP_DESC1 defaultStencilOp = {D3D12_STENCIL_OP_KEEP, + D3D12_STENCIL_OP_KEEP, + D3D12_STENCIL_OP_KEEP, + D3D12_COMPARISON_FUNC_ALWAYS, + D3D12_DEFAULT_STENCIL_READ_MASK, + D3D12_DEFAULT_STENCIL_WRITE_MASK}; + FrontFace = defaultStencilOp; + BackFace = defaultStencilOp; + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC2(BOOL depthEnable, + D3D12_DEPTH_WRITE_MASK depthWriteMask, + D3D12_COMPARISON_FUNC depthFunc, + BOOL stencilEnable, + D3D12_STENCIL_OP frontStencilFailOp, + D3D12_STENCIL_OP frontStencilDepthFailOp, + D3D12_STENCIL_OP frontStencilPassOp, + D3D12_COMPARISON_FUNC frontStencilFunc, + UINT8 frontStencilReadMask, + UINT8 frontStencilWriteMask, + D3D12_STENCIL_OP backStencilFailOp, + D3D12_STENCIL_OP backStencilDepthFailOp, + D3D12_STENCIL_OP backStencilPassOp, + D3D12_COMPARISON_FUNC backStencilFunc, + UINT8 backStencilReadMask, + UINT8 backStencilWriteMask, + BOOL depthBoundsTestEnable) noexcept { + DepthEnable = depthEnable; + DepthWriteMask = depthWriteMask; + DepthFunc = depthFunc; + StencilEnable = stencilEnable; + + FrontFace.StencilFailOp = frontStencilFailOp; + FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; + FrontFace.StencilPassOp = frontStencilPassOp; + FrontFace.StencilFunc = frontStencilFunc; + FrontFace.StencilReadMask = frontStencilReadMask; + FrontFace.StencilWriteMask = frontStencilWriteMask; + + BackFace.StencilFailOp = backStencilFailOp; + BackFace.StencilDepthFailOp = backStencilDepthFailOp; + BackFace.StencilPassOp = backStencilPassOp; + BackFace.StencilFunc = backStencilFunc; + BackFace.StencilReadMask = backStencilReadMask; + BackFace.StencilWriteMask = backStencilWriteMask; + + DepthBoundsTestEnable = depthBoundsTestEnable; + } + + operator D3D12_DEPTH_STENCIL_DESC() const noexcept { + D3D12_DEPTH_STENCIL_DESC D; + D.DepthEnable = DepthEnable; + D.DepthWriteMask = DepthWriteMask; + D.DepthFunc = DepthFunc; + D.StencilEnable = StencilEnable; + D.StencilReadMask = FrontFace.StencilReadMask; + D.StencilWriteMask = FrontFace.StencilWriteMask; + D.FrontFace.StencilFailOp = FrontFace.StencilFailOp; + D.FrontFace.StencilDepthFailOp = FrontFace.StencilDepthFailOp; + D.FrontFace.StencilPassOp = FrontFace.StencilPassOp; + D.FrontFace.StencilFunc = FrontFace.StencilFunc; + D.BackFace.StencilFailOp = BackFace.StencilFailOp; + D.BackFace.StencilDepthFailOp = BackFace.StencilDepthFailOp; + D.BackFace.StencilPassOp = BackFace.StencilPassOp; + D.BackFace.StencilFunc = BackFace.StencilFunc; + return D; + } +}; +# endif // D3D12_SDK_VERSION >= 606 + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_BLEND_DESC : public D3D12_BLEND_DESC { + CD3DX12_BLEND_DESC() = default; + explicit CD3DX12_BLEND_DESC(const D3D12_BLEND_DESC& o) noexcept : D3D12_BLEND_DESC(o) {} + explicit CD3DX12_BLEND_DESC(CD3DX12_DEFAULT) noexcept { + AlphaToCoverageEnable = FALSE; + IndependentBlendEnable = FALSE; + const D3D12_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc = { + FALSE, + FALSE, + D3D12_BLEND_ONE, + D3D12_BLEND_ZERO, + D3D12_BLEND_OP_ADD, + D3D12_BLEND_ONE, + D3D12_BLEND_ZERO, + D3D12_BLEND_OP_ADD, + D3D12_LOGIC_OP_NOOP, + D3D12_COLOR_WRITE_ENABLE_ALL, + }; + for (UINT i = 0; i < D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + RenderTarget[i] = defaultRenderTargetBlendDesc; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RASTERIZER_DESC : public D3D12_RASTERIZER_DESC { + CD3DX12_RASTERIZER_DESC() = default; + explicit CD3DX12_RASTERIZER_DESC(const D3D12_RASTERIZER_DESC& o) noexcept : D3D12_RASTERIZER_DESC(o) {} + explicit CD3DX12_RASTERIZER_DESC(CD3DX12_DEFAULT) noexcept { + FillMode = D3D12_FILL_MODE_SOLID; + CullMode = D3D12_CULL_MODE_BACK; + FrontCounterClockwise = FALSE; + DepthBias = D3D12_DEFAULT_DEPTH_BIAS; + DepthBiasClamp = D3D12_DEFAULT_DEPTH_BIAS_CLAMP; + SlopeScaledDepthBias = D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS; + DepthClipEnable = TRUE; + MultisampleEnable = FALSE; + AntialiasedLineEnable = FALSE; + ForcedSampleCount = 0; + ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF; + } + explicit CD3DX12_RASTERIZER_DESC(D3D12_FILL_MODE fillMode, + D3D12_CULL_MODE cullMode, + BOOL frontCounterClockwise, + INT depthBias, + FLOAT depthBiasClamp, + FLOAT slopeScaledDepthBias, + BOOL depthClipEnable, + BOOL multisampleEnable, + BOOL antialiasedLineEnable, + UINT forcedSampleCount, + D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster) noexcept { + FillMode = fillMode; + CullMode = cullMode; + FrontCounterClockwise = frontCounterClockwise; + DepthBias = depthBias; + DepthBiasClamp = depthBiasClamp; + SlopeScaledDepthBias = slopeScaledDepthBias; + DepthClipEnable = depthClipEnable; + MultisampleEnable = multisampleEnable; + AntialiasedLineEnable = antialiasedLineEnable; + ForcedSampleCount = forcedSampleCount; + ConservativeRaster = conservativeRaster; + } +}; + +//------------------------------------------------------------------------------------------------ +# if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608) +struct CD3DX12_RASTERIZER_DESC1 : public D3D12_RASTERIZER_DESC1 { + CD3DX12_RASTERIZER_DESC1() = default; + explicit CD3DX12_RASTERIZER_DESC1(const D3D12_RASTERIZER_DESC1& o) noexcept + : D3D12_RASTERIZER_DESC1(o) + + {} + explicit CD3DX12_RASTERIZER_DESC1(const D3D12_RASTERIZER_DESC& o) noexcept { + FillMode = o.FillMode; + CullMode = o.CullMode; + FrontCounterClockwise = o.FrontCounterClockwise; + DepthBias = static_cast(o.DepthBias); + DepthBiasClamp = o.DepthBiasClamp; + SlopeScaledDepthBias = o.SlopeScaledDepthBias; + DepthClipEnable = o.DepthClipEnable; + MultisampleEnable = o.MultisampleEnable; + AntialiasedLineEnable = o.AntialiasedLineEnable; + ForcedSampleCount = o.ForcedSampleCount; + ConservativeRaster = o.ConservativeRaster; + } + explicit CD3DX12_RASTERIZER_DESC1(CD3DX12_DEFAULT) noexcept { + FillMode = D3D12_FILL_MODE_SOLID; + CullMode = D3D12_CULL_MODE_BACK; + FrontCounterClockwise = FALSE; + DepthBias = D3D12_DEFAULT_DEPTH_BIAS; + DepthBiasClamp = D3D12_DEFAULT_DEPTH_BIAS_CLAMP; + SlopeScaledDepthBias = D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS; + DepthClipEnable = TRUE; + MultisampleEnable = FALSE; + AntialiasedLineEnable = FALSE; + ForcedSampleCount = 0; + ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF; + } + explicit CD3DX12_RASTERIZER_DESC1(D3D12_FILL_MODE fillMode, + D3D12_CULL_MODE cullMode, + BOOL frontCounterClockwise, + FLOAT depthBias, + FLOAT depthBiasClamp, + FLOAT slopeScaledDepthBias, + BOOL depthClipEnable, + BOOL multisampleEnable, + BOOL antialiasedLineEnable, + UINT forcedSampleCount, + D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster) noexcept { + FillMode = fillMode; + CullMode = cullMode; + FrontCounterClockwise = frontCounterClockwise; + DepthBias = depthBias; + DepthBiasClamp = depthBiasClamp; + SlopeScaledDepthBias = slopeScaledDepthBias; + DepthClipEnable = depthClipEnable; + MultisampleEnable = multisampleEnable; + AntialiasedLineEnable = antialiasedLineEnable; + ForcedSampleCount = forcedSampleCount; + ConservativeRaster = conservativeRaster; + } + + operator D3D12_RASTERIZER_DESC() const noexcept { + D3D12_RASTERIZER_DESC o; + + o.FillMode = FillMode; + o.CullMode = CullMode; + o.FrontCounterClockwise = FrontCounterClockwise; + o.DepthBias = static_cast(DepthBias); + o.DepthBiasClamp = DepthBiasClamp; + o.SlopeScaledDepthBias = SlopeScaledDepthBias; + o.DepthClipEnable = DepthClipEnable; + o.MultisampleEnable = MultisampleEnable; + o.AntialiasedLineEnable = AntialiasedLineEnable; + o.ForcedSampleCount = ForcedSampleCount; + o.ConservativeRaster = ConservativeRaster; + + return o; + } +}; +# endif // D3D12_SDK_VERSION >= 608 + +//------------------------------------------------------------------------------------------------ +# if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) +struct CD3DX12_RASTERIZER_DESC2 : public D3D12_RASTERIZER_DESC2 { + CD3DX12_RASTERIZER_DESC2() = default; + explicit CD3DX12_RASTERIZER_DESC2(const D3D12_RASTERIZER_DESC2& o) noexcept + : D3D12_RASTERIZER_DESC2(o) + + {} + explicit CD3DX12_RASTERIZER_DESC2(const D3D12_RASTERIZER_DESC1& o) noexcept { + FillMode = o.FillMode; + CullMode = o.CullMode; + FrontCounterClockwise = o.FrontCounterClockwise; + DepthBias = o.DepthBias; + DepthBiasClamp = o.DepthBiasClamp; + SlopeScaledDepthBias = o.SlopeScaledDepthBias; + DepthClipEnable = o.DepthClipEnable; + LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_ALIASED; + if (o.MultisampleEnable) { + LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_QUADRILATERAL_WIDE; + } else if (o.AntialiasedLineEnable) { + LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_ALPHA_ANTIALIASED; + } + ForcedSampleCount = o.ForcedSampleCount; + ConservativeRaster = o.ConservativeRaster; + } + explicit CD3DX12_RASTERIZER_DESC2(const D3D12_RASTERIZER_DESC& o) noexcept + : CD3DX12_RASTERIZER_DESC2(CD3DX12_RASTERIZER_DESC1(o)) {} + explicit CD3DX12_RASTERIZER_DESC2(CD3DX12_DEFAULT) noexcept { + FillMode = D3D12_FILL_MODE_SOLID; + CullMode = D3D12_CULL_MODE_BACK; + FrontCounterClockwise = FALSE; + DepthBias = D3D12_DEFAULT_DEPTH_BIAS; + DepthBiasClamp = D3D12_DEFAULT_DEPTH_BIAS_CLAMP; + SlopeScaledDepthBias = D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS; + DepthClipEnable = TRUE; + LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_ALIASED; + ForcedSampleCount = 0; + ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF; + } + explicit CD3DX12_RASTERIZER_DESC2(D3D12_FILL_MODE fillMode, + D3D12_CULL_MODE cullMode, + BOOL frontCounterClockwise, + FLOAT depthBias, + FLOAT depthBiasClamp, + FLOAT slopeScaledDepthBias, + BOOL depthClipEnable, + D3D12_LINE_RASTERIZATION_MODE lineRasterizationMode, + UINT forcedSampleCount, + D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster) noexcept { + FillMode = fillMode; + CullMode = cullMode; + FrontCounterClockwise = frontCounterClockwise; + DepthBias = depthBias; + DepthBiasClamp = depthBiasClamp; + SlopeScaledDepthBias = slopeScaledDepthBias; + DepthClipEnable = depthClipEnable; + LineRasterizationMode = lineRasterizationMode; + ForcedSampleCount = forcedSampleCount; + ConservativeRaster = conservativeRaster; + } + + operator D3D12_RASTERIZER_DESC1() const noexcept { + D3D12_RASTERIZER_DESC1 o; + + o.FillMode = FillMode; + o.CullMode = CullMode; + o.FrontCounterClockwise = FrontCounterClockwise; + o.DepthBias = DepthBias; + o.DepthBiasClamp = DepthBiasClamp; + o.SlopeScaledDepthBias = SlopeScaledDepthBias; + o.DepthClipEnable = DepthClipEnable; + o.MultisampleEnable = FALSE; + o.AntialiasedLineEnable = FALSE; + if (LineRasterizationMode == D3D12_LINE_RASTERIZATION_MODE_ALPHA_ANTIALIASED) { + o.AntialiasedLineEnable = TRUE; + } else if (LineRasterizationMode != D3D12_LINE_RASTERIZATION_MODE_ALIASED) { + o.MultisampleEnable = TRUE; + } + o.ForcedSampleCount = ForcedSampleCount; + o.ConservativeRaster = ConservativeRaster; + + return o; + } + operator D3D12_RASTERIZER_DESC() const noexcept { + return static_cast(CD3DX12_RASTERIZER_DESC1(static_cast(*this))); + } +}; +# endif // D3D12_SDK_VERSION >= 610 + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RESOURCE_ALLOCATION_INFO : public D3D12_RESOURCE_ALLOCATION_INFO { + CD3DX12_RESOURCE_ALLOCATION_INFO() = default; + explicit CD3DX12_RESOURCE_ALLOCATION_INFO(const D3D12_RESOURCE_ALLOCATION_INFO& o) noexcept + : D3D12_RESOURCE_ALLOCATION_INFO(o) {} + CD3DX12_RESOURCE_ALLOCATION_INFO(UINT64 size, UINT64 alignment) noexcept { + SizeInBytes = size; + Alignment = alignment; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_HEAP_PROPERTIES : public D3D12_HEAP_PROPERTIES { + CD3DX12_HEAP_PROPERTIES() = default; + explicit CD3DX12_HEAP_PROPERTIES(const D3D12_HEAP_PROPERTIES& o) noexcept : D3D12_HEAP_PROPERTIES(o) {} + CD3DX12_HEAP_PROPERTIES(D3D12_CPU_PAGE_PROPERTY cpuPageProperty, + D3D12_MEMORY_POOL memoryPoolPreference, + UINT creationNodeMask = 1, + UINT nodeMask = 1) + noexcept { + Type = D3D12_HEAP_TYPE_CUSTOM; + CPUPageProperty = cpuPageProperty; + MemoryPoolPreference = memoryPoolPreference; + CreationNodeMask = creationNodeMask; + VisibleNodeMask = nodeMask; + } + explicit CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE type, UINT creationNodeMask = 1, UINT nodeMask = 1) noexcept { + Type = type; + CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN; + MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN; + CreationNodeMask = creationNodeMask; + VisibleNodeMask = nodeMask; + } + bool IsCPUAccessible() const noexcept { + return Type == D3D12_HEAP_TYPE_UPLOAD || Type == D3D12_HEAP_TYPE_READBACK +# if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + || Type == D3D12_HEAP_TYPE_GPU_UPLOAD +# endif + || (Type == D3D12_HEAP_TYPE_CUSTOM && (CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE || + CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_BACK)); + } +}; +inline bool operator==(const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r) noexcept { + return l.Type == r.Type && l.CPUPageProperty == r.CPUPageProperty && + l.MemoryPoolPreference == r.MemoryPoolPreference && l.CreationNodeMask == r.CreationNodeMask && + l.VisibleNodeMask == r.VisibleNodeMask; +} +inline bool operator!=(const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r) noexcept { + return !(l == r); +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_HEAP_DESC : public D3D12_HEAP_DESC { + CD3DX12_HEAP_DESC() = default; + explicit CD3DX12_HEAP_DESC(const D3D12_HEAP_DESC& o) noexcept : D3D12_HEAP_DESC(o) {} + CD3DX12_HEAP_DESC(UINT64 size, + D3D12_HEAP_PROPERTIES properties, + UINT64 alignment = 0, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE) + noexcept { + SizeInBytes = size; + Properties = properties; + Alignment = alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC(UINT64 size, + D3D12_HEAP_TYPE type, + UINT64 alignment = 0, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE) + noexcept { + SizeInBytes = size; + Properties = CD3DX12_HEAP_PROPERTIES(type); + Alignment = alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC(UINT64 size, + D3D12_CPU_PAGE_PROPERTY cpuPageProperty, + D3D12_MEMORY_POOL memoryPoolPreference, + UINT64 alignment = 0, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE) + noexcept { + SizeInBytes = size; + Properties = CD3DX12_HEAP_PROPERTIES(cpuPageProperty, memoryPoolPreference); + Alignment = alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC(const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_HEAP_PROPERTIES properties, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE) + noexcept { + SizeInBytes = resAllocInfo.SizeInBytes; + Properties = properties; + Alignment = resAllocInfo.Alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC(const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_HEAP_TYPE type, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE) + noexcept { + SizeInBytes = resAllocInfo.SizeInBytes; + Properties = CD3DX12_HEAP_PROPERTIES(type); + Alignment = resAllocInfo.Alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC(const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_CPU_PAGE_PROPERTY cpuPageProperty, + D3D12_MEMORY_POOL memoryPoolPreference, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE) + noexcept { + SizeInBytes = resAllocInfo.SizeInBytes; + Properties = CD3DX12_HEAP_PROPERTIES(cpuPageProperty, memoryPoolPreference); + Alignment = resAllocInfo.Alignment; + Flags = flags; + } + bool IsCPUAccessible() const noexcept { + return static_cast(&Properties)->IsCPUAccessible(); + } +}; +inline bool operator==(const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r) noexcept { + return l.SizeInBytes == r.SizeInBytes && l.Properties == r.Properties && l.Alignment == r.Alignment && + l.Flags == r.Flags; +} +inline bool operator!=(const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r) noexcept { + return !(l == r); +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_CLEAR_VALUE : public D3D12_CLEAR_VALUE { + CD3DX12_CLEAR_VALUE() = default; + explicit CD3DX12_CLEAR_VALUE(const D3D12_CLEAR_VALUE& o) noexcept : D3D12_CLEAR_VALUE(o) {} + CD3DX12_CLEAR_VALUE(DXGI_FORMAT format, const FLOAT color[4]) noexcept { + Format = format; + memcpy(Color, color, sizeof(Color)); + } + CD3DX12_CLEAR_VALUE(DXGI_FORMAT format, FLOAT depth, UINT8 stencil) noexcept { + Format = format; + memset(&Color, 0, sizeof(Color)); + /* Use memcpy to preserve NAN values */ + memcpy(&DepthStencil.Depth, &depth, sizeof(depth)); + DepthStencil.Stencil = stencil; + } +}; + +//------------------------------------------------------------------------------------------------ +inline bool operator==(const D3D12_CLEAR_VALUE& a, const D3D12_CLEAR_VALUE& b) noexcept { + if (a.Format != b.Format) + return false; + if (a.Format == DXGI_FORMAT_D24_UNORM_S8_UINT || a.Format == DXGI_FORMAT_D16_UNORM || + a.Format == DXGI_FORMAT_D32_FLOAT || a.Format == DXGI_FORMAT_D32_FLOAT_S8X24_UINT) { + return (a.DepthStencil.Depth == b.DepthStencil.Depth) && (a.DepthStencil.Stencil == b.DepthStencil.Stencil); + } else { + return (a.Color[0] == b.Color[0]) && (a.Color[1] == b.Color[1]) && (a.Color[2] == b.Color[2]) && + (a.Color[3] == b.Color[3]); + } +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RANGE : public D3D12_RANGE { + CD3DX12_RANGE() = default; + explicit CD3DX12_RANGE(const D3D12_RANGE& o) noexcept : D3D12_RANGE(o) {} + CD3DX12_RANGE(SIZE_T begin, SIZE_T end) noexcept { + Begin = begin; + End = end; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RANGE_UINT64 : public D3D12_RANGE_UINT64 { + CD3DX12_RANGE_UINT64() = default; + explicit CD3DX12_RANGE_UINT64(const D3D12_RANGE_UINT64& o) noexcept : D3D12_RANGE_UINT64(o) {} + CD3DX12_RANGE_UINT64(UINT64 begin, UINT64 end) noexcept { + Begin = begin; + End = end; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SUBRESOURCE_RANGE_UINT64 : public D3D12_SUBRESOURCE_RANGE_UINT64 { + CD3DX12_SUBRESOURCE_RANGE_UINT64() = default; + explicit CD3DX12_SUBRESOURCE_RANGE_UINT64(const D3D12_SUBRESOURCE_RANGE_UINT64& o) noexcept + : D3D12_SUBRESOURCE_RANGE_UINT64(o) {} + CD3DX12_SUBRESOURCE_RANGE_UINT64(UINT subresource, const D3D12_RANGE_UINT64& range) noexcept { + Subresource = subresource; + Range = range; + } + CD3DX12_SUBRESOURCE_RANGE_UINT64(UINT subresource, UINT64 begin, UINT64 end) noexcept { + Subresource = subresource; + Range.Begin = begin; + Range.End = end; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SHADER_BYTECODE : public D3D12_SHADER_BYTECODE { + CD3DX12_SHADER_BYTECODE() = default; + explicit CD3DX12_SHADER_BYTECODE(const D3D12_SHADER_BYTECODE& o) noexcept : D3D12_SHADER_BYTECODE(o) {} + CD3DX12_SHADER_BYTECODE(_In_ ID3DBlob* pShaderBlob) noexcept { + pShaderBytecode = pShaderBlob->GetBufferPointer(); + BytecodeLength = pShaderBlob->GetBufferSize(); + } + CD3DX12_SHADER_BYTECODE(const void* _pShaderBytecode, SIZE_T bytecodeLength) noexcept { + pShaderBytecode = _pShaderBytecode; + BytecodeLength = bytecodeLength; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TILED_RESOURCE_COORDINATE : public D3D12_TILED_RESOURCE_COORDINATE { + CD3DX12_TILED_RESOURCE_COORDINATE() = default; + explicit CD3DX12_TILED_RESOURCE_COORDINATE(const D3D12_TILED_RESOURCE_COORDINATE& o) noexcept + : D3D12_TILED_RESOURCE_COORDINATE(o) {} + CD3DX12_TILED_RESOURCE_COORDINATE(UINT x, UINT y, UINT z, UINT subresource) noexcept { + X = x; + Y = y; + Z = z; + Subresource = subresource; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TILE_REGION_SIZE : public D3D12_TILE_REGION_SIZE { + CD3DX12_TILE_REGION_SIZE() = default; + explicit CD3DX12_TILE_REGION_SIZE(const D3D12_TILE_REGION_SIZE& o) noexcept : D3D12_TILE_REGION_SIZE(o) {} + CD3DX12_TILE_REGION_SIZE(UINT numTiles, BOOL useBox, UINT width, UINT16 height, UINT16 depth) noexcept { + NumTiles = numTiles; + UseBox = useBox; + Width = width; + Height = height; + Depth = depth; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SUBRESOURCE_TILING : public D3D12_SUBRESOURCE_TILING { + CD3DX12_SUBRESOURCE_TILING() = default; + explicit CD3DX12_SUBRESOURCE_TILING(const D3D12_SUBRESOURCE_TILING& o) noexcept : D3D12_SUBRESOURCE_TILING(o) {} + CD3DX12_SUBRESOURCE_TILING(UINT widthInTiles, + UINT16 heightInTiles, + UINT16 depthInTiles, + UINT startTileIndexInOverallResource) + noexcept { + WidthInTiles = widthInTiles; + HeightInTiles = heightInTiles; + DepthInTiles = depthInTiles; + StartTileIndexInOverallResource = startTileIndexInOverallResource; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TILE_SHAPE : public D3D12_TILE_SHAPE { + CD3DX12_TILE_SHAPE() = default; + explicit CD3DX12_TILE_SHAPE(const D3D12_TILE_SHAPE& o) noexcept : D3D12_TILE_SHAPE(o) {} + CD3DX12_TILE_SHAPE(UINT widthInTexels, UINT heightInTexels, UINT depthInTexels) noexcept { + WidthInTexels = widthInTexels; + HeightInTexels = heightInTexels; + DepthInTexels = depthInTexels; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_PACKED_MIP_INFO : public D3D12_PACKED_MIP_INFO { + CD3DX12_PACKED_MIP_INFO() = default; + explicit CD3DX12_PACKED_MIP_INFO(const D3D12_PACKED_MIP_INFO& o) noexcept : D3D12_PACKED_MIP_INFO(o) {} + CD3DX12_PACKED_MIP_INFO(UINT8 numStandardMips, + UINT8 numPackedMips, + UINT numTilesForPackedMips, + UINT startTileIndexInOverallResource) + noexcept { + NumStandardMips = numStandardMips; + NumPackedMips = numPackedMips; + NumTilesForPackedMips = numTilesForPackedMips; + StartTileIndexInOverallResource = startTileIndexInOverallResource; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SUBRESOURCE_FOOTPRINT : public D3D12_SUBRESOURCE_FOOTPRINT { + CD3DX12_SUBRESOURCE_FOOTPRINT() = default; + explicit CD3DX12_SUBRESOURCE_FOOTPRINT(const D3D12_SUBRESOURCE_FOOTPRINT& o) noexcept + : D3D12_SUBRESOURCE_FOOTPRINT(o) {} + CD3DX12_SUBRESOURCE_FOOTPRINT(DXGI_FORMAT format, UINT width, UINT height, UINT depth, UINT rowPitch) noexcept { + Format = format; + Width = width; + Height = height; + Depth = depth; + RowPitch = rowPitch; + } + explicit CD3DX12_SUBRESOURCE_FOOTPRINT(const D3D12_RESOURCE_DESC& resDesc, UINT rowPitch) noexcept { + Format = resDesc.Format; + Width = UINT(resDesc.Width); + Height = resDesc.Height; + Depth = (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? resDesc.DepthOrArraySize : 1u); + RowPitch = rowPitch; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TEXTURE_COPY_LOCATION : public D3D12_TEXTURE_COPY_LOCATION { + CD3DX12_TEXTURE_COPY_LOCATION() = default; + explicit CD3DX12_TEXTURE_COPY_LOCATION(const D3D12_TEXTURE_COPY_LOCATION& o) noexcept + : D3D12_TEXTURE_COPY_LOCATION(o) {} + CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes) noexcept { + pResource = pRes; + Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX; + PlacedFootprint = {}; + } + CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, D3D12_PLACED_SUBRESOURCE_FOOTPRINT const& Footprint) + noexcept { + pResource = pRes; + Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT; + PlacedFootprint = Footprint; + } + CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, UINT Sub) noexcept { + pResource = pRes; + Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX; + PlacedFootprint = {}; + SubresourceIndex = Sub; + } +}; + +//------------------------------------------------------------------------------------------------ +constexpr UINT D3D12CalcSubresource(UINT MipSlice, + UINT ArraySlice, + UINT PlaneSlice, + UINT MipLevels, + UINT ArraySize) noexcept { + return MipSlice + ArraySlice * MipLevels + PlaneSlice * MipLevels * ArraySize; +} + +//------------------------------------------------------------------------------------------------ +inline UINT8 D3D12GetFormatPlaneCount(_In_ ID3D12Device* pDevice, DXGI_FORMAT Format) noexcept { + D3D12_FEATURE_DATA_FORMAT_INFO formatInfo = {Format, 0}; + if (FAILED(pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &formatInfo, sizeof(formatInfo)))) { + return 0; + } + return formatInfo.PlaneCount; +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RESOURCE_DESC : public D3D12_RESOURCE_DESC { + CD3DX12_RESOURCE_DESC() = default; + explicit CD3DX12_RESOURCE_DESC(const D3D12_RESOURCE_DESC& o) noexcept : D3D12_RESOURCE_DESC(o) {} + CD3DX12_RESOURCE_DESC(D3D12_RESOURCE_DIMENSION dimension, + UINT64 alignment, + UINT64 width, + UINT height, + UINT16 depthOrArraySize, + UINT16 mipLevels, + DXGI_FORMAT format, + UINT sampleCount, + UINT sampleQuality, + D3D12_TEXTURE_LAYOUT layout, + D3D12_RESOURCE_FLAGS flags) + noexcept { + Dimension = dimension; + Alignment = alignment; + Width = width; + Height = height; + DepthOrArraySize = depthOrArraySize; + MipLevels = mipLevels; + Format = format; + SampleDesc.Count = sampleCount; + SampleDesc.Quality = sampleQuality; + Layout = layout; + Flags = flags; + } + static inline CD3DX12_RESOURCE_DESC Buffer(const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE) noexcept { + return CD3DX12_RESOURCE_DESC(D3D12_RESOURCE_DIMENSION_BUFFER, + resAllocInfo.Alignment, + resAllocInfo.SizeInBytes, + 1, + 1, + 1, + DXGI_FORMAT_UNKNOWN, + 1, + 0, + D3D12_TEXTURE_LAYOUT_ROW_MAJOR, + flags); + } + static inline CD3DX12_RESOURCE_DESC Buffer(UINT64 width, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + UINT64 alignment = 0) noexcept { + return CD3DX12_RESOURCE_DESC(D3D12_RESOURCE_DIMENSION_BUFFER, + alignment, + width, + 1, + 1, + 1, + DXGI_FORMAT_UNKNOWN, + 1, + 0, + D3D12_TEXTURE_LAYOUT_ROW_MAJOR, + flags); + } + static inline CD3DX12_RESOURCE_DESC Tex1D(DXGI_FORMAT format, + UINT64 width, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0) noexcept { + return CD3DX12_RESOURCE_DESC(D3D12_RESOURCE_DIMENSION_TEXTURE1D, + alignment, + width, + 1, + arraySize, + mipLevels, + format, + 1, + 0, + layout, + flags); + } + static inline CD3DX12_RESOURCE_DESC Tex2D(DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + UINT sampleCount = 1, + UINT sampleQuality = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0) noexcept { + return CD3DX12_RESOURCE_DESC(D3D12_RESOURCE_DIMENSION_TEXTURE2D, + alignment, + width, + height, + arraySize, + mipLevels, + format, + sampleCount, + sampleQuality, + layout, + flags); + } + static inline CD3DX12_RESOURCE_DESC Tex3D(DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 depth, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0) noexcept { + return CD3DX12_RESOURCE_DESC(D3D12_RESOURCE_DIMENSION_TEXTURE3D, + alignment, + width, + height, + depth, + mipLevels, + format, + 1, + 0, + layout, + flags); + } + inline UINT16 Depth() const noexcept { + return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); + } + inline UINT16 ArraySize() const noexcept { + return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); + } + inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const noexcept { + return D3D12GetFormatPlaneCount(pDevice, Format); + } + inline UINT Subresources(_In_ ID3D12Device* pDevice) const noexcept { + return static_cast(MipLevels) * ArraySize() * PlaneCount(pDevice); + } + inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice) noexcept { + return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); + } +}; +inline bool operator==(const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r) noexcept { + return l.Dimension == r.Dimension && l.Alignment == r.Alignment && l.Width == r.Width && l.Height == r.Height && + l.DepthOrArraySize == r.DepthOrArraySize && l.MipLevels == r.MipLevels && l.Format == r.Format && + l.SampleDesc.Count == r.SampleDesc.Count && l.SampleDesc.Quality == r.SampleDesc.Quality && + l.Layout == r.Layout && l.Flags == r.Flags; +} +inline bool operator!=(const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r) noexcept { + return !(l == r); +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RESOURCE_DESC1 : public D3D12_RESOURCE_DESC1 { + CD3DX12_RESOURCE_DESC1() = default; + explicit CD3DX12_RESOURCE_DESC1(const D3D12_RESOURCE_DESC1& o) noexcept : D3D12_RESOURCE_DESC1(o) {} + explicit CD3DX12_RESOURCE_DESC1(const D3D12_RESOURCE_DESC& o) noexcept { + Dimension = o.Dimension; + Alignment = o.Alignment; + Width = o.Width; + Height = o.Height; + DepthOrArraySize = o.DepthOrArraySize; + MipLevels = o.MipLevels; + Format = o.Format; + SampleDesc = o.SampleDesc; + Layout = o.Layout; + Flags = o.Flags; + SamplerFeedbackMipRegion = {}; + } + CD3DX12_RESOURCE_DESC1(D3D12_RESOURCE_DIMENSION dimension, + UINT64 alignment, + UINT64 width, + UINT height, + UINT16 depthOrArraySize, + UINT16 mipLevels, + DXGI_FORMAT format, + UINT sampleCount, + UINT sampleQuality, + D3D12_TEXTURE_LAYOUT layout, + D3D12_RESOURCE_FLAGS flags, + UINT samplerFeedbackMipRegionWidth = 0, + UINT samplerFeedbackMipRegionHeight = 0, + UINT samplerFeedbackMipRegionDepth = 0) + noexcept { + Dimension = dimension; + Alignment = alignment; + Width = width; + Height = height; + DepthOrArraySize = depthOrArraySize; + MipLevels = mipLevels; + Format = format; + SampleDesc.Count = sampleCount; + SampleDesc.Quality = sampleQuality; + Layout = layout; + Flags = flags; + SamplerFeedbackMipRegion.Width = samplerFeedbackMipRegionWidth; + SamplerFeedbackMipRegion.Height = samplerFeedbackMipRegionHeight; + SamplerFeedbackMipRegion.Depth = samplerFeedbackMipRegionDepth; + } + + static inline CD3DX12_RESOURCE_DESC1 Buffer(const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE) noexcept { + return CD3DX12_RESOURCE_DESC1(D3D12_RESOURCE_DIMENSION_BUFFER, + resAllocInfo.Alignment, + resAllocInfo.SizeInBytes, + 1, + 1, + 1, + DXGI_FORMAT_UNKNOWN, + 1, + 0, + D3D12_TEXTURE_LAYOUT_ROW_MAJOR, + flags, + 0, + 0, + 0); + } + static inline CD3DX12_RESOURCE_DESC1 Buffer(UINT64 width, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + UINT64 alignment = 0) noexcept { + return CD3DX12_RESOURCE_DESC1(D3D12_RESOURCE_DIMENSION_BUFFER, + alignment, + width, + 1, + 1, + 1, + DXGI_FORMAT_UNKNOWN, + 1, + 0, + D3D12_TEXTURE_LAYOUT_ROW_MAJOR, + flags, + 0, + 0, + 0); + } + static inline CD3DX12_RESOURCE_DESC1 Tex1D(DXGI_FORMAT format, + UINT64 width, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0) noexcept { + return CD3DX12_RESOURCE_DESC1(D3D12_RESOURCE_DIMENSION_TEXTURE1D, + alignment, + width, + 1, + arraySize, + mipLevels, + format, + 1, + 0, + layout, + flags, + 0, + 0, + 0); + } + static inline CD3DX12_RESOURCE_DESC1 Tex2D(DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + UINT sampleCount = 1, + UINT sampleQuality = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0, + UINT samplerFeedbackMipRegionWidth = 0, + UINT samplerFeedbackMipRegionHeight = 0, + UINT samplerFeedbackMipRegionDepth = 0) noexcept { + return CD3DX12_RESOURCE_DESC1(D3D12_RESOURCE_DIMENSION_TEXTURE2D, + alignment, + width, + height, + arraySize, + mipLevels, + format, + sampleCount, + sampleQuality, + layout, + flags, + samplerFeedbackMipRegionWidth, + samplerFeedbackMipRegionHeight, + samplerFeedbackMipRegionDepth); + } + static inline CD3DX12_RESOURCE_DESC1 Tex3D(DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 depth, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0) noexcept { + return CD3DX12_RESOURCE_DESC1(D3D12_RESOURCE_DIMENSION_TEXTURE3D, + alignment, + width, + height, + depth, + mipLevels, + format, + 1, + 0, + layout, + flags, + 0, + 0, + 0); + } + inline UINT16 Depth() const noexcept { + return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); + } + inline UINT16 ArraySize() const noexcept { + return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); + } + inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const noexcept { + return D3D12GetFormatPlaneCount(pDevice, Format); + } + inline UINT Subresources(_In_ ID3D12Device* pDevice) const noexcept { + return static_cast(MipLevels) * ArraySize() * PlaneCount(pDevice); + } + inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice) noexcept { + return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); + } +}; +inline bool operator==(const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r) noexcept { + return l.Dimension == r.Dimension && l.Alignment == r.Alignment && l.Width == r.Width && l.Height == r.Height && + l.DepthOrArraySize == r.DepthOrArraySize && l.MipLevels == r.MipLevels && l.Format == r.Format && + l.SampleDesc.Count == r.SampleDesc.Count && l.SampleDesc.Quality == r.SampleDesc.Quality && + l.Layout == r.Layout && l.Flags == r.Flags && + l.SamplerFeedbackMipRegion.Width == r.SamplerFeedbackMipRegion.Width && + l.SamplerFeedbackMipRegion.Height == r.SamplerFeedbackMipRegion.Height && + l.SamplerFeedbackMipRegion.Depth == r.SamplerFeedbackMipRegion.Depth; +} +inline bool operator!=(const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r) noexcept { + return !(l == r); +} + +//------------------------------------------------------------------------------------------------ +// Fills in the mipmap and alignment values of pDesc when either members are zero +// Used to replace an implicit field to an explicit (0 mip map = max mip map level) +// If expansion has occured, returns LclDesc, else returns the original pDesc +inline const CD3DX12_RESOURCE_DESC1* D3DX12ConditionallyExpandAPIDesc(CD3DX12_RESOURCE_DESC1& LclDesc, + const CD3DX12_RESOURCE_DESC1* pDesc) { + // Expand mip levels: + if (pDesc->MipLevels == 0 || pDesc->Alignment == 0) { + LclDesc = *pDesc; + if (pDesc->MipLevels == 0) { + auto MaxMipLevels = [](UINT64 uiMaxDimension) -> UINT16 { + UINT16 uiRet = 0; + while (uiMaxDimension > 0) { + uiRet++; + uiMaxDimension >>= 1; + } + return uiRet; + }; + auto Max = [](UINT64 const& a, UINT64 const& b) { + return (a < b) ? b : a; + }; + + LclDesc.MipLevels = + MaxMipLevels(Max(LclDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? LclDesc.DepthOrArraySize : 1, + Max(LclDesc.Width, LclDesc.Height))); + } + if (pDesc->Alignment == 0) { + if (pDesc->Layout == D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE || + pDesc->Layout == D3D12_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE) { + LclDesc.Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT; + } else { + LclDesc.Alignment = (pDesc->SampleDesc.Count > 1 ? D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT + : D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT); + } + } + return &LclDesc; + } else { + return pDesc; + } +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_VIEW_INSTANCING_DESC : public D3D12_VIEW_INSTANCING_DESC { + CD3DX12_VIEW_INSTANCING_DESC() = default; + explicit CD3DX12_VIEW_INSTANCING_DESC(const D3D12_VIEW_INSTANCING_DESC& o) noexcept + : D3D12_VIEW_INSTANCING_DESC(o) {} + explicit CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT) noexcept { + ViewInstanceCount = 0; + pViewInstanceLocations = nullptr; + Flags = D3D12_VIEW_INSTANCING_FLAG_NONE; + } + explicit CD3DX12_VIEW_INSTANCING_DESC(UINT InViewInstanceCount, + const D3D12_VIEW_INSTANCE_LOCATION* InViewInstanceLocations, + D3D12_VIEW_INSTANCING_FLAGS InFlags) noexcept { + ViewInstanceCount = InViewInstanceCount; + pViewInstanceLocations = InViewInstanceLocations; + Flags = InFlags; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RT_FORMAT_ARRAY : public D3D12_RT_FORMAT_ARRAY { + CD3DX12_RT_FORMAT_ARRAY() = default; + explicit CD3DX12_RT_FORMAT_ARRAY(const D3D12_RT_FORMAT_ARRAY& o) noexcept : D3D12_RT_FORMAT_ARRAY(o) {} + explicit CD3DX12_RT_FORMAT_ARRAY(_In_reads_(NumFormats) const DXGI_FORMAT* pFormats, UINT NumFormats) noexcept { + NumRenderTargets = NumFormats; + memcpy(RTFormats, pFormats, sizeof(RTFormats)); + // assumes ARRAY_SIZE(pFormats) == ARRAY_SIZE(RTFormats) + } +}; + +#endif diff --git a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/d3dx12_default.h b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/d3dx12_default.h new file mode 100644 index 00000000000000..2ae8f5c4bee1f6 --- /dev/null +++ b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/d3dx12_default.h @@ -0,0 +1,15 @@ +//********************************************************* +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT). +// +//********************************************************* + +#pragma once + +#ifdef _WIN32 + +struct CD3DX12_DEFAULT {}; +extern const DECLSPEC_SELECTANY CD3DX12_DEFAULT D3D12_DEFAULT; + +#endif diff --git a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dma_buf_remote_run.cpp b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dma_buf_remote_run.cpp index 4653cad201d077..f95c186f910573 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dma_buf_remote_run.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dma_buf_remote_run.cpp @@ -6,7 +6,7 @@ #include "common/npu_test_env_cfg.hpp" #include "common/utils.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #ifdef __linux__ # include diff --git a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dx12_remote_run.cpp b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dx12_remote_run.cpp index 2e0299e411649c..7c04d19e1e1883 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dx12_remote_run.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dx12_remote_run.cpp @@ -6,7 +6,7 @@ #include "common/npu_test_env_cfg.hpp" #include "common/utils.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #ifdef _WIN32 # ifdef ENABLE_DX12 diff --git a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/remote_run.cpp b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/remote_run.cpp index 5228bbd05ee5fb..e279e66498bed9 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/remote_run.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/remote_run.cpp @@ -6,7 +6,7 @@ #include "common/npu_test_env_cfg.hpp" #include "common/utils.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; diff --git a/src/plugins/intel_npu/tests/functional/behavior/replace_sw_layers.cpp b/src/plugins/intel_npu/tests/functional/behavior/replace_sw_layers.cpp index 54cc4c9e34dfce..26d7ccd68d33af 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/replace_sw_layers.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/replace_sw_layers.cpp @@ -5,11 +5,12 @@ #include #include #include + #include "common/functions.h" -#include "common/utils.hpp" #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" -#include "npu_private_properties.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "openvino/op/clamp.hpp" #include "openvino/runtime/intel_npu/properties.hpp" @@ -44,12 +45,12 @@ TEST_P(CompileWithDummy_NPU3720, CompilationForSpecificPlatform) { } } -const std::vector configs = { - {{ov::intel_npu::platform(ov::intel_npu::Platform::NPU3720)}, - {ov::intel_npu::compilation_mode_params("dummy-op-replacement=true")}}}; +const std::vector configs = {{{ov::intel_npu::platform(ov::intel_npu::Platform::NPU3720)}, + {ov::intel_npu::compilation_mode_params("dummy-op-replacement=true")}}}; // Must be successfully compiled with dummy-op-replacement=true -INSTANTIATE_TEST_SUITE_P(smoke_precommit_BehaviorTest_Dummy, CompileWithDummy_NPU3720, +INSTANTIATE_TEST_SUITE_P(smoke_precommit_BehaviorTest_Dummy, + CompileWithDummy_NPU3720, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), CompileWithDummy_NPU3720::getTestCaseName); diff --git a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp index 87c582bbbe0878..928aa583654d56 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp +++ b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp @@ -3,16 +3,18 @@ // #include "behavior/work_with_devices.hpp" + #include "common/utils.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" namespace { const std::vector configs = { - {{ov::log::level(ov::log::Level::DEBUG)}}, + {{ov::log::level(ov::log::Level::DEBUG)}}, }; -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTest, TestCompiledModelNPU, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTest, + TestCompiledModelNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), TestCompiledModelNPU::getTestCaseName); diff --git a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp index 340d28f18a4d92..27ced4337c4928 100644 --- a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp +++ b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp @@ -4,17 +4,16 @@ #pragma once -#include #include -#include #include #include +#include "base/ov_behavior_test_utils.hpp" #include "common/functions.h" #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" -#include "npu_private_properties.hpp" - +#include "intel_npu/config/common.hpp" +#include "intel_npu/config/compiler.hpp" +#include "intel_npu/npu_private_properties.hpp" using CompilerType = ov::intel_npu::CompilerType; diff --git a/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.cpp b/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.cpp index 5f2b9836199bc3..cedd6354ca2f8c 100644 --- a/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.cpp +++ b/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.cpp @@ -7,9 +7,8 @@ #include #include -#include "intel_npu/al/config/common.hpp" -#include "intel_npu/al/config/config.hpp" - +#include "intel_npu/config/common.hpp" +#include "intel_npu/config/config.hpp" namespace ov::test::utils { diff --git a/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.hpp b/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.hpp index a2281f9407dba4..301a585b053f43 100644 --- a/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.hpp +++ b/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.hpp @@ -4,14 +4,15 @@ #pragma once -#include "base/ov_behavior_test_utils.hpp" -#include "common/utils.hpp" -#include "npu_private_properties.hpp" - #include + #include #include +#include "base/ov_behavior_test_utils.hpp" +#include "common/utils.hpp" +#include "intel_npu/npu_private_properties.hpp" + using namespace ov::test::behavior; namespace ov::test::utils { @@ -77,7 +78,7 @@ namespace InferRequestParamsMapTestName { typedef std::tuple // Config > - InferRequestParams; + InferRequestParams; std::string getTestCaseName(testing::TestParamInfo obj); } // namespace InferRequestParamsMapTestName diff --git a/src/plugins/intel_npu/tests/functional/common/utils.cpp b/src/plugins/intel_npu/tests/functional/common/utils.cpp index 7ac8b3ed4561f2..79e029cb873c34 100644 --- a/src/plugins/intel_npu/tests/functional/common/utils.cpp +++ b/src/plugins/intel_npu/tests/functional/common/utils.cpp @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "utils.hpp" + #include -#include "npu_private_properties.hpp" -#include "utils.hpp" +#include "intel_npu/npu_private_properties.hpp" std::string getBackendName(const ov::Core& core) { return core.get_property("NPU", ov::intel_npu::backend_name.name()).as(); @@ -45,7 +46,8 @@ std::vector getRWMandatoryPropertiesValues(std::vector p ov::hint::PerformanceMode::THROUGHPUT, ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT}; for (auto& performanceMode : performanceModes) { - if (std::find(props.begin(), props.end(), + if (std::find(props.begin(), + props.end(), ov::AnyMap{{ov::hint::performance_mode.name(), ov::Any(performanceMode)}}) != props.end()) { continue; } @@ -59,7 +61,8 @@ std::vector getRWMandatoryPropertiesValues(std::vector p ov::hint::ExecutionMode executionModes[] = {ov::hint::ExecutionMode::PERFORMANCE, ov::hint::ExecutionMode::ACCURACY}; for (auto& executionMode : executionModes) { - if (std::find(props.begin(), props.end(), + if (std::find(props.begin(), + props.end(), ov::AnyMap{{ov::hint::execution_mode.name(), ov::Any(executionMode)}}) != props.end()) { continue; } @@ -68,15 +71,20 @@ std::vector getRWMandatoryPropertiesValues(std::vector p bool enableProfilingValues[] = {true, false}; for (auto enableProfilingValue : enableProfilingValues) { - if (std::find(props.begin(), props.end(), + if (std::find(props.begin(), + props.end(), ov::AnyMap{{ov::enable_profiling.name(), ov::Any(enableProfilingValue)}}) != props.end()) { continue; } props.push_back({{ov::enable_profiling(enableProfilingValue)}}); } - ov::log::Level logLevels[] = {ov::log::Level::NO, ov::log::Level::ERR, ov::log::Level::WARNING, - ov::log::Level::INFO, ov::log::Level::DEBUG, ov::log::Level::TRACE}; + ov::log::Level logLevels[] = {ov::log::Level::NO, + ov::log::Level::ERR, + ov::log::Level::WARNING, + ov::log::Level::INFO, + ov::log::Level::DEBUG, + ov::log::Level::TRACE}; for (auto& logLevel : logLevels) { if (std::find(props.begin(), props.end(), ov::AnyMap{{ov::log::level.name(), ov::Any(logLevel)}}) != props.end()) { diff --git a/src/plugins/intel_npu/tests/functional/internal/overload/compile_and_infer.hpp b/src/plugins/intel_npu/tests/functional/internal/overload/compile_and_infer.hpp index 767949b3afc4c4..49475e7008f0b0 100644 --- a/src/plugins/intel_npu/tests/functional/internal/overload/compile_and_infer.hpp +++ b/src/plugins/intel_npu/tests/functional/internal/overload/compile_and_infer.hpp @@ -9,8 +9,8 @@ #include #include "base/ov_behavior_test_utils.hpp" -#include "intel_npu/al/config/common.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/config/common.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "openvino/core/except.hpp" #include "openvino/opsets/opset8.hpp" #include "openvino/runtime/properties.hpp" diff --git a/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.cpp b/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.cpp index 8e01ec7f927e5b..9b9bd74373c988 100644 --- a/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.cpp +++ b/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.cpp @@ -2,40 +2,38 @@ // SPDX-License-Identifier: Apache-2.0 // +#include +#include + #include "behavior/compiled_model/properties.hpp" -#include "common/utils.hpp" #include "common/npu_test_env_cfg.hpp" +#include "common/utils.hpp" #include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" -#include "intel_npu/al/config/common.hpp" - -#include - -#include +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; namespace { std::vector> exe_network_supported_properties = { - {ov::hint::num_requests.name(), ov::Any(8)}, - {ov::hint::enable_cpu_pinning.name(), ov::Any(true)}, - {ov::hint::performance_mode.name(), ov::Any(ov::hint::PerformanceMode::THROUGHPUT)}, - {ov::enable_profiling.name(), ov::Any(true)}, - {ov::device::id.name(), ov::Any(ov::test::utils::getDeviceNameID(ov::test::utils::getDeviceName()))}, - {ov::optimal_number_of_infer_requests.name(), ov::Any(2)}, + {ov::hint::num_requests.name(), ov::Any(8)}, + {ov::hint::enable_cpu_pinning.name(), ov::Any(true)}, + {ov::hint::performance_mode.name(), ov::Any(ov::hint::PerformanceMode::THROUGHPUT)}, + {ov::enable_profiling.name(), ov::Any(true)}, + {ov::device::id.name(), ov::Any(ov::test::utils::getDeviceNameID(ov::test::utils::getDeviceName()))}, + {ov::optimal_number_of_infer_requests.name(), ov::Any(2)}, }; std::vector> exe_network_immutable_properties = { - {std::make_pair(ov::optimal_number_of_infer_requests.name(), ov::Any(2))}, - {std::make_pair(ov::hint::enable_cpu_pinning.name(), ov::Any(false))}, - {std::make_pair(ov::supported_properties.name(), ov::Any("deadbeef"))}, - {std::make_pair(ov::model_name.name(), ov::Any("deadbeef"))}}; + {std::make_pair(ov::optimal_number_of_infer_requests.name(), ov::Any(2))}, + {std::make_pair(ov::hint::enable_cpu_pinning.name(), ov::Any(false))}, + {std::make_pair(ov::supported_properties.name(), ov::Any("deadbeef"))}, + {std::make_pair(ov::model_name.name(), ov::Any("deadbeef"))}}; // ExecutableNetwork Properties tests -class ClassExecutableNetworkGetPropertiesTestNPU : - public OVCompiledModelPropertiesBase, - public ::testing::WithParamInterface< - std::tuple>> { +class ClassExecutableNetworkGetPropertiesTestNPU + : public OVCompiledModelPropertiesBase, + public ::testing::WithParamInterface>> { protected: std::string deviceName; std::string configKey; @@ -52,9 +50,7 @@ class ClassExecutableNetworkGetPropertiesTestNPU : model = ov::test::utils::make_conv_pool_relu(); } static std::string getTestCaseName( - testing::TestParamInfo< - std::tuple>> - obj) { + testing::TestParamInfo>> obj) { std::string targetDevice; std::pair configuration; std::tie(targetDevice, configuration) = obj.param; @@ -73,8 +69,7 @@ using ClassExecutableNetworkTestSuite1NPU = ClassExecutableNetworkGetPropertiesT TEST_P(ClassExecutableNetworkTestSuite1NPU, PropertyIsSupportedAndImmutableAndGet) { std::vector properties; - ov::CompiledModel exeNetwork = - ie.compile_model(model, deviceName); + ov::CompiledModel exeNetwork = ie.compile_model(model, deviceName); OV_ASSERT_NO_THROW(properties = exeNetwork.get_property(ov::supported_properties)); auto it = find(properties.cbegin(), properties.cend(), configKey); @@ -95,8 +90,7 @@ using ClassExecutableNetworkTestSuite2NPU = ClassExecutableNetworkGetPropertiesT TEST_P(ClassExecutableNetworkTestSuite2NPU, PropertyIsSupportedAndImmutableAndCanNotSet) { std::vector properties; - ov::CompiledModel exeNetwork = - ie.compile_model(model, deviceName); + ov::CompiledModel exeNetwork = ie.compile_model(model, deviceName); OV_ASSERT_NO_THROW(properties = exeNetwork.get_property(ov::supported_properties)); auto it = find(properties.cbegin(), properties.cend(), configKey); @@ -106,7 +100,8 @@ TEST_P(ClassExecutableNetworkTestSuite2NPU, PropertyIsSupportedAndImmutableAndCa ASSERT_THROW(exeNetwork.set_property({{configKey, configValue}}), ov::Exception); } -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_ClassExecutableNetworkTestSuite2NPU, ClassExecutableNetworkTestSuite2NPU, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_ClassExecutableNetworkTestSuite2NPU, + ClassExecutableNetworkTestSuite2NPU, ::testing::Combine(::testing::Values(ov::test::utils::getDeviceName()), ::testing::ValuesIn(exe_network_immutable_properties)), ClassExecutableNetworkTestSuite2NPU::getTestCaseName); @@ -116,46 +111,46 @@ INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_ClassExecutableNetworkTestSuite2NPU namespace { std::vector> plugin_public_mutable_properties = { - {ov::hint::num_requests.name(), ov::Any(5)}, - {ov::enable_profiling.name(), ov::Any(true)}, - {ov::compilation_num_threads.name(), ov::Any(1)}, - {ov::hint::performance_mode.name(), ov::Any(ov::hint::PerformanceMode::THROUGHPUT)}, - {ov::hint::enable_cpu_pinning.name(), ov::Any(true)}, - {ov::log::level.name(), ov::Any(ov::log::Level::DEBUG)}, - {ov::device::id.name(), ov::Any(ov::test::utils::getDeviceNameID(ov::test::utils::getDeviceName()))}, + {ov::hint::num_requests.name(), ov::Any(5)}, + {ov::enable_profiling.name(), ov::Any(true)}, + {ov::compilation_num_threads.name(), ov::Any(1)}, + {ov::hint::performance_mode.name(), ov::Any(ov::hint::PerformanceMode::THROUGHPUT)}, + {ov::hint::enable_cpu_pinning.name(), ov::Any(true)}, + {ov::log::level.name(), ov::Any(ov::log::Level::DEBUG)}, + {ov::device::id.name(), ov::Any(ov::test::utils::getDeviceNameID(ov::test::utils::getDeviceName()))}, }; std::vector> plugin_internal_mutable_properties = { - {ov::intel_npu::compilation_mode_params.name(), ov::Any("use-user-precision=false propagate-quant-dequant=0")}, - {ov::intel_npu::dma_engines.name(), ov::Any(1)}, - {ov::intel_npu::compiler_type.name(), ov::Any(ov::intel_npu::CompilerType::MLIR)}, - {ov::intel_npu::platform.name(), ov::Any(ov::intel_npu::Platform::AUTO_DETECT)}, - {ov::intel_npu::compilation_mode.name(), ov::Any("DefaultHW")}, - {ov::intel_npu::max_tiles.name(), ov::Any(8)}, - {ov::intel_npu::stepping.name(), ov::Any(4)}, - {ov::intel_npu::dpu_groups.name(), ov::Any(2)}, - {ov::intel_npu::use_elf_compiler_backend.name(), ov::Any(ov::intel_npu::ElfCompilerBackend::YES)}, - {ov::intel_npu::create_executor.name(), ov::Any(0)}, + {ov::intel_npu::compilation_mode_params.name(), ov::Any("use-user-precision=false propagate-quant-dequant=0")}, + {ov::intel_npu::dma_engines.name(), ov::Any(1)}, + {ov::intel_npu::compiler_type.name(), ov::Any(ov::intel_npu::CompilerType::MLIR)}, + {ov::intel_npu::platform.name(), ov::Any(ov::intel_npu::Platform::AUTO_DETECT)}, + {ov::intel_npu::compilation_mode.name(), ov::Any("DefaultHW")}, + {ov::intel_npu::max_tiles.name(), ov::Any(8)}, + {ov::intel_npu::stepping.name(), ov::Any(4)}, + {ov::intel_npu::dpu_groups.name(), ov::Any(2)}, + {ov::intel_npu::use_elf_compiler_backend.name(), ov::Any(ov::intel_npu::ElfCompilerBackend::YES)}, + {ov::intel_npu::create_executor.name(), ov::Any(0)}, }; std::vector> plugin_public_immutable_properties = { - {ov::device::uuid.name(), ov::Any("deadbeef")}, - {ov::supported_properties.name(), {ov::device::full_name.name()}}, - {ov::num_streams.name(), ov::Any(ov::streams::Num(4))}, - {ov::available_devices.name(), ov::Any(std::vector{"deadbeef"})}, - {ov::device::capabilities.name(), ov::Any(std::vector{"deadbeef"})}, - {ov::range_for_async_infer_requests.name(), - ov::Any(std::tuple{0, 10, 1})}, - {ov::range_for_streams.name(), ov::Any(std::tuple{0, 10})}, - {ov::optimal_number_of_infer_requests.name(), ov::Any(4)}, - {ov::intel_npu::device_alloc_mem_size.name(), ov::Any(2)}, - {ov::intel_npu::device_total_mem_size.name(), ov::Any(2)}, + {ov::device::uuid.name(), ov::Any("deadbeef")}, + {ov::supported_properties.name(), {ov::device::full_name.name()}}, + {ov::num_streams.name(), ov::Any(ov::streams::Num(4))}, + {ov::available_devices.name(), ov::Any(std::vector{"deadbeef"})}, + {ov::device::capabilities.name(), ov::Any(std::vector{"deadbeef"})}, + {ov::range_for_async_infer_requests.name(), + ov::Any(std::tuple{0, 10, 1})}, + {ov::range_for_streams.name(), ov::Any(std::tuple{0, 10})}, + {ov::optimal_number_of_infer_requests.name(), ov::Any(4)}, + {ov::intel_npu::device_alloc_mem_size.name(), ov::Any(2)}, + {ov::intel_npu::device_total_mem_size.name(), ov::Any(2)}, }; // Plugin Properties tests -class ClassPluginPropertiesTestNPU : - public OVCompiledModelPropertiesBase, - public ::testing::WithParamInterface>> { +class ClassPluginPropertiesTestNPU + : public OVCompiledModelPropertiesBase, + public ::testing::WithParamInterface>> { protected: std::string deviceName; std::string configKey; @@ -170,7 +165,7 @@ class ClassPluginPropertiesTestNPU : std::tie(configKey, configValue) = std::get<1>(GetParam()); } static std::string getTestCaseName( - testing::TestParamInfo>> obj) { + testing::TestParamInfo>> obj) { std::string targetDevice; std::pair configuration; std::tie(targetDevice, configuration) = obj.param; @@ -202,7 +197,8 @@ TEST_P(ClassPluginPropertiesTestSuite0NPU, CanSetGetPublicMutableProperty) { ASSERT_EQ(retrieved_value.as(), configValue.as()); } -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests_ClassPluginPropertiesTestNPU, ClassPluginPropertiesTestSuite0NPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests_ClassPluginPropertiesTestNPU, + ClassPluginPropertiesTestSuite0NPU, ::testing::Combine(::testing::Values(ov::test::utils::getDeviceName()), ::testing::ValuesIn(plugin_public_mutable_properties)), ClassPluginPropertiesTestNPU::getTestCaseName); @@ -218,7 +214,8 @@ TEST_P(ClassPluginPropertiesTestSuite1NPU, CanSetGetInternalMutableProperty) { ASSERT_EQ(retrieved_value.as(), configValue.as()); } -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests_ClassPluginPropertiesTestNPU, ClassPluginPropertiesTestSuite1NPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests_ClassPluginPropertiesTestNPU, + ClassPluginPropertiesTestSuite1NPU, ::testing::Combine(::testing::Values(ov::test::utils::getDeviceName()), ::testing::ValuesIn(plugin_internal_mutable_properties)), ClassPluginPropertiesTestNPU::getTestCaseName); @@ -245,7 +242,8 @@ TEST_P(ClassPluginPropertiesTestSuite2NPU, CanNotSetImmutableProperty) { ASSERT_EQ(orig_value.as(), after_value.as()); } -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_ClassPluginPropertiesTest, ClassPluginPropertiesTestSuite2NPU, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_ClassPluginPropertiesTest, + ClassPluginPropertiesTestSuite2NPU, ::testing::Combine(::testing::Values(ov::test::utils::getDeviceName()), ::testing::ValuesIn(plugin_public_immutable_properties)), ClassPluginPropertiesTestNPU::getTestCaseName); @@ -265,8 +263,9 @@ TEST_P(ClassPluginPropertiesTestSuite3NPU, CanGetPropertyWithOptionsNotAffecting ov::Any retrieved_value_with_options; OV_ASSERT_NO_THROW(retrieved_value_with_options = ie.get_property( - deviceName, configKey, - {{ov::hint::performance_mode.name(), ov::Any(ov::hint::PerformanceMode::THROUGHPUT)}})); + deviceName, + configKey, + {{ov::hint::performance_mode.name(), ov::Any(ov::hint::PerformanceMode::THROUGHPUT)}})); ov::Any retrieved_value2; OV_ASSERT_NO_THROW(retrieved_value2 = ie.get_property(deviceName, configKey)); @@ -274,12 +273,14 @@ TEST_P(ClassPluginPropertiesTestSuite3NPU, CanGetPropertyWithOptionsNotAffecting ASSERT_EQ(retrieved_value.as(), retrieved_value2.as()); } -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_ClassPluginPropertiesOptsTest1NPU, ClassPluginPropertiesTestSuite3NPU, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_ClassPluginPropertiesOptsTest1NPU, + ClassPluginPropertiesTestSuite3NPU, ::testing::Combine(::testing::Values(ov::test::utils::getDeviceName()), ::testing::ValuesIn(plugin_public_immutable_properties)), ClassPluginPropertiesTestNPU::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests_ClassPluginPropertiesOptsTest2NPU, ClassPluginPropertiesTestSuite3NPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests_ClassPluginPropertiesOptsTest2NPU, + ClassPluginPropertiesTestSuite3NPU, ::testing::Combine(::testing::Values(ov::test::utils::getDeviceName()), ::testing::ValuesIn(plugin_public_mutable_properties)), ClassPluginPropertiesTestNPU::getTestCaseName); @@ -297,15 +298,12 @@ TEST_P(ClassPluginPropertiesTestSuite4NPU, CanNotSetGetInexistentProperty) { ASSERT_THROW(auto property1 = ie.get_property(deviceName, configKey), ov::Exception); - ASSERT_THROW( - ov::CompiledModel compiled_model1 = ie.compile_model( - model, deviceName, {{configKey, configValue}}), - ov::Exception); + ASSERT_THROW(ov::CompiledModel compiled_model1 = ie.compile_model(model, deviceName, {{configKey, configValue}}), + ov::Exception); ov::CompiledModel compiled_model2; - OV_ASSERT_NO_THROW(compiled_model2 = - ie.compile_model(model, deviceName)); + OV_ASSERT_NO_THROW(compiled_model2 = ie.compile_model(model, deviceName)); ASSERT_THROW(compiled_model2.set_property({{configKey, configValue}}), ov::Exception); // Expect to throw due to unimplemented method @@ -314,11 +312,12 @@ TEST_P(ClassPluginPropertiesTestSuite4NPU, CanNotSetGetInexistentProperty) { ov::Exception); // Expect to throw due to unsupported config } -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_ClassExecutableNetworkGetPropertiesTestNPU, - ClassPluginPropertiesTestSuite4NPU, - ::testing::Combine(::testing::Values(ov::test::utils::getDeviceName()), - ::testing::ValuesIn({std::make_pair( - "THISCONFIGKEYNOTEXIST", ov::Any("THISCONFIGVALUENOTEXIST"))})), - ClassPluginPropertiesTestSuite4NPU::getTestCaseName); +INSTANTIATE_TEST_SUITE_P( + smoke_BehaviorTests_ClassExecutableNetworkGetPropertiesTestNPU, + ClassPluginPropertiesTestSuite4NPU, + ::testing::Combine(::testing::Values(ov::test::utils::getDeviceName()), + ::testing::ValuesIn({std::make_pair("THISCONFIGKEYNOTEXIST", + ov::Any("THISCONFIGVALUENOTEXIST"))})), + ClassPluginPropertiesTestSuite4NPU::getTestCaseName); } // namespace diff --git a/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp b/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp index 858cf6b95cd191..a67042435952e4 100644 --- a/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp +++ b/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp @@ -5,39 +5,41 @@ #pragma once #include + #include "base/ov_behavior_test_utils.hpp" #include "behavior/ov_plugin/properties_tests.hpp" #include "common/functions.h" -#include "common/utils.hpp" #include "common/npu_test_env_cfg.hpp" +#include "common/utils.hpp" #include "common_test_utils/data_utils.hpp" #include "common_test_utils/subgraph_builders/concat_with_params.hpp" #include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #include "common_test_utils/subgraph_builders/kso_func.hpp" #include "common_test_utils/subgraph_builders/single_concat_with_constant.hpp" #include "common_test_utils/subgraph_builders/split_conv_concat.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" using CompilationParams = std::tuple; #ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT -#include -#define GTEST_COUT std::cerr << "[ ] [ INFO ] " -#include -#include -#include "openvino/pass/manager.hpp" +# include +# define GTEST_COUT std::cerr << "[ ] [ INFO ] " +# include +# include + +# include "openvino/pass/manager.hpp" + #endif namespace ov { namespace test { namespace behavior { -class OVClassBaseTestPNPU : - public OVClassNetworkTest, - public testing::WithParamInterface, - public OVPluginTestBase { +class OVClassBaseTestPNPU : public OVClassNetworkTest, + public testing::WithParamInterface, + public OVPluginTestBase { protected: ov::AnyMap configuration; std::string deathTestStyle; @@ -93,7 +95,6 @@ class OVClassBaseTestPNPU : }; class OVClassBasicTestPNPU : public OVBasicPropertiesTestsP { - public: void TearDown() override { for (std::size_t testIndex = 0; testIndex < ov::test::utils::test_unicode_postfix_vector.size(); testIndex++) { @@ -118,14 +119,16 @@ TEST_P(OVClassNetworkTestPNPU, LoadNetworkActualNoThrow) { TEST_P(OVClassNetworkTestPNPU, LoadNetworkActualHeteroDeviceNoThrow) { ov::Core ie = createCoreWithTemplate(); - OV_ASSERT_NO_THROW(ie.compile_model( - actualNetwork, ov::test::utils::DEVICE_HETERO + std::string(":") + target_device, configuration)); + OV_ASSERT_NO_THROW(ie.compile_model(actualNetwork, + ov::test::utils::DEVICE_HETERO + std::string(":") + target_device, + configuration)); } TEST_P(OVClassNetworkTestPNPU, LoadNetworkActualHeteroDevice2NoThrow) { ov::Core ie = createCoreWithTemplate(); - OV_ASSERT_NO_THROW(ie.compile_model(actualNetwork, ov::test::utils::DEVICE_HETERO, + OV_ASSERT_NO_THROW(ie.compile_model(actualNetwork, + ov::test::utils::DEVICE_HETERO, ov::device::priorities(target_device), ov::device::properties(target_device, configuration))); } @@ -134,7 +137,8 @@ TEST_P(OVClassNetworkTestPNPU, LoadNetworkActualHeteroDeviceUsingDevicePropertie ov::Core ie = createCoreWithTemplate(); configuration.emplace(ov::enable_profiling(true)); - OV_ASSERT_NO_THROW(ie.compile_model(actualNetwork, ov::test::utils::DEVICE_HETERO, + OV_ASSERT_NO_THROW(ie.compile_model(actualNetwork, + ov::test::utils::DEVICE_HETERO, ov::device::priorities(target_device), ov::device::properties(target_device, configuration))); } @@ -248,7 +252,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyCom auto model = createModelWithLargeSize(); OV_ASSERT_NO_THROW(deviceAllocMemSizeAny = - core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); + core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); uint64_t deviceAllocMemSize = deviceAllocMemSizeAny.as(); uint64_t deviceAllocMemSizeFinal; @@ -259,7 +263,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyCom compiledModel = {}; OV_ASSERT_NO_THROW(deviceAllocMemSizeAny = - core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); + core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); deviceAllocMemSizeFinal = deviceAllocMemSizeAny.as(); ASSERT_EQ(deviceAllocMemSize, deviceAllocMemSizeFinal) << " at iteration " << i; } @@ -281,7 +285,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInf inferRequest = {}; OV_ASSERT_NO_THROW(deviceAllocMemSizeAny = - core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); + core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); uint64_t deviceAllocMemSize = deviceAllocMemSizeAny.as(); uint64_t deviceAllocMemSizeFinal; @@ -292,7 +296,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInf inferRequest = {}; OV_ASSERT_NO_THROW(deviceAllocMemSizeAny = - core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); + core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); deviceAllocMemSizeFinal = deviceAllocMemSizeAny.as(); ASSERT_EQ(deviceAllocMemSize, deviceAllocMemSizeFinal) << " at iteration " << i; } @@ -314,7 +318,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInf inferRequest = {}; OV_ASSERT_NO_THROW(deviceAllocMemSizeAny = - core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); + core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); uint64_t deviceAllocMemSize = deviceAllocMemSizeAny.as(); uint64_t deviceAllocMemSizeFinal; @@ -328,7 +332,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInf inferRequest = {}; OV_ASSERT_NO_THROW(deviceAllocMemSizeAny = - core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); + core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); deviceAllocMemSizeFinal = deviceAllocMemSizeAny.as(); ASSERT_EQ(deviceAllocMemSize, deviceAllocMemSizeFinal) << " at iteration " << i; } @@ -343,7 +347,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInf auto model = createModelWithLargeSize(); OV_ASSERT_NO_THROW(deviceAllocMemSizeAny = - core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); + core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); uint64_t deviceAllocMemSize = deviceAllocMemSizeAny.as(); uint64_t deviceAllocMemSizeFinal; @@ -358,14 +362,14 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInf compiledModel = {}; OV_ASSERT_NO_THROW(deviceAllocMemSizeAny = - core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); + core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); deviceAllocMemSizeFinal = deviceAllocMemSizeAny.as(); ASSERT_LT(deviceAllocMemSize, deviceAllocMemSizeFinal) << " at iteration " << i; tensor = {}; OV_ASSERT_NO_THROW(deviceAllocMemSizeAny = - core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); + core.get_property(target_device, ov::intel_npu::device_alloc_mem_size.name())); deviceAllocMemSizeFinal = deviceAllocMemSizeAny.as(); ASSERT_EQ(deviceAllocMemSize, deviceAllocMemSizeFinal) << " at iteration " << i; } @@ -416,21 +420,21 @@ TEST_P(OVClassBasicTestPNPU, smoke_registerPluginsLibrariesUnicodePath) { std::string unicode_target_device = target_device + "_UNICODE_" + std::to_string(testIndex); std::wstring postfix = ov::test::utils::test_unicode_postfix_vector[testIndex]; std::wstring unicode_path = - ov::test::utils::stringToWString(ov::test::utils::getOpenvinoLibDirectory() + "/") + postfix; + ov::test::utils::stringToWString(ov::test::utils::getOpenvinoLibDirectory() + "/") + postfix; try { -#ifndef _WIN32 +# ifndef _WIN32 std::filesystem::create_directory(ov::util::wstring_to_string(unicode_path)); -#else +# else std::filesystem::create_directory(unicode_path); -#endif +# endif std::string pluginNamePath = - ov::util::make_plugin_library_name(ov::util::wstring_to_string(unicode_path), pluginName); + ov::util::make_plugin_library_name(ov::util::wstring_to_string(unicode_path), pluginName); for (auto&& lib : libs) { auto&& libPath = ov::test::utils::stringToWString( - ov::util::make_plugin_library_name(ov::test::utils::getOpenvinoLibDirectory(), lib)); + ov::util::make_plugin_library_name(ov::test::utils::getOpenvinoLibDirectory(), lib)); auto&& libPathNew = ov::test::utils::stringToWString( - ov::util::make_plugin_library_name(::ov::util::wstring_to_string(unicode_path), lib)); + ov::util::make_plugin_library_name(::ov::util::wstring_to_string(unicode_path), lib)); bool is_copy_successfully = ov::test::utils::copyFile(libPath, libPathNew); if (!is_copy_successfully) { FAIL() << "Unable to copy from '" << libPath << "' to '" << libPathNew << "'"; diff --git a/src/plugins/intel_npu/tests/functional/main.cpp b/src/plugins/intel_npu/tests/functional/main.cpp index 07e33d65d4e4a6..5e86f5a2865953 100644 --- a/src/plugins/intel_npu/tests/functional/main.cpp +++ b/src/plugins/intel_npu/tests/functional/main.cpp @@ -4,14 +4,15 @@ #include #ifdef WIN32 -#include +# include #endif #include #include #include + #include "gtest/gtest.h" -#include "intel_npu/al/config/config.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/config/config.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "npu_test_report.hpp" #include "npu_test_tool.hpp" @@ -41,11 +42,11 @@ int main(int argc, char** argv, char** envp) { } oss << std::endl; -# ifdef WIN32 - oss << "Process id: " << _getpid() << std::endl; -# else - oss << "Process id: " << getpid() << std::endl; -# endif +#ifdef WIN32 + oss << "Process id: " << _getpid() << std::endl; +#else + oss << "Process id: " << getpid() << std::endl; +#endif std::cout << oss.str(); oss.str(""); @@ -84,9 +85,8 @@ int main(int argc, char** argv, char** envp) { auto& log = intel_npu::Logger::global(); auto level = ov::test::utils::NpuTestEnvConfig::getInstance().IE_NPU_TESTS_LOG_LEVEL; - ov::log::Level logLevel = level.empty() - ? ov::log::Level::ERR - : intel_npu::OptionParser::parse(level.c_str()); + ov::log::Level logLevel = + level.empty() ? ov::log::Level::ERR : intel_npu::OptionParser::parse(level.c_str()); log.setLevel(logLevel); return RUN_ALL_TESTS(); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/compiled_model_base.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/compiled_model_base.cpp index 5204e49761afa0..208c94112cd232 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/compiled_model_base.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/compiled_model_base.cpp @@ -3,9 +3,10 @@ // #include "behavior/compiled_model/compiled_model_base.hpp" -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; namespace { @@ -26,40 +27,47 @@ auto heteroCompiledModelConfigs = []() -> std::vector { return heteroPluginConfigs; }(); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVCompiledModelBaseTest, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVCompiledModelBaseTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(compiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVCompiledModelBaseTest, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVCompiledModelBaseTest, ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(heteroCompiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVCompiledModelBaseTestOptional, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVCompiledModelBaseTestOptional, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(compiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVCompiledModelBaseTestOptional, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVCompiledModelBaseTestOptional, ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(heteroCompiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVAutoExecutableNetworkTest, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVAutoExecutableNetworkTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(compiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVAutoExecutableNetworkTest, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVAutoExecutableNetworkTest, ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(heteroCompiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, CompiledModelSetType, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + CompiledModelSetType, ::testing::Combine(::testing::ValuesIn(modelTypes), ::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/import_export.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/import_export.cpp index 7b5acd0448b262..275215715a7b5a 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/import_export.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/import_export.cpp @@ -5,15 +5,16 @@ #include "behavior/compiled_model/import_export.hpp" #include -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; namespace { const std::vector modelTypes = { - ov::element::f16, - ov::element::f32, + ov::element::f16, + ov::element::f32, }; const std::vector modelShapes = {{1, 2, 5, 5}}; @@ -38,50 +39,61 @@ auto heteroCompiledModelConfigs = []() -> std::vector { return heteroPluginConfigs; }(); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVCompiledGraphImportExportTest, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVCompiledGraphImportExportTest, ::testing::Combine(::testing::ValuesIn(convertModelTypes), ::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(compiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVCompiledGraphImportExportTest, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVCompiledGraphImportExportTest, ::testing::Combine(::testing::ValuesIn(convertModelTypes), ::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(heteroCompiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVClassCompiledModelImportExportTestP, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVClassCompiledModelImportExportTestP, ::testing::Values(ov::test::utils::DEVICE_NPU), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVClassCompiledModelImportExportTestP, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVClassCompiledModelImportExportTestP, ::testing::Values(std::string(ov::test::utils::DEVICE_NPU), "HETERO:" + std::string(ov::test::utils::DEVICE_NPU)), ov::test::utils::appendPlatformTypeTestName); #if defined(ENABLE_INTEL_CPU) && ENABLE_INTEL_CPU -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_HETERO_CPU, OVClassCompiledModelImportExportTestP, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_HETERO_CPU, + OVClassCompiledModelImportExportTestP, ::testing::Values("HETERO:" + std::string(ov::test::utils::DEVICE_NPU) + ",CPU")); #endif -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVCompiledModelGraphUniqueNodeNamesTest, - ::testing::Combine(::testing::ValuesIn(modelTypes), ::testing::ValuesIn(modelShapes), +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVCompiledModelGraphUniqueNodeNamesTest, + ::testing::Combine(::testing::ValuesIn(modelTypes), + ::testing::ValuesIn(modelShapes), ::testing::Values(ov::test::utils::DEVICE_NPU)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVCompiledModelGraphUniqueNodeNamesTest, - ::testing::Combine(::testing::ValuesIn(modelTypes), ::testing::ValuesIn(modelShapes), +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVCompiledModelGraphUniqueNodeNamesTest, + ::testing::Combine(::testing::ValuesIn(modelTypes), + ::testing::ValuesIn(modelShapes), ::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVExecGraphSerializationTest, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVExecGraphSerializationTest, ::testing::Values(ov::test::utils::DEVICE_NPU), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVExecGraphSerializationTest, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVExecGraphSerializationTest, ::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ov::test::utils::appendPlatformTypeTestName); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/properties.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/properties.cpp index d5e154a26ac127..89a98cce0098b1 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/properties.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/properties.cpp @@ -3,10 +3,11 @@ // #include "behavior/compiled_model/properties.hpp" + #include "common/functions.h" -#include "common/utils.hpp" #include "common/npu_test_env_cfg.hpp" -#include "npu_private_properties.hpp" +#include "common/utils.hpp" +#include "intel_npu/npu_private_properties.hpp" using namespace ov::test::behavior; @@ -20,11 +21,11 @@ std::vector operator+(std::vector origAnyMapVector, for (auto&& anyMap : origAnyMapVector) { ov::AnyMap newAnyMap = anyMap; ov::AnyMap& newAnyMapRef = (anyMap.find(ov::device::properties.name()) != anyMap.end()) - ? newAnyMap.find(ov::device::properties.name()) - ->second.as() - .begin() - ->second.as() - : newAnyMap; + ? newAnyMap.find(ov::device::properties.name()) + ->second.as() + .begin() + ->second.as() + : newAnyMap; if (newAnyMapRef.find(pair.first) == newAnyMapRef.end()) { newAnyMapRef.emplace(pair); @@ -38,44 +39,45 @@ std::vector operator+(std::vector origAnyMapVector, } const std::vector> compiledModelProperties = { - {ov::enable_profiling.name(), ov::Any(true)}, - {ov::hint::performance_mode.name(), ov::Any(ov::hint::PerformanceMode::THROUGHPUT)}, - {ov::hint::num_requests.name(), ov::Any(4u)}, - {ov::hint::inference_precision.name(), ov::Any(ov::element::i8)}, - {ov::hint::enable_cpu_pinning.name(), ov::Any(true)}, - {ov::hint::model_priority.name(), ov::Any(ov::hint::Priority::HIGH)}, - {ov::intel_npu::tiles.name(), ov::Any(2)}, - {ov::intel_npu::profiling_type.name(), ov::Any(ov::intel_npu::ProfilingType::INFER)}, - {ov::intel_npu::use_elf_compiler_backend.name(), ov::Any(ov::intel_npu::ElfCompilerBackend::NO)}, - {ov::intel_npu::create_executor.name(), ov::Any(2)}}; + {ov::enable_profiling.name(), ov::Any(true)}, + {ov::hint::performance_mode.name(), ov::Any(ov::hint::PerformanceMode::THROUGHPUT)}, + {ov::hint::num_requests.name(), ov::Any(4u)}, + {ov::hint::inference_precision.name(), ov::Any(ov::element::i8)}, + {ov::hint::enable_cpu_pinning.name(), ov::Any(true)}, + {ov::hint::model_priority.name(), ov::Any(ov::hint::Priority::HIGH)}, + {ov::intel_npu::tiles.name(), ov::Any(2)}, + {ov::intel_npu::profiling_type.name(), ov::Any(ov::intel_npu::ProfilingType::INFER)}, + {ov::intel_npu::use_elf_compiler_backend.name(), ov::Any(ov::intel_npu::ElfCompilerBackend::NO)}, + {ov::intel_npu::create_executor.name(), ov::Any(2)}}; const std::string& expectedModelName = []() -> std::string { return ov::test::behavior::getDefaultNGraphFunctionForTheDevice()->get_friendly_name(); }(); const std::vector publicCompiledModelConfigs = { - {{ov::device::id.name(), ov::Any("")}}, - {{ov::hint::enable_cpu_pinning.name(), ov::Any(false)}}, - {{ov::hint::model_priority.name(), ov::Any(ov::hint::Priority::MEDIUM)}}, - {{ov::execution_devices.name(), ov::Any(ov::test::utils::DEVICE_NPU)}}, - {{ov::hint::execution_mode.name(), ov::Any(ov::hint::ExecutionMode::PERFORMANCE)}}, - {{ov::hint::inference_precision.name(), ov::Any(ov::element::f16)}}, - {{ov::loaded_from_cache.name(), ov::Any(false)}}, - {{ov::model_name.name(), ov::Any(expectedModelName)}}, - {{ov::optimal_number_of_infer_requests.name(), ov::Any(1u)}}, - {{ov::hint::performance_mode.name(), ov::Any(ov::hint::PerformanceMode::LATENCY)}}, - {{ov::hint::num_requests.name(), ov::Any(1u)}}, - {{ov::enable_profiling.name(), ov::Any(false)}}}; + {{ov::device::id.name(), ov::Any("")}}, + {{ov::hint::enable_cpu_pinning.name(), ov::Any(false)}}, + {{ov::hint::model_priority.name(), ov::Any(ov::hint::Priority::MEDIUM)}}, + {{ov::execution_devices.name(), ov::Any(ov::test::utils::DEVICE_NPU)}}, + {{ov::hint::execution_mode.name(), ov::Any(ov::hint::ExecutionMode::PERFORMANCE)}}, + {{ov::hint::inference_precision.name(), ov::Any(ov::element::f16)}}, + {{ov::loaded_from_cache.name(), ov::Any(false)}}, + {{ov::model_name.name(), ov::Any(expectedModelName)}}, + {{ov::optimal_number_of_infer_requests.name(), ov::Any(1u)}}, + {{ov::hint::performance_mode.name(), ov::Any(ov::hint::PerformanceMode::LATENCY)}}, + {{ov::hint::num_requests.name(), ov::Any(1u)}}, + {{ov::enable_profiling.name(), ov::Any(false)}}}; const std::vector compiledModelIncorrectConfigs = { - {{"NPU_INEXISTENT_PROPERTY", "NPU_INEXISTENT_PROPERTY_VALUE"}}}; + {{"NPU_INEXISTENT_PROPERTY", "NPU_INEXISTENT_PROPERTY_VALUE"}}}; const std::vector> allModelPriorities = { - ov::hint::model_priority(ov::hint::Priority::LOW), ov::hint::model_priority(ov::hint::Priority::MEDIUM), - ov::hint::model_priority(ov::hint::Priority::HIGH)}; + ov::hint::model_priority(ov::hint::Priority::LOW), + ov::hint::model_priority(ov::hint::Priority::MEDIUM), + ov::hint::model_priority(ov::hint::Priority::HIGH)}; const std::vector>& compiledModelPropertiesAnyToString = - []() -> std::vector> { + []() -> std::vector> { std::vector> compiledModelProps(compiledModelProperties.size()); for (auto it = compiledModelProperties.cbegin(); it != compiledModelProperties.cend(); ++it) { auto&& distance = it - compiledModelProperties.cbegin(); @@ -98,8 +100,8 @@ const auto& heteroCompiledModelConfigs = []() -> std::vector { for (auto it = compiledModelConfigs.cbegin(); it != compiledModelConfigs.cend(); ++it) { auto&& distance = it - compiledModelConfigs.cbegin(); heteroConfigs.at(distance) = { - ov::device::priorities(ov::test::utils::DEVICE_NPU), - {ov::device::properties.name(), ov::Any(ov::AnyMap{{ov::test::utils::DEVICE_NPU, ov::Any(*it)}})}}; + ov::device::priorities(ov::test::utils::DEVICE_NPU), + {ov::device::properties.name(), ov::Any(ov::AnyMap{{ov::test::utils::DEVICE_NPU, ov::Any(*it)}})}}; } return heteroConfigs; }(); @@ -122,45 +124,54 @@ const auto& combineHeteroParamsExecDevices = []() -> std::vector); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVClassCompiledModelGetIncorrectPropertyTest, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVClassCompiledModelGetIncorrectPropertyTest, ::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVClassCompiledModelGetPropertyTest, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVClassCompiledModelGetPropertyTest, ::testing::Values(ov::test::utils::DEVICE_NPU), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVClassCompiledModelGetPropertyTest, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVClassCompiledModelGetPropertyTest, ::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVClassCompiledModelGetConfigTest, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVClassCompiledModelGetConfigTest, ::testing::Values(ov::test::utils::DEVICE_NPU), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVClassCompiledModelPropertiesTests, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVClassCompiledModelPropertiesTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(compiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVClassCompiledModelPropertiesTests, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVClassCompiledModelPropertiesTests, ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(heteroCompiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVClassCompileModelWithCorrectPropertiesTest, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVClassCompileModelWithCorrectPropertiesTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(compiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVClassCompileModelWithCorrectPropertiesTest, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVClassCompileModelWithCorrectPropertiesTest, ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(heteroCompiledModelConfigs)), @@ -228,81 +239,96 @@ INSTANTIATE_TEST_SUITE_P(compatibility_smoke_AUTO_BehaviorTests_OVClassCompileMo ::testing::Combine(::testing::Values("AUTO"), ::testing::ValuesIn(autoConfigsWithSecondaryProperties))); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVClassCompiledModelPropertiesIncorrectTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVClassCompiledModelPropertiesIncorrectTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(compiledModelIncorrectConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVCompiledModelIncorrectDevice, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVCompiledModelIncorrectDevice, ::testing::Values(ov::test::utils::DEVICE_NPU), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVCompiledModelPropertiesDefaultSupportedTests, - ::testing::Values(ov::test::utils::DEVICE_NPU), +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVCompiledModelPropertiesDefaultSupportedTests, + ::testing::Values(ov::test::utils::DEVICE_NPU), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVClassCompiledModelPropertiesDefaultTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVClassCompiledModelPropertiesDefaultTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(publicCompiledModelConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVClassCompiledModelSetCorrectConfigTest, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVClassCompiledModelSetCorrectConfigTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(compiledModelPropertiesAnyToString)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVClassCompiledModelSetCorrectConfigTest, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVClassCompiledModelSetCorrectConfigTest, ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(compiledModelPropertiesAnyToString)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVClassCompiledModelSetIncorrectConfigTest, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVClassCompiledModelSetIncorrectConfigTest, ::testing::Values(ov::test::utils::DEVICE_NPU), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVClassCompiledModelSetIncorrectConfigTest, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVClassCompiledModelSetIncorrectConfigTest, ::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ov::test::utils::appendPlatformTypeTestName); INSTANTIATE_TEST_SUITE_P( - smoke_BehaviorTests, OVClassCompiledModelGetPropertyTest_MODEL_PRIORITY, - ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), - ::testing::ValuesIn(compiledModelConfigs + allModelPriorities)), - ov::test::utils::appendPlatformTypeTestName); + smoke_BehaviorTests, + OVClassCompiledModelGetPropertyTest_MODEL_PRIORITY, + ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), + ::testing::ValuesIn(compiledModelConfigs + allModelPriorities)), + ov::test::utils::appendPlatformTypeTestName); INSTANTIATE_TEST_SUITE_P( - smoke_Hetero_BehaviorTests, OVClassCompiledModelGetPropertyTest_MODEL_PRIORITY, - ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + - ov::test::utils::DEVICE_NPU), - ::testing::ValuesIn(heteroCompiledModelConfigs + allModelPriorities)), - ov::test::utils::appendPlatformTypeTestName); + smoke_Hetero_BehaviorTests, + OVClassCompiledModelGetPropertyTest_MODEL_PRIORITY, + ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + + ov::test::utils::DEVICE_NPU), + ::testing::ValuesIn(heteroCompiledModelConfigs + allModelPriorities)), + ov::test::utils::appendPlatformTypeTestName); INSTANTIATE_TEST_SUITE_P( - smoke_Hetero_BehaviorTests, OVClassCompiledModelGetPropertyTest_DEVICE_PRIORITY, - ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + - ov::test::utils::DEVICE_NPU), - ::testing::ValuesIn(heteroCompiledModelConfigs)), - ov::test::utils::appendPlatformTypeTestName); - -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVClassCompiledModelGetPropertyTest_EXEC_DEVICES, + smoke_Hetero_BehaviorTests, + OVClassCompiledModelGetPropertyTest_DEVICE_PRIORITY, + ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + + ov::test::utils::DEVICE_NPU), + ::testing::ValuesIn(heteroCompiledModelConfigs)), + ov::test::utils::appendPlatformTypeTestName); + +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVClassCompiledModelGetPropertyTest_EXEC_DEVICES, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(combineParamsExecDevices)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVClassCompiledModelGetPropertyTest_EXEC_DEVICES, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVClassCompiledModelGetPropertyTest_EXEC_DEVICES, ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(combineHeteroParamsExecDevices)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVCompileModelGetExecutionDeviceTests, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVCompileModelGetExecutionDeviceTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(combineParamsExecDevices)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVCompileModelGetExecutionDeviceTests, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVCompileModelGetExecutionDeviceTests, ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" + ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(combineHeteroParamsExecDevices)), diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/callback.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/callback.cpp index 349f194b0066f2..d96172d9b6e7c5 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/callback.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/callback.cpp @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "behavior/ov_infer_request/callback.hpp" + #include -#include "behavior/ov_infer_request/callback.hpp" -#include "common/utils.hpp" #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" #include "overload/ov_infer_request/callback.hpp" using namespace ov::test::behavior; @@ -15,40 +16,44 @@ using namespace ov::test::behavior; namespace { const std::vector configs = {{}}; -const std::vector multiConfigs = { - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::device::properties(ov::test::utils::DEVICE_NPU, ov::AnyMap{})}}; +const std::vector multiConfigs = {{ov::device::priorities(ov::test::utils::DEVICE_NPU), + ov::device::properties(ov::test::utils::DEVICE_NPU, ov::AnyMap{})}}; -const std::vector autoConfigs = { - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::device::properties(ov::test::utils::DEVICE_NPU, ov::AnyMap{})}}; +const std::vector autoConfigs = {{ov::device::priorities(ov::test::utils::DEVICE_NPU), + ov::device::properties(ov::test::utils::DEVICE_NPU, ov::AnyMap{})}}; -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestCallbackTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestCallbackTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, OVInferRequestCallbackTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, + OVInferRequestCallbackTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, OVInferRequestCallbackTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, + OVInferRequestCallbackTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_AUTO), ::testing::ValuesIn(autoConfigs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestCallbackTestsNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestCallbackTestsNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, OVInferRequestCallbackTestsNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, + OVInferRequestCallbackTestsNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, OVInferRequestCallbackTestsNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, + OVInferRequestCallbackTestsNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_AUTO), ::testing::ValuesIn(autoConfigs)), InferRequestParamsAnyMapTestName::getTestCaseName); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/cancellation.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/cancellation.cpp index 565c8f2cd0b2d4..126e202a353dc9 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/cancellation.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/cancellation.cpp @@ -3,9 +3,10 @@ // #include "behavior/ov_infer_request/cancellation.hpp" -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" #include "overload/ov_infer_request/cancellation.hpp" using namespace ov::test::behavior; @@ -13,12 +14,14 @@ using namespace ov::test::behavior; namespace { const std::vector configs = {{}}; -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestCancellationTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestCancellationTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestCancellationTestsNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestCancellationTestsNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), InferRequestParamsAnyMapTestName::getTestCaseName); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_consistency.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_consistency.cpp index 57f56bef2a25dc..551629f9433e4b 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_consistency.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_consistency.cpp @@ -2,13 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "behavior/ov_infer_request/infer_consistency.hpp" + #include #include -#include "behavior/ov_infer_request/infer_consistency.hpp" -#include "common/utils.hpp" #include "common/npu_test_env_cfg.hpp" -#include "npu_private_properties.hpp" +#include "common/utils.hpp" +#include "intel_npu/npu_private_properties.hpp" using namespace ov::test::behavior; @@ -20,9 +21,7 @@ namespace { using Configs = std::vector>; auto configs = []() { - return std::vector{{{ov::test::utils::DEVICE_NPU, - {} - }}}; + return std::vector{{{ov::test::utils::DEVICE_NPU, {}}}}; }(); auto autoConfigs = []() { @@ -36,22 +35,22 @@ auto autoConfigs = []() { {ov::hint::performance_mode(ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT)}}, {ov::test::utils::DEVICE_NPU, {}}}, {{ov::test::utils::DEVICE_AUTO + std::string(":") + ov::test::utils::DEVICE_NPU + "," + - ov::test::utils::DEVICE_CPU, + ov::test::utils::DEVICE_CPU, {ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}}, {ov::test::utils::DEVICE_NPU, {}}, {ov::test::utils::DEVICE_CPU, {}}}, {{ov::test::utils::DEVICE_AUTO + std::string(":") + ov::test::utils::DEVICE_NPU + "," + - ov::test::utils::DEVICE_CPU, + ov::test::utils::DEVICE_CPU, {ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}}, {ov::test::utils::DEVICE_NPU, {}}, {ov::test::utils::DEVICE_CPU, {}}}, {{ov::test::utils::DEVICE_AUTO + std::string(":") + ov::test::utils::DEVICE_NPU + "," + - ov::test::utils::DEVICE_CPU, + ov::test::utils::DEVICE_CPU, {ov::hint::performance_mode(ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT)}}, {ov::test::utils::DEVICE_NPU, {}}, {ov::test::utils::DEVICE_CPU, {}}}, {{ov::test::utils::DEVICE_AUTO + std::string(":") + ov::test::utils::DEVICE_CPU + "," + - ov::test::utils::DEVICE_NPU, + ov::test::utils::DEVICE_NPU, {ov::hint::performance_mode(ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT)}}, {ov::test::utils::DEVICE_CPU, {}}, {ov::test::utils::DEVICE_NPU, {}}}}; @@ -65,31 +64,34 @@ auto multiConfigs = []() { {ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}}, {ov::test::utils::DEVICE_NPU, {}}}, {{ov::test::utils::DEVICE_MULTI + std::string(":") + ov::test::utils::DEVICE_NPU + "," + - ov::test::utils::DEVICE_CPU, + ov::test::utils::DEVICE_CPU, {ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}}, {ov::test::utils::DEVICE_NPU, {}}, {ov::test::utils::DEVICE_CPU, {}}}, {{ov::test::utils::DEVICE_MULTI + std::string(":") + ov::test::utils::DEVICE_NPU + "," + - ov::test::utils::DEVICE_CPU, + ov::test::utils::DEVICE_CPU, {ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}}, {ov::test::utils::DEVICE_NPU, {}}, {ov::test::utils::DEVICE_CPU, {}}}}; }(); // 3x5 configuration takes ~65 seconds to run, which is already pretty long time -INSTANTIATE_TEST_SUITE_P(DISABLED_smoke_BehaviorTests, OVInferConsistencyTest, +INSTANTIATE_TEST_SUITE_P(DISABLED_smoke_BehaviorTests, + OVInferConsistencyTest, ::testing::Combine(::testing::Values(3), // inferRequest num ::testing::Values(5), // infer counts ::testing::ValuesIn(configs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(DISABLED_smoke_Auto_BehaviorTests, OVInferConsistencyTest, +INSTANTIATE_TEST_SUITE_P(DISABLED_smoke_Auto_BehaviorTests, + OVInferConsistencyTest, ::testing::Combine(::testing::Values(3), // inferRequest num ::testing::Values(5), // infer counts ::testing::ValuesIn(autoConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(DISABLED_smoke_Multi_BehaviorTests, OVInferConsistencyTest, +INSTANTIATE_TEST_SUITE_P(DISABLED_smoke_Multi_BehaviorTests, + OVInferConsistencyTest, ::testing::Combine(::testing::Values(3), // inferRequest num ::testing::Values(5), // infer counts ::testing::ValuesIn(multiConfigs)), diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/inference_chaining.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/inference_chaining.cpp index 27cdb01e147211..4ba8e8342068bb 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/inference_chaining.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/inference_chaining.cpp @@ -3,22 +3,25 @@ // #include "behavior/ov_infer_request/inference_chaining.hpp" -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" +#include "common/utils.hpp" #include "common_test_utils/test_constants.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; namespace { const std::vector configs = {{}}; -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVInferenceChaining, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVInferenceChaining, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVInferenceChainingStatic, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVInferenceChainingStatic, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), ov::test::utils::appendPlatformTypeTestName); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/io_tensor.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/io_tensor.cpp index b1f61e41f5e855..9275e8b1dd2573 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/io_tensor.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/io_tensor.cpp @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "behavior/ov_infer_request/io_tensor.hpp" + #include -#include "behavior/ov_infer_request/io_tensor.hpp" -#include "common/utils.hpp" #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" #include "overload/ov_infer_request/io_tensor.hpp" using namespace ov::test::behavior; @@ -16,86 +17,120 @@ namespace { const std::vector configs = {{}}; const std::vector multiConfigs = { - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; + {ov::device::priorities(ov::test::utils::DEVICE_NPU), ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; const std::vector autoConfigs = { - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; + {ov::device::priorities(ov::test::utils::DEVICE_NPU), ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestIOTensorTest, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestIOTensorTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, OVInferRequestIOTensorTest, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, + OVInferRequestIOTensorTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestIOTensorTestNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestIOTensorTestNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, OVInferRequestIOTensorTestNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, + OVInferRequestIOTensorTestNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, OVInferRequestIOTensorTest, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, + OVInferRequestIOTensorTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_AUTO), ::testing::ValuesIn(autoConfigs)), InferRequestParamsAnyMapTestName::getTestCaseName); const std::vector prcs = { - ov::element::boolean, ov::element::bf16, ov::element::f16, ov::element::f32, ov::element::f64, ov::element::i4, - ov::element::i8, ov::element::i16, ov::element::i32, ov::element::i64, ov::element::u1, ov::element::u4, - ov::element::u8, ov::element::u16, ov::element::u32, ov::element::u64, + ov::element::boolean, + ov::element::bf16, + ov::element::f16, + ov::element::f32, + ov::element::f64, + ov::element::i4, + ov::element::i8, + ov::element::i16, + ov::element::i32, + ov::element::i64, + ov::element::u1, + ov::element::u4, + ov::element::u8, + ov::element::u16, + ov::element::u32, + ov::element::u64, }; -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestIOTensorSetPrecisionTest, - ::testing::Combine(::testing::ValuesIn(prcs), ::testing::Values(ov::test::utils::DEVICE_NPU), +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestIOTensorSetPrecisionTest, + ::testing::Combine(::testing::ValuesIn(prcs), + ::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, OVInferRequestIOTensorSetPrecisionTest, - ::testing::Combine(::testing::ValuesIn(prcs), ::testing::Values(ov::test::utils::DEVICE_MULTI), +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, + OVInferRequestIOTensorSetPrecisionTest, + ::testing::Combine(::testing::ValuesIn(prcs), + ::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, OVInferRequestIOTensorSetPrecisionTest, - ::testing::Combine(::testing::ValuesIn(prcs), ::testing::Values(ov::test::utils::DEVICE_AUTO), +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, + OVInferRequestIOTensorSetPrecisionTest, + ::testing::Combine(::testing::ValuesIn(prcs), + ::testing::Values(ov::test::utils::DEVICE_AUTO), ::testing::ValuesIn(autoConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestIOTensorSetPrecisionTestNPU, - ::testing::Combine(::testing::ValuesIn(prcs), ::testing::Values(ov::test::utils::DEVICE_NPU), +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestIOTensorSetPrecisionTestNPU, + ::testing::Combine(::testing::ValuesIn(prcs), + ::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Mutli_BehaviorTests, OVInferRequestIOTensorSetPrecisionTestNPU, - ::testing::Combine(::testing::ValuesIn(prcs), ::testing::Values(ov::test::utils::DEVICE_MULTI), +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Mutli_BehaviorTests, + OVInferRequestIOTensorSetPrecisionTestNPU, + ::testing::Combine(::testing::ValuesIn(prcs), + ::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, OVInferRequestIOTensorSetPrecisionTestNPU, - ::testing::Combine(::testing::ValuesIn(prcs), ::testing::Values(ov::test::utils::DEVICE_AUTO), +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, + OVInferRequestIOTensorSetPrecisionTestNPU, + ::testing::Combine(::testing::ValuesIn(prcs), + ::testing::Values(ov::test::utils::DEVICE_AUTO), ::testing::ValuesIn(autoConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVInferRequestCheckTensorPrecision, - ::testing::Combine(::testing::ValuesIn(prcs), ::testing::Values(ov::test::utils::DEVICE_NPU), +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVInferRequestCheckTensorPrecision, + ::testing::Combine(::testing::ValuesIn(prcs), + ::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Multi_BehaviorTests, OVInferRequestCheckTensorPrecision, - ::testing::Combine(::testing::ValuesIn(prcs), ::testing::Values(ov::test::utils::DEVICE_MULTI), +INSTANTIATE_TEST_SUITE_P(smoke_Multi_BehaviorTests, + OVInferRequestCheckTensorPrecision, + ::testing::Combine(::testing::ValuesIn(prcs), + ::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Auto_BehaviorTests, OVInferRequestCheckTensorPrecision, - ::testing::Combine(::testing::ValuesIn(prcs), ::testing::Values(ov::test::utils::DEVICE_AUTO), +INSTANTIATE_TEST_SUITE_P(smoke_Auto_BehaviorTests, + OVInferRequestCheckTensorPrecision, + ::testing::Combine(::testing::ValuesIn(prcs), + ::testing::Values(ov::test::utils::DEVICE_AUTO), ::testing::ValuesIn(autoConfigs)), ov::test::utils::appendPlatformTypeTestName); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/iteration_chaining.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/iteration_chaining.cpp index 3e6ef6cf66af5c..0e81f76b2180f9 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/iteration_chaining.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/iteration_chaining.cpp @@ -3,29 +3,29 @@ // #include "behavior/ov_infer_request/iteration_chaining.hpp" -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" -#include "npu_private_properties.hpp" +#include "common/utils.hpp" +#include "intel_npu/npu_private_properties.hpp" using namespace ov::test::behavior; namespace { -const std::vector configs = { - {{ov::hint::inference_precision.name(), ov::element::f32}}}; +const std::vector configs = {{{ov::hint::inference_precision.name(), ov::element::f32}}}; -const std::vector heteroConfigs = { - {{ov::hint::inference_precision.name(), ov::element::f32}, - {ov::device::priorities(ov::test::utils::DEVICE_NPU)}, - {ov::device::properties(ov::test::utils::DEVICE_NPU, - {})}}}; +const std::vector heteroConfigs = {{{ov::hint::inference_precision.name(), ov::element::f32}, + {ov::device::priorities(ov::test::utils::DEVICE_NPU)}, + {ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}}; -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVIterationChaining, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVIterationChaining, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVIterationChaining, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVIterationChaining, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_HETERO), ::testing::ValuesIn(heteroConfigs)), ov::test::utils::appendPlatformTypeTestName); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/memory_states.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/memory_states.cpp index fa3a67ffa4ceba..99c8d2d3776aa4 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/memory_states.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/memory_states.cpp @@ -3,29 +3,34 @@ // #include "behavior/ov_infer_request/memory_states.hpp" -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" -#include "npu_private_properties.hpp" +#include "common/utils.hpp" +#include "intel_npu/npu_private_properties.hpp" using namespace ov::test::behavior; using namespace ov; namespace { -const std::vector memoryStateTestCases = {memoryStateParams( - OVInferRequestVariableStateTest::get_network(), {"c_1-3", "r_1-3"}, ov::test::utils::DEVICE_NPU, - {})}; +const std::vector memoryStateTestCases = { + memoryStateParams(OVInferRequestVariableStateTest::get_network(), + {"c_1-3", "r_1-3"}, + ov::test::utils::DEVICE_NPU, + {})}; const std::vector memoryStateHeteroTestCases = {memoryStateParams( - OVInferRequestVariableStateTest::get_network(), {"c_1-3", "r_1-3"}, ov::test::utils::DEVICE_HETERO, - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::device::properties(ov::test::utils::DEVICE_NPU, - {})})}; + OVInferRequestVariableStateTest::get_network(), + {"c_1-3", "r_1-3"}, + ov::test::utils::DEVICE_HETERO, + {ov::device::priorities(ov::test::utils::DEVICE_NPU), ov::device::properties(ov::test::utils::DEVICE_NPU, {})})}; -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_VariableState, OVInferRequestVariableStateTest, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_VariableState, + OVInferRequestVariableStateTest, ::testing::ValuesIn(memoryStateTestCases), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests_VariableState, OVInferRequestVariableStateTest, +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests_VariableState, + OVInferRequestVariableStateTest, ::testing::ValuesIn(memoryStateHeteroTestCases), ov::test::utils::appendPlatformTypeTestName); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/multithreading.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/multithreading.cpp index 745ebcbaea7900..5eefb3766f21d5 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/multithreading.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/multithreading.cpp @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "behavior/ov_infer_request/multithreading.hpp" + #include -#include "behavior/ov_infer_request/multithreading.hpp" -#include "common/utils.hpp" #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" #include "overload/ov_infer_request/multithreading.hpp" using namespace ov::test::behavior; @@ -16,39 +17,43 @@ namespace { const std::vector configs = {{}}; const std::vector multiConfigs = { - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; + {ov::device::priorities(ov::test::utils::DEVICE_NPU), ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; const std::vector autoConfigs = { - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; + {ov::device::priorities(ov::test::utils::DEVICE_NPU), ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestMultithreadingTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestMultithreadingTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, OVInferRequestMultithreadingTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, + OVInferRequestMultithreadingTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, OVInferRequestMultithreadingTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, + OVInferRequestMultithreadingTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_AUTO), ::testing::ValuesIn(autoConfigs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestMultithreadingTestsNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestMultithreadingTestsNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, OVInferRequestMultithreadingTestsNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, + OVInferRequestMultithreadingTestsNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), InferRequestParamsAnyMapTestName::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, OVInferRequestMultithreadingTestsNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, + OVInferRequestMultithreadingTestsNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_AUTO), ::testing::ValuesIn(autoConfigs)), InferRequestParamsAnyMapTestName::getTestCaseName); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/perf_counters.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/perf_counters.cpp index 273f44c5fbee3e..c99bdb61e2b4ee 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/perf_counters.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/perf_counters.cpp @@ -3,53 +3,58 @@ // #include "behavior/ov_infer_request/perf_counters.hpp" -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; namespace { const std::vector configs = {{}}; -const std::vector multiConfigs = { - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}, - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}}; +const std::vector multiConfigs = {{ov::device::priorities(ov::test::utils::DEVICE_NPU), + ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}, + {ov::device::priorities(ov::test::utils::DEVICE_NPU), + ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}}; -const std::vector autoConfigs = { - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}, - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}}; +const std::vector autoConfigs = {{ov::device::priorities(ov::test::utils::DEVICE_NPU), + ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}, + {ov::device::priorities(ov::test::utils::DEVICE_NPU), + ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}}; -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, OVInferRequestPerfCountersTest, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, + OVInferRequestPerfCountersTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, OVInferRequestPerfCountersTest, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, + OVInferRequestPerfCountersTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_AUTO), ::testing::ValuesIn(autoConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestPerfCountersTest, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestPerfCountersTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVInferRequestPerfCountersExceptionTest, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVInferRequestPerfCountersExceptionTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Auto_BehaviorTests, OVInferRequestPerfCountersExceptionTest, +INSTANTIATE_TEST_SUITE_P(smoke_Auto_BehaviorTests, + OVInferRequestPerfCountersExceptionTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_AUTO), ::testing::ValuesIn(autoConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_Multi_BehaviorTests, OVInferRequestPerfCountersExceptionTest, +INSTANTIATE_TEST_SUITE_P(smoke_Multi_BehaviorTests, + OVInferRequestPerfCountersExceptionTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), ov::test::utils::appendPlatformTypeTestName); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/properties_tests.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/properties_tests.cpp index a3f2d5582cc64a..72ad5bbef2d941 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/properties_tests.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/properties_tests.cpp @@ -3,18 +3,19 @@ // #include "behavior/ov_infer_request/properties_tests.hpp" -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" -#include "npu_private_properties.hpp" +#include "common/utils.hpp" +#include "intel_npu/npu_private_properties.hpp" using namespace ov::test::behavior; namespace { -INSTANTIATE_TEST_SUITE_P( - compatibility_smoke_BehaviorTests, InferRequestPropertiesTest, - ::testing::Combine(::testing::Values(2u), ::testing::Values(ov::test::utils::DEVICE_NPU), - ::testing::ValuesIn(std::vector{ - {}})), - ov::test::utils::appendPlatformTypeTestName); +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + InferRequestPropertiesTest, + ::testing::Combine(::testing::Values(2u), + ::testing::Values(ov::test::utils::DEVICE_NPU), + ::testing::ValuesIn(std::vector{{}})), + ov::test::utils::appendPlatformTypeTestName); } // namespace diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/wait.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/wait.cpp index 6b0b26df27c1ee..59c808f4412608 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/wait.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/wait.cpp @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "behavior/ov_infer_request/wait.hpp" + #include -#include "behavior/ov_infer_request/wait.hpp" -#include "common/utils.hpp" #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; @@ -15,24 +16,25 @@ namespace { const std::vector configs = {{}}; const std::vector multiConfigs = { - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; + {ov::device::priorities(ov::test::utils::DEVICE_NPU), ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; const std::vector autoConfigs = { - {ov::device::priorities(ov::test::utils::DEVICE_NPU), - ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; + {ov::device::priorities(ov::test::utils::DEVICE_NPU), ov::device::properties(ov::test::utils::DEVICE_NPU, {})}}; -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVInferRequestWaitTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVInferRequestWaitTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, OVInferRequestWaitTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Multi_BehaviorTests, + OVInferRequestWaitTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, OVInferRequestWaitTests, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_Auto_BehaviorTests, + OVInferRequestWaitTests, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_AUTO), ::testing::ValuesIn(autoConfigs)), ov::test::utils::appendPlatformTypeTestName); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp index eee46865560dbc..b89c3cf1d2c32f 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp @@ -3,22 +3,24 @@ // #include "behavior/ov_plugin/caching_tests.hpp" + #include -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" using namespace ov::test::behavior; namespace { static const std::vector nightly_precisionsNPU = { - ov::element::f32, - // ov::element::f16, - // ov::element::u8, + ov::element::f32, + // ov::element::f16, + // ov::element::u8, }; static const std::vector smoke_precisionsNPU = { - ov::element::f32, + ov::element::f32, }; static const std::vector batchSizesNPU = {1}; @@ -35,9 +37,12 @@ static std::vector NPU_functions() { auto funcs = CompileModelCacheTestBase::getStandardFunctions(); std::vector::iterator it = remove_if(funcs.begin(), funcs.end(), [](ovModelWithName func) { - std::vector bad_layers{"ReadConcatSplitAssign", "SimpleFunctionRelu", - "2InputSubtract", "MatMulBias", - "TIwithLSTMcell1", "KSOFunction"}; + std::vector bad_layers{"ReadConcatSplitAssign", + "SimpleFunctionRelu", + "2InputSubtract", + "MatMulBias", + "TIwithLSTMcell1", + "KSOFunction"}; return std::find(bad_layers.begin(), bad_layers.end(), std::get<1>(func)) != bad_layers.end(); }); @@ -46,7 +51,8 @@ static std::vector NPU_functions() { return funcs; } -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CachingSupportCase_NPU, CompileModelCacheTestBase, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CachingSupportCase_NPU, + CompileModelCacheTestBase, ::testing::Combine(::testing::ValuesIn(smoke_functions()), ::testing::ValuesIn(smoke_precisionsNPU), ::testing::ValuesIn(batchSizesNPU), @@ -54,7 +60,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CachingSupportCase_NPU, CompileMode ::testing::Values(ov::AnyMap{})), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(nightly_BehaviorTests_CachingSupportCase_NPU, CompileModelCacheTestBase, +INSTANTIATE_TEST_SUITE_P(nightly_BehaviorTests_CachingSupportCase_NPU, + CompileModelCacheTestBase, ::testing::Combine(::testing::ValuesIn(NPU_functions()), ::testing::ValuesIn(nightly_precisionsNPU), ::testing::ValuesIn(batchSizesNPU), @@ -70,15 +77,15 @@ static std::string getTestCaseName(testing::TestParamInfo LoadFromFileConfigs = { - {ov::device::properties(ov::test::utils::DEVICE_NPU, {}), - ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}, - {ov::device::properties(ov::test::utils::DEVICE_NPU, {}), - ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}}; + {ov::device::properties(ov::test::utils::DEVICE_NPU, {}), + ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}, + {ov::device::properties(ov::test::utils::DEVICE_NPU, {}), + ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}}; const std::vector TestTargets = { - ov::test::utils::DEVICE_AUTO, - ov::test::utils::DEVICE_MULTI, - ov::test::utils::DEVICE_BATCH, + ov::test::utils::DEVICE_AUTO, + ov::test::utils::DEVICE_MULTI, + ov::test::utils::DEVICE_BATCH, }; INSTANTIATE_TEST_SUITE_P(DISABLED_smoke_Auto_BehaviorTests_CachingSupportCase_NPU, @@ -87,39 +94,39 @@ INSTANTIATE_TEST_SUITE_P(DISABLED_smoke_Auto_BehaviorTests_CachingSupportCase_NP getTestCaseName); const std::vector NPULoadFromFileConfigs = { - {ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}, - {ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)} -}; + {ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}, + {ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}}; const std::vector> NPUCompiledKernelsCacheTest = { - std::make_pair( - {ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT), - ov::intel_npu::use_elf_compiler_backend(ov::intel_npu::ElfCompilerBackend::NO)}, - "blob"), - std::make_pair( - {ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY), - ov::intel_npu::use_elf_compiler_backend(ov::intel_npu::ElfCompilerBackend::NO)}, - "blob"), - std::make_pair( - {ov::intel_npu::use_elf_compiler_backend(ov::intel_npu::ElfCompilerBackend::NO)}, - "blob"), - std::make_pair({ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}, - "blob"), - std::make_pair({ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}, - "blob") -}; - -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CachingSupportCase_NPU, CompileModelLoadFromFileTestBase, + std::make_pair( + {ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT), + ov::intel_npu::use_elf_compiler_backend(ov::intel_npu::ElfCompilerBackend::NO)}, + "blob"), + std::make_pair( + {ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY), + ov::intel_npu::use_elf_compiler_backend(ov::intel_npu::ElfCompilerBackend::NO)}, + "blob"), + std::make_pair( + {ov::intel_npu::use_elf_compiler_backend(ov::intel_npu::ElfCompilerBackend::NO)}, + "blob"), + std::make_pair({ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}, + "blob"), + std::make_pair({ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}, "blob")}; + +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CachingSupportCase_NPU, + CompileModelLoadFromFileTestBase, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(NPULoadFromFileConfigs)), getTestCaseName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CachingSupportCase_NPU, CompileModelLoadFromMemoryTestBase, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CachingSupportCase_NPU, + CompileModelLoadFromMemoryTestBase, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(NPULoadFromFileConfigs)), ov::test::utils::appendPlatformTypeTestName); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CachingSupportCase_NPU, CompiledKernelsCacheTest, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CachingSupportCase_NPU, + CompiledKernelsCacheTest, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(NPUCompiledKernelsCacheTest)), ov::test::utils::appendPlatformTypeTestName); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_integration.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_integration.cpp index 79af0f8b875c76..654de366ac3817 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_integration.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_integration.cpp @@ -6,10 +6,9 @@ #include "common/npu_test_env_cfg.hpp" #include "common/utils.hpp" #include "common_test_utils/data_utils.hpp" -#include "intel_npu/al/config/common.hpp" +#include "intel_npu/config/common.hpp" #include "openvino/runtime/intel_npu/properties.hpp" - using namespace ov::test::behavior; namespace { diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_threading_tests.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_threading_tests.cpp index c72baae502da07..1452f4ae446526 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_threading_tests.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_threading_tests.cpp @@ -3,44 +3,50 @@ // #include + #include "behavior/ov_plugin/core_threading.hpp" -#include "common/utils.hpp" #include "common/npu_test_env_cfg.hpp" -#include "npu_private_properties.hpp" +#include "common/utils.hpp" +#include "intel_npu/npu_private_properties.hpp" namespace { const Params params[] = { - std::tuple{ov::test::utils::DEVICE_NPU, {{ov::enable_profiling(true)}}}, - std::tuple{ - ov::test::utils::DEVICE_HETERO, - {{ov::device::priorities(ov::test::utils::DEVICE_NPU, ov::test::utils::DEVICE_CPU)}}}, + std::tuple{ov::test::utils::DEVICE_NPU, {{ov::enable_profiling(true)}}}, + std::tuple{ov::test::utils::DEVICE_HETERO, + {{ov::device::priorities(ov::test::utils::DEVICE_NPU, ov::test::utils::DEVICE_CPU)}}}, }; const Params paramsStreams[] = { - std::tuple{ov::test::utils::DEVICE_NPU, {{ov::num_streams(ov::streams::AUTO)}}}, + std::tuple{ov::test::utils::DEVICE_NPU, {{ov::num_streams(ov::streams::AUTO)}}}, }; const Params paramsStreamsDRIVER[] = { - std::tuple{ov::test::utils::DEVICE_NPU, - {{ov::num_streams(ov::streams::AUTO), - ov::intel_npu::compiler_type(ov::intel_npu::CompilerType::DRIVER)}}}, + std::tuple{ + ov::test::utils::DEVICE_NPU, + {{ov::num_streams(ov::streams::AUTO), ov::intel_npu::compiler_type(ov::intel_npu::CompilerType::DRIVER)}}}, }; } // namespace -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests_CoreThreadingTest_NPU, CoreThreadingTest, testing::ValuesIn(params), +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests_CoreThreadingTest_NPU, + CoreThreadingTest, + testing::ValuesIn(params), (ov::test::utils::appendPlatformTypeTestName)); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CoreThreadingTest_NPU, CoreThreadingTestsWithIter, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CoreThreadingTest_NPU, + CoreThreadingTestsWithIter, testing::Combine(testing::ValuesIn(params), testing::Values(4), testing::Values(50)), (ov::test::utils::appendPlatformTypeTestName)); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CoreThreadingTest_Streams_NPU, CoreThreadingTestsWithCacheEnabled, - testing::Combine(testing::ValuesIn(paramsStreamsDRIVER), testing::Values(20), +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CoreThreadingTest_Streams_NPU, + CoreThreadingTestsWithCacheEnabled, + testing::Combine(testing::ValuesIn(paramsStreamsDRIVER), + testing::Values(20), testing::Values(10)), (ov::test::utils::appendPlatformTypeTestName)); -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CoreThreadingTest_Streams_NPU, CoreThreadingTestsWithIter, +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CoreThreadingTest_Streams_NPU, + CoreThreadingTestsWithIter, testing::Combine(testing::ValuesIn(paramsStreams), testing::Values(4), testing::Values(50)), (ov::test::utils::appendPlatformTypeTestName)); diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/life_time.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/life_time.cpp index b9048470f039c3..3c95a7d21d0388 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/life_time.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/life_time.cpp @@ -3,9 +3,10 @@ // #include "behavior/ov_plugin/life_time.hpp" -#include "common/utils.hpp" + #include "common/npu_test_env_cfg.hpp" -#include "intel_npu/al/config/common.hpp" +#include "common/utils.hpp" +#include "intel_npu/config/common.hpp" #include "overload/ov_plugin/life_time.hpp" using namespace ov::test::behavior; @@ -22,27 +23,34 @@ static std::string getTestCaseName(testing::TestParamInfo obj) { const std::vector configs = {{}}; const std::vector device_names_and_priorities = { - "MULTI:NPU", // NPU via MULTI, - "AUTO:NPU", // NPU via AUTO, + "MULTI:NPU", // NPU via MULTI, + "AUTO:NPU", // NPU via AUTO, }; -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVHoldersTest, ::testing::Values(ov::test::utils::DEVICE_NPU), +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVHoldersTest, + ::testing::Values(ov::test::utils::DEVICE_NPU), getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVHoldersTestOnImportedNetwork, - ::testing::Values(ov::test::utils::DEVICE_NPU), getTestCaseName); +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVHoldersTestOnImportedNetwork, + ::testing::Values(ov::test::utils::DEVICE_NPU), + getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVHoldersTestNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVHoldersTestNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), OVHoldersTestNPU::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, OVHoldersTestOnImportedNetworkNPU, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests, + OVHoldersTestOnImportedNetworkNPU, ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(configs)), OVHoldersTestOnImportedNetworkNPU::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(compatibility_smoke_VirtualPlugin_BehaviorTests, OVHoldersTestWithConfig, +INSTANTIATE_TEST_SUITE_P(compatibility_smoke_VirtualPlugin_BehaviorTests, + OVHoldersTestWithConfig, ::testing::ValuesIn(device_names_and_priorities), (ov::test::utils::appendPlatformTypeTestName)); } // namespace diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp index d43011ac362d9e..94ec3659e74fd2 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp @@ -8,8 +8,8 @@ #include "common/npu_test_env_cfg.hpp" #include "common/utils.hpp" -#include "intel_npu/al/config/common.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/config/common.hpp" +#include "intel_npu/npu_private_properties.hpp" #include "openvino/runtime/intel_cpu/properties.hpp" #include "openvino/runtime/intel_gpu/properties.hpp" #include "openvino/runtime/intel_npu/properties.hpp" diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/skip_tests_config.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/skip_tests_config.cpp index 88cd71386b3fa1..c362b4ee92c1aa 100644 --- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/skip_tests_config.cpp +++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/skip_tests_config.cpp @@ -14,7 +14,7 @@ #include "common/utils.hpp" #include "common_test_utils/common_utils.hpp" #include "functional_test_utils/ov_plugin_cache.hpp" -#include "npu_private_properties.hpp" +#include "intel_npu/npu_private_properties.hpp" class BackendName { public: diff --git a/src/plugins/intel_npu/tests/unit/CMakeLists.txt b/src/plugins/intel_npu/tests/unit/CMakeLists.txt index 861a0ff6a47076..f4e8a64ecea92b 100644 --- a/src/plugins/intel_npu/tests/unit/CMakeLists.txt +++ b/src/plugins/intel_npu/tests/unit/CMakeLists.txt @@ -10,6 +10,7 @@ set(MANDATORY_UNIT_TESTS_LIBS "openvino::gtest" "openvino::gtest_main" "openvino::runtime" + "openvino::npu_common" "openvino::npu_al" "openvino::npu_logger_utils" ) diff --git a/src/plugins/intel_npu/tests/unit/npuw/online_partitioning.cpp b/src/plugins/intel_npu/tests/unit/npuw/online_partitioning.cpp index af1fc5de8e92c7..99f372694fe3dc 100644 --- a/src/plugins/intel_npu/tests/unit/npuw/online_partitioning.cpp +++ b/src/plugins/intel_npu/tests/unit/npuw/online_partitioning.cpp @@ -3,18 +3,17 @@ // #include -#include -#include "partitioning/online/compiler.hpp" -#include "partitioning/online/snapshot.hpp" -#include "partitioning/online/group.hpp" - -#include "intel_npu/al/config/config.hpp" -#include "intel_npu/al/config/npuw.hpp" +#include -#include "openvino/openvino.hpp" +#include "intel_npu/config/config.hpp" +#include "intel_npu/config/npuw.hpp" #include "openvino/op/ops.hpp" #include "openvino/op/util/op_types.hpp" +#include "openvino/openvino.hpp" +#include "partitioning/online/compiler.hpp" +#include "partitioning/online/group.hpp" +#include "partitioning/online/snapshot.hpp" bool isEqualEns(ov::npuw::Ensemble& ens1, ov::npuw::Ensemble& ens2); bool isEqualEns(ov::npuw::Ensemble& ens1, ov::npuw::Ensemble& ens2) { @@ -34,24 +33,20 @@ bool isEqualEns(ov::npuw::Ensemble& ens1, ov::npuw::Ensemble& ens2) { std::sort(g.all_layers.begin(), g.all_layers.end()); } - std::sort(ens1.groups.begin(), ens1.groups.end(), [](const ov::npuw::Group& g1, - const ov::npuw::Group& g2){ - return g1.all_layers.front() < g2.all_layers.front(); - }); + std::sort(ens1.groups.begin(), ens1.groups.end(), [](const ov::npuw::Group& g1, const ov::npuw::Group& g2) { + return g1.all_layers.front() < g2.all_layers.front(); + }); - std::sort(ens2.groups.begin(), ens2.groups.end(), [](const ov::npuw::Group& g1, - const ov::npuw::Group& g2){ - return g1.all_layers.front() < g2.all_layers.front(); - }); + std::sort(ens2.groups.begin(), ens2.groups.end(), [](const ov::npuw::Group& g1, const ov::npuw::Group& g2) { + return g1.all_layers.front() < g2.all_layers.front(); + }); for (size_t i = 0; i < ens1.groups.size(); ++i) { const auto& g1 = ens1.groups.at(i); const auto& g2 = ens2.groups.at(i); - if (g1.avoid_list != g2.avoid_list || - g1.input_layers != g2.input_layers || - g1.output_layers != g2.output_layers || - g1.all_layers != g2.all_layers) { + if (g1.avoid_list != g2.avoid_list || g1.input_layers != g2.input_layers || + g1.output_layers != g2.output_layers || g1.all_layers != g2.all_layers) { return false; } @@ -74,17 +69,18 @@ bool isEqualEns(ov::npuw::Ensemble& ens1, ov::npuw::Ensemble& ens2) { }); for (auto& g : sorted_rep) { - std::sort(g.begin(), g.end(), - [](const auto& a, const auto& b) {return *a.begin() < *b.begin();}); + std::sort(g.begin(), g.end(), [](const auto& a, const auto& b) { + return *a.begin() < *b.begin(); + }); } - std::sort(sorted_rep.begin(), sorted_rep.end(), - [](const auto& a, const auto& b) {return *a.front().begin() < *b.front().begin();}); + std::sort(sorted_rep.begin(), sorted_rep.end(), [](const auto& a, const auto& b) { + return *a.front().begin() < *b.front().begin(); + }); return sorted_rep; }; - if (get_sorted_rep(ens1.repeated) != get_sorted_rep(ens2.repeated)) { return false; } @@ -97,7 +93,8 @@ class ModelGenerator { ModelGenerator() = default; std::shared_ptr get_model_without_repeated_blocks() { - std::shared_ptr input = std::make_shared(ov::element::i32, ov::Shape{1, 1, 40}); + std::shared_ptr input = + std::make_shared(ov::element::i32, ov::Shape{1, 1, 40}); m_nodes.push_back(input); set_name(input); @@ -115,7 +112,8 @@ class ModelGenerator { std::shared_ptr get_model_with_repeated_blocks() { // Generate head - std::shared_ptr input = std::make_shared(ov::element::i32, ov::Shape{1, 1, 40}); + std::shared_ptr input = + std::make_shared(ov::element::i32, ov::Shape{1, 1, 40}); m_nodes.push_back(input); set_name(input); @@ -174,24 +172,32 @@ class ModelGenerator { // Constants std::vector> model_c(18, nullptr); - model_c[0] = std::make_shared(ov::element::i32, ov::Shape{4}, std::vector{0, 2, 1, 3}); + model_c[0] = + std::make_shared(ov::element::i32, ov::Shape{4}, std::vector{0, 2, 1, 3}); model_c[1] = std::make_shared(ov::element::i64, ov::Shape{1}, std::vector{1}); model_c[2] = std::make_shared(ov::element::i64, ov::Shape{1}, std::vector{0}); model_c[3] = std::make_shared(ov::element::i64, ov::Shape{1}, std::vector{2}); model_c[4] = std::make_shared(ov::element::i64, ov::Shape{1}, std::vector{0}); - model_c[5] = std::make_shared(ov::element::i64, ov::Shape{4}, std::vector{1, 1, 1, 1}); + model_c[5] = + std::make_shared(ov::element::i64, ov::Shape{4}, std::vector{1, 1, 1, 1}); model_c[6] = std::make_shared(ov::element::i64, ov::Shape{1}, std::vector{1}); model_c[7] = std::make_shared(ov::element::i64, ov::Shape{1}, std::vector{0}); - model_c[8] = std::make_shared(ov::element::i64, ov::Shape{4}, std::vector{1, 1, 1, 1}); - model_c[9] = std::make_shared(ov::element::i32, ov::Shape{4}, std::vector{1, 1, 1, 2}); - model_c[10] = std::make_shared(ov::element::i32, ov::Shape{4}, std::vector{1, 1, 1, 1}); - model_c[11] = std::make_shared(ov::element::i32, ov::Shape{4}, std::vector{1, 1, 1, 2}); + model_c[8] = + std::make_shared(ov::element::i64, ov::Shape{4}, std::vector{1, 1, 1, 1}); + model_c[9] = + std::make_shared(ov::element::i32, ov::Shape{4}, std::vector{1, 1, 1, 2}); + model_c[10] = + std::make_shared(ov::element::i32, ov::Shape{4}, std::vector{1, 1, 1, 1}); + model_c[11] = + std::make_shared(ov::element::i32, ov::Shape{4}, std::vector{1, 1, 1, 2}); model_c[12] = std::make_shared(ov::element::i32, ov::Shape{1, 1, 1, 1}); model_c[13] = std::make_shared(ov::element::i32, ov::Shape{1, 1, 1, 1}); model_c[14] = std::make_shared(ov::element::i32, ov::Shape{1, 1, 1, 1}); model_c[15] = std::make_shared(ov::element::f32, ov::Shape{40, 40}); - model_c[16] = std::make_shared(ov::element::i64, ov::Shape{4}, std::vector{1, 1, 4, 10}); - model_c[17] = std::make_shared(ov::element::i32, ov::Shape{3}, std::vector{1, 1, 40}); + model_c[16] = + std::make_shared(ov::element::i64, ov::Shape{4}, std::vector{1, 1, 4, 10}); + model_c[17] = + std::make_shared(ov::element::i32, ov::Shape{3}, std::vector{1, 1, 40}); for (const auto& c : model_c) { m_nodes.push_back(c); @@ -220,17 +226,17 @@ class ModelGenerator { op[6] = std::make_shared(op[5]); op[7] = std::make_shared(model_c[5], model_c[6], op[6], model_c[7]); op[8] = std::make_shared(op[2], - model_c[8], - op[7], - model_c[9], - std::vector{1, 1, 1, 1}, - std::vector{1, 1, 1, 1}); + model_c[8], + op[7], + model_c[9], + std::vector{1, 1, 1, 1}, + std::vector{1, 1, 1, 1}); op[9] = std::make_shared(op[2], - op[7], - model_c[10], - model_c[11], - std::vector{1, 1, 1, 1}, - std::vector{1, 1, 1, 1}); + op[7], + model_c[10], + model_c[11], + std::vector{1, 1, 1, 1}, + std::vector{1, 1, 1, 1}); op[10] = std::make_shared(op[9], convert[2]); op[11] = std::make_shared(std::vector>{op[10], op[8]}, -1); op[12] = std::make_shared(model_c[13], op[11]); @@ -262,7 +268,7 @@ TEST(OnlinePartitioningTest, Partitioning_IsTheSame_SmallModel) { auto opt_desc = std::make_shared<::intel_npu::OptionsDesc>(); auto cfg = ::intel_npu::Config(opt_desc); ::intel_npu::registerNPUWOptions(*opt_desc); - std::map cfg_map = {{ "NPUW_ONLINE_KEEP_BLOCK_SIZE", "9" }}; + std::map cfg_map = {{"NPUW_ONLINE_KEEP_BLOCK_SIZE", "9"}}; cfg.update(cfg_map); auto ens = ov::npuw::online::buildPartitioning(model, cfg); @@ -280,7 +286,7 @@ TEST(OnlinePartitioningTest, Partitioning_IsTheSame_RepeatedModel) { auto opt_desc = std::make_shared<::intel_npu::OptionsDesc>(); auto cfg = ::intel_npu::Config(opt_desc); ::intel_npu::registerNPUWOptions(*opt_desc); - std::map cfg_map = {{ "NPUW_ONLINE_KEEP_BLOCK_SIZE", "9" }}; + std::map cfg_map = {{"NPUW_ONLINE_KEEP_BLOCK_SIZE", "9"}}; cfg.update(cfg_map); auto ens = ov::npuw::online::buildPartitioning(model, cfg); @@ -343,7 +349,8 @@ TEST(OnlinePartitioningTest, Partitioning_earlyAvoids_SmallModel) { auto snap = std::make_shared(model); ov::npuw::online::PassContext ctx; - ctx.avoids = {{ov::npuw::online::PatternType::OP, "Gather", "mydevice"}, {ov::npuw::online::PatternType::OP, "MatMul", "mydevice"}}; + ctx.avoids = {{ov::npuw::online::PatternType::OP, "Gather", "mydevice"}, + {ov::npuw::online::PatternType::OP, "MatMul", "mydevice"}}; snap->setCtx(ctx); snap->buildGraph(); snap->earlyAvoids(); @@ -365,7 +372,8 @@ TEST(OnlinePartitioningTest, Partitioning_earlyAvoids_RepeatedModel) { auto snap = std::make_shared(model); ov::npuw::online::PassContext ctx; - ctx.avoids = {{ov::npuw::online::PatternType::OP, "Gather", "mydevice"}, {ov::npuw::online::PatternType::OP, "MatMul", "mydevice"}}; + ctx.avoids = {{ov::npuw::online::PatternType::OP, "Gather", "mydevice"}, + {ov::npuw::online::PatternType::OP, "MatMul", "mydevice"}}; snap->setCtx(ctx); snap->buildGraph(); snap->earlyAvoids(); @@ -391,7 +399,7 @@ TEST(OnlinePartitioningTest, Partitioning_collectLHF_SmallModel) { std::vector sizes = {10, 10}; size_t iter = 0; - snap->repeat([&]{ + snap->repeat([&] { snap->collectLHF(); EXPECT_LT(iter, sizes.size()); EXPECT_EQ(snap->graphSize(), sizes[iter++]); @@ -408,7 +416,7 @@ TEST(OnlinePartitioningTest, Partitioning_collectLHF_RepeatedModel) { std::vector sizes = {82, 82}; size_t iter = 0; - snap->repeat([&]{ + snap->repeat([&] { snap->collectLHF(); EXPECT_LT(iter, sizes.size()); EXPECT_EQ(snap->graphSize(), sizes[iter++]); @@ -425,7 +433,7 @@ TEST(OnlinePartitioningTest, Partitioning_fuseRemnants_SmallModel) { std::vector sizes = {10, 10}; size_t iter = 0; - snap->repeat([&]{ + snap->repeat([&] { snap->fuseRemnants(); EXPECT_LT(iter, sizes.size()); EXPECT_EQ(snap->graphSize(), sizes[iter++]); @@ -442,7 +450,7 @@ TEST(OnlinePartitioningTest, Partitioning_fuseRemnants_RepeatedModel) { std::vector sizes = {75, 38, 19, 10}; size_t iter = 0; - snap->repeat([&]{ + snap->repeat([&] { snap->fuseRemnants(); EXPECT_LT(iter, sizes.size()); EXPECT_EQ(snap->graphSize(), sizes[iter++]); @@ -459,7 +467,7 @@ TEST(OnlinePartitioningTest, Partitioning_fuseRemnantsExtended_SmallModel) { std::vector sizes = {10, 10}; size_t iter = 0; - snap->repeat([&]{ + snap->repeat([&] { snap->fuseRemnantsExtended(); EXPECT_LT(iter, sizes.size()); EXPECT_EQ(snap->graphSize(), sizes[iter++]); @@ -476,7 +484,7 @@ TEST(OnlinePartitioningTest, Partitioning_fuseRemnantsExtended_RepeatedModel) { std::vector sizes = {10, 10}; size_t iter = 0; - snap->repeat([&]{ + snap->repeat([&] { snap->fuseRemnantsExtended(); EXPECT_LT(iter, sizes.size()); EXPECT_EQ(snap->graphSize(), sizes[iter++]); @@ -493,7 +501,7 @@ TEST(OnlinePartitioningTest, Partitioning_fuseInputs_SmallModel) { std::vector sizes = {15, 14, 14}; size_t iter = 0; - snap->repeat([&]{ + snap->repeat([&] { snap->fuseInputs(); EXPECT_LT(iter, sizes.size()); EXPECT_EQ(snap->graphSize(), sizes[iter++]); @@ -510,7 +518,7 @@ TEST(OnlinePartitioningTest, Partitioning_fuseInputs_RepeatedModel) { std::vector sizes = {148, 138, 138}; size_t iter = 0; - snap->repeat([&]{ + snap->repeat([&] { snap->fuseInputs(); EXPECT_LT(iter, sizes.size()); EXPECT_EQ(snap->graphSize(), sizes[iter++]); @@ -574,7 +582,6 @@ TEST(OnlinePartitioningTest, Partitioning_Compiler_RepeatedBlocks_SmallModel) { auto snap = std::make_shared(model); snap->buildGraph(); - std::vector sizes_fr = {10, 10}; size_t iter_fr = 0; @@ -600,7 +607,6 @@ TEST(OnlinePartitioningTest, Partitioning_Compiler_RepeatedBlocks_RepeatedModel) auto snap = std::make_shared(model); snap->buildGraph(); - std::vector sizes_fr = {12, 12}; size_t iter_fr = 0; @@ -636,7 +642,8 @@ TEST(OnlinePartitioningTest, Partitioning_Compiler_Compute_SmallModel) { size_t iter_fr = 0; ov::npuw::online::PassContext ctx; - ctx.isolates = {{ov::npuw::online::PatternType::OP, "Transpose", "test_compute"}, {ov::npuw::online::PatternType::OP, "ScatterUpdate", "test_compute"}}; + ctx.isolates = {{ov::npuw::online::PatternType::OP, "Transpose", "test_compute"}, + {ov::npuw::online::PatternType::OP, "ScatterUpdate", "test_compute"}}; ctx.nofolds = {"test_compute"}; snap->setCtx(ctx); diff --git a/src/plugins/intel_npu/tools/compile_tool/README.md b/src/plugins/intel_npu/tools/compile_tool/README.md index daebe97b40620c..65b30eec8aef50 100644 --- a/src/plugins/intel_npu/tools/compile_tool/README.md +++ b/src/plugins/intel_npu/tools/compile_tool/README.md @@ -95,7 +95,7 @@ For example, to compile a blob for inference on Intel® Core™ Ultra NPU, run t ./compile_tool -m /model_name.xml -d NPU.3720 ``` -You can pass a config file via `-c` option which allow you to specify some public or private properties. More details in [Supported Properties](https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/intel_npu#supported-properties) and in [configs](https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/intel_npu/src/al/include/intel_npu/al/config). For example, to use a custom build of NPU Compiler instaed of the release Compiler distributed within NPU driver, create a config file with the following content: +You can pass a config file via `-c` option which allow you to specify some public or private properties. More details in [Supported Properties](https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/intel_npu#supported-properties) and in [configs](https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/intel_npu/src/al/include/intel_npu/config). For example, to use a custom build of NPU Compiler instaed of the release Compiler distributed within NPU driver, create a config file with the following content: ``` NPU_COMPILER_TYPE MLIR ```