diff --git a/src/plugins/auto/tests/unit/CMakeLists.txt b/src/plugins/auto/tests/unit/CMakeLists.txt index 895929c0e41975..c4a0750762c88e 100644 --- a/src/plugins/auto/tests/unit/CMakeLists.txt +++ b/src/plugins/auto/tests/unit/CMakeLists.txt @@ -18,13 +18,11 @@ ov_add_test_target( ${CMAKE_CURRENT_SOURCE_DIR} ${OpenVINO_SOURCE_DIR}/src/plugins/auto/src LINK_LIBRARIES - ov_models unit_test_utils ADD_CPPLINT DEPENDENCIES openvino_template_extension mock_engine - ov_models LABELS OV UNIT MULTI AUTO ) diff --git a/src/plugins/auto_batch/tests/unit/CMakeLists.txt b/src/plugins/auto_batch/tests/unit/CMakeLists.txt index 3b1c1285c84177..f525dc1a81e9d6 100644 --- a/src/plugins/auto_batch/tests/unit/CMakeLists.txt +++ b/src/plugins/auto_batch/tests/unit/CMakeLists.txt @@ -22,10 +22,8 @@ ov_add_test_target( ${SHARED_HEADERS_DIR} LINK_LIBRARIES unit_test_utils - ov_models DEPENDENCIES mock_engine - ov_models ADD_CPPLINT LABELS OV UNIT AUTO_BATCH diff --git a/src/plugins/hetero/tests/unit/CMakeLists.txt b/src/plugins/hetero/tests/unit/CMakeLists.txt index ad2d38e156b5a9..91b4284c8e96ef 100644 --- a/src/plugins/hetero/tests/unit/CMakeLists.txt +++ b/src/plugins/hetero/tests/unit/CMakeLists.txt @@ -21,7 +21,6 @@ ov_add_test_target( ${OBJ_LIB} LINK_LIBRARIES unit_test_utils - ov_models DEPENDENCIES mock_engine ADD_CLANG_FORMAT diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/denormal_check.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/denormal_check.cpp index ec55b7f69c439a..95d7ea6d1ce63e 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/denormal_check.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/denormal_check.cpp @@ -4,7 +4,7 @@ #include "shared_test_classes/base/layer_test_utils.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" -#include "ov_models/utils/data_utils.hpp" +#include "common_test_utils/data_utils.hpp" #include "openvino/runtime/aligned_buffer.hpp" namespace ov { diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fuse_transpose_reorder.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fuse_transpose_reorder.cpp index e13d8783b10d23..21e8acd25572db 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fuse_transpose_reorder.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fuse_transpose_reorder.cpp @@ -5,7 +5,7 @@ #include "custom/subgraph_tests/include/fuse_transpose_reorder.hpp" #include "common_test_utils/node_builders/constant.hpp" #include "common_test_utils/node_builders/convolution.hpp" -#include "ov_models/preprocess/preprocess_builders.hpp" +#include "common_test_utils/subgraph_builders/preprocess_builders.hpp" #include "openvino/openvino.hpp" using namespace CPUTestUtils; diff --git a/src/plugins/intel_cpu/tests/functional/utils/fusing_test_utils.hpp b/src/plugins/intel_cpu/tests/functional/utils/fusing_test_utils.hpp index 849652eb7a6c2f..78d78462d813ec 100644 --- a/src/plugins/intel_cpu/tests/functional/utils/fusing_test_utils.hpp +++ b/src/plugins/intel_cpu/tests/functional/utils/fusing_test_utils.hpp @@ -9,7 +9,7 @@ #include "common_test_utils/node_builders/fake_quantize.hpp" #include "cpu_test_utils.hpp" #include "openvino/runtime/system_conf.hpp" -#include "ov_models/utils/data_utils.hpp" +#include "common_test_utils/data_utils.hpp" using namespace ov::test; diff --git a/src/plugins/intel_cpu/tests/unit/CMakeLists.txt b/src/plugins/intel_cpu/tests/unit/CMakeLists.txt index 2310d6b2313366..ac55e2730502da 100644 --- a/src/plugins/intel_cpu/tests/unit/CMakeLists.txt +++ b/src/plugins/intel_cpu/tests/unit/CMakeLists.txt @@ -57,7 +57,6 @@ ov_add_test_target( openvino::shape_inference openvino_runtime_s unit_test_utils - ov_models ov_snippets_models snippets_test_utils ${MLAS_LIBRARY} diff --git a/src/tests/functional/plugin/shared/CMakeLists.txt b/src/tests/functional/plugin/shared/CMakeLists.txt index d557f1a1a4836d..e0244707a98fec 100644 --- a/src/tests/functional/plugin/shared/CMakeLists.txt +++ b/src/tests/functional/plugin/shared/CMakeLists.txt @@ -62,7 +62,6 @@ ov_add_target( openvino::pugixml common_test_utils func_test_utils - ov_models ov_lpt_models sharedTestClasses PRIVATE diff --git a/src/tests/functional/shared_test_classes/CMakeLists.txt b/src/tests/functional/shared_test_classes/CMakeLists.txt index 0aa8d0f33592c1..d3f6074a86ae41 100644 --- a/src/tests/functional/shared_test_classes/CMakeLists.txt +++ b/src/tests/functional/shared_test_classes/CMakeLists.txt @@ -19,7 +19,6 @@ ov_add_target( LINK_LIBRARIES PRIVATE func_test_utils - ov_models ) ov_build_target_faster(${TARGET_NAME} diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/preprocess.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/preprocess.hpp index 7fa51534552259..a35d0374285949 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/preprocess.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/preprocess.hpp @@ -9,7 +9,7 @@ #include #include -#include "ov_models/preprocess/preprocess_builders.hpp" +#include "common_test_utils/subgraph_builders/preprocess_builders.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" namespace ov { diff --git a/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp b/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp index 7514ab753ab100..07773e75e08b7c 100644 --- a/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp +++ b/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp @@ -18,7 +18,7 @@ #include "shared_test_classes/base/ov_subgraph.hpp" #include "shared_test_classes/single_op/roi_align.hpp" -#include "ov_models/utils/data_utils.hpp" +#include "common_test_utils/data_utils.hpp" namespace ov { namespace test { diff --git a/src/tests/functional/shared_test_classes/src/subgraph/postprocess.cpp b/src/tests/functional/shared_test_classes/src/subgraph/postprocess.cpp index 072edac1071070..36377d55e822f3 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/postprocess.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/postprocess.cpp @@ -5,7 +5,7 @@ #include "shared_test_classes/subgraph/preprocess.hpp" #include "openvino/core/preprocess/pre_post_process.hpp" -#include "ov_models/preprocess/preprocess_builders.hpp" +#include "common_test_utils/subgraph_builders/preprocess_builders.hpp" using namespace ov; using namespace ov::preprocess; diff --git a/src/tests/functional/shared_test_classes/src/subgraph/preprocess.cpp b/src/tests/functional/shared_test_classes/src/subgraph/preprocess.cpp index df1b09d999b48e..e90602482ec51b 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/preprocess.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/preprocess.cpp @@ -5,7 +5,7 @@ #include "shared_test_classes/subgraph/preprocess.hpp" #include "openvino/core/preprocess/pre_post_process.hpp" -#include "ov_models/preprocess/preprocess_builders.hpp" +#include "common_test_utils/subgraph_builders/preprocess_builders.hpp" using namespace ov; using namespace ov::preprocess; diff --git a/src/tests/ov_helpers/CMakeLists.txt b/src/tests/ov_helpers/CMakeLists.txt index 871f457f63a7c3..baa49b1ce6abc5 100644 --- a/src/tests/ov_helpers/CMakeLists.txt +++ b/src/tests/ov_helpers/CMakeLists.txt @@ -2,7 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 # -add_subdirectory(ov_models) add_subdirectory(ov_lpt_models) if(TARGET openvino::snippets) diff --git a/src/tests/ov_helpers/ov_lpt_models/CMakeLists.txt b/src/tests/ov_helpers/ov_lpt_models/CMakeLists.txt index 7eda3438659f0d..7bfca614190964 100644 --- a/src/tests/ov_helpers/ov_lpt_models/CMakeLists.txt +++ b/src/tests/ov_helpers/ov_lpt_models/CMakeLists.txt @@ -17,8 +17,8 @@ ov_add_target( ${CMAKE_CURRENT_SOURCE_DIR}/src LINK_LIBRARIES PRIVATE - ov_models openvino::runtime::dev + common_test_utils ADD_CPPLINT ) diff --git a/src/tests/ov_helpers/ov_models/CMakeLists.txt b/src/tests/ov_helpers/ov_models/CMakeLists.txt deleted file mode 100644 index 69631bd82ba2a0..00000000000000 --- a/src/tests/ov_helpers/ov_models/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) 2018-2023 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# - -set(TARGET_NAME ov_models) - -set(PUBLIC_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") - -ov_add_target( - NAME ${TARGET_NAME} - TYPE STATIC - ROOT ${PUBLIC_HEADERS_DIR} - INCLUDES - PUBLIC - "$" - ADDITIONAL_SOURCE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/src - LINK_LIBRARIES - PUBLIC - openvino::runtime - openvino::reference - openvino::interpreter_backend - openvino::runtime::dev - common_test_utils - ADD_CLANG_FORMAT -) - -ov_build_target_faster(${TARGET_NAME} - UNITY - PCH PRIVATE "src/precomp.hpp" -) - -# install & export - -ov_developer_package_export_targets(TARGET ${TARGET_NAME} - INSTALL_INCLUDE_DIRECTORIES "${PUBLIC_HEADERS_DIR}/") diff --git a/src/tests/ov_helpers/ov_models/include/ov_models/utils/data_utils.hpp b/src/tests/ov_helpers/ov_models/include/ov_models/utils/data_utils.hpp deleted file mode 100644 index 8b0aee9cb6dfe1..00000000000000 --- a/src/tests/ov_helpers/ov_models/include/ov_models/utils/data_utils.hpp +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include -#include - -#include "openvino/core/type/element_type_traits.hpp" - -namespace NGraphFunctions { -namespace Utils { - -template -std::vector::value_type> inline generateVector( - size_t vec_len, - typename ov::element_type_traits::value_type upTo = 10, - typename ov::element_type_traits::value_type startFrom = 1, - int32_t seed = 1) { - using dataType = typename ov::element_type_traits::value_type; - std::vector res(vec_len); - - std::mt19937 gen(seed); - if (std::is_floating_point()) { - // chose values between this range to avoid type overrun (e.g. in case of I8 precision) - std::uniform_real_distribution dist(static_cast(startFrom), static_cast(upTo)); - // explicitly include data range borders to avoid missing the corner values while data generation - res[0] = startFrom; - res[vec_len - 1] = upTo; - for (size_t i = 1; i < vec_len - 1; i++) { - res[i] = static_cast(dist(gen)); - } - return res; - } else if (std::is_same()) { - std::bernoulli_distribution dist; - for (size_t i = 0; i < vec_len; i++) { - res[i] = static_cast(dist(gen)); - } - return res; - } else { - // chose values between this range to avoid type overrun (e.g. in case of I8 precision) - std::uniform_int_distribution dist(static_cast(startFrom), static_cast(upTo)); - // explicitly include data range borders to avoid missing the corner values while data generation - res[0] = startFrom; - res[vec_len - 1] = upTo; - for (size_t i = 1; i < vec_len - 1; i++) { - res[i] = static_cast(dist(gen)); - } - return res; - } -} - -template <> -std::vector inline generateVector(size_t vec_len, - ov::float16 upTo, - ov::float16 startFrom, - int32_t seed) { - std::vector res(vec_len); - std::mt19937 gen(seed); - // chose values between this range to avoid type overrun (e.g. in case of I8 precision) - std::uniform_real_distribution dist(startFrom, upTo); - // explicitly include data range borders to avoid missing the corner values while data generation - res[0] = startFrom; - res[vec_len - 1] = upTo; - for (size_t i = 1; i < vec_len - 1; i++) { - res[i] = ov::float16(dist(gen)); - } - return res; -} - -template <> -std::vector inline generateVector(size_t vec_len, - ov::bfloat16 upTo, - ov::bfloat16 startFrom, - int32_t seed) { - std::vector res(vec_len); - - std::mt19937 gen(seed); - // chose values between this range to avoid type overrun (e.g. in case of I8 precision) - std::uniform_real_distribution dist(startFrom, upTo); - ; - // explicitly include data range borders to avoid missing the corner values while data generation - res[0] = startFrom; - res[vec_len - 1] = upTo; - for (size_t i = 1; i < vec_len - 1; i++) { - res[i] = ov::bfloat16(dist(gen)); - } - return res; -} - -template -std::vector castVector(const std::vector& vec) { - std::vector resVec; - resVec.reserve(vec.size()); - for (const auto& el : vec) { - resVec.push_back(static_cast(el)); - } - return resVec; -} - -} // namespace Utils -} // namespace NGraphFunctions diff --git a/src/tests/test_utils/common_test_utils/CMakeLists.txt b/src/tests/test_utils/common_test_utils/CMakeLists.txt index 44ff4fd42edd88..7f82b329c0197c 100644 --- a/src/tests/test_utils/common_test_utils/CMakeLists.txt +++ b/src/tests/test_utils/common_test_utils/CMakeLists.txt @@ -30,7 +30,6 @@ function(add_common_utils ADD_TARGET_NAME) gtest gtest_main gmock - ov_models openvino::runtime openvino::runtime::dev PRIVATE diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp index 1c4a169e896033..4f75daad1dced8 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp @@ -14,6 +14,99 @@ #include "openvino/core/type/element_type_traits.hpp" #include "openvino/runtime/tensor.hpp" +namespace NGraphFunctions { +namespace Utils { + +template +std::vector::value_type> inline generateVector( + size_t vec_len, + typename ov::element_type_traits::value_type upTo = 10, + typename ov::element_type_traits::value_type startFrom = 1, + int32_t seed = 1) { + using dataType = typename ov::element_type_traits::value_type; + std::vector res(vec_len); + + std::mt19937 gen(seed); + if (std::is_floating_point()) { + // chose values between this range to avoid type overrun (e.g. in case of I8 precision) + std::uniform_real_distribution dist(static_cast(startFrom), static_cast(upTo)); + // explicitly include data range borders to avoid missing the corner values while data generation + res[0] = startFrom; + res[vec_len - 1] = upTo; + for (size_t i = 1; i < vec_len - 1; i++) { + res[i] = static_cast(dist(gen)); + } + return res; + } else if (std::is_same()) { + std::bernoulli_distribution dist; + for (size_t i = 0; i < vec_len; i++) { + res[i] = static_cast(dist(gen)); + } + return res; + } else { + // chose values between this range to avoid type overrun (e.g. in case of I8 precision) + std::uniform_int_distribution dist(static_cast(startFrom), static_cast(upTo)); + // explicitly include data range borders to avoid missing the corner values while data generation + res[0] = startFrom; + res[vec_len - 1] = upTo; + for (size_t i = 1; i < vec_len - 1; i++) { + res[i] = static_cast(dist(gen)); + } + return res; + } +} + +template <> +std::vector inline generateVector(size_t vec_len, + ov::float16 upTo, + ov::float16 startFrom, + int32_t seed) { + std::vector res(vec_len); + std::mt19937 gen(seed); + // chose values between this range to avoid type overrun (e.g. in case of I8 precision) + std::uniform_real_distribution dist(startFrom, upTo); + // explicitly include data range borders to avoid missing the corner values while data generation + res[0] = startFrom; + res[vec_len - 1] = upTo; + for (size_t i = 1; i < vec_len - 1; i++) { + res[i] = ov::float16(dist(gen)); + } + return res; +} + +template <> +std::vector inline generateVector(size_t vec_len, + ov::bfloat16 upTo, + ov::bfloat16 startFrom, + int32_t seed) { + std::vector res(vec_len); + + std::mt19937 gen(seed); + // chose values between this range to avoid type overrun (e.g. in case of I8 precision) + std::uniform_real_distribution dist(startFrom, upTo); + ; + // explicitly include data range borders to avoid missing the corner values while data generation + res[0] = startFrom; + res[vec_len - 1] = upTo; + for (size_t i = 1; i < vec_len - 1; i++) { + res[i] = ov::bfloat16(dist(gen)); + } + return res; +} + +template +std::vector castVector(const std::vector& vec) { + std::vector resVec; + resVec.reserve(vec.size()); + for (const auto& el : vec) { + resVec.push_back(static_cast(el)); + } + return resVec; +} + +} // namespace Utils +} // namespace NGraphFunctions + namespace ov { namespace test { namespace utils { diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/constant.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/constant.hpp index aab38ac365b046..c7cf1ad35e5c97 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/constant.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/constant.hpp @@ -3,10 +3,10 @@ // #pragma once +#include "common_test_utils/data_utils.hpp" #include "common_test_utils/ov_tensor_utils.hpp" #include "openvino/core/node.hpp" #include "openvino/op/constant.hpp" -#include "ov_models/utils/data_utils.hpp" namespace ov { namespace test { diff --git a/src/tests/ov_helpers/ov_models/include/ov_models/preprocess/preprocess_builders.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/preprocess_builders.hpp similarity index 100% rename from src/tests/ov_helpers/ov_models/include/ov_models/preprocess/preprocess_builders.hpp rename to src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/preprocess_builders.hpp diff --git a/src/tests/test_utils/common_test_utils/src/node_builders/fake_quantize.cpp b/src/tests/test_utils/common_test_utils/src/node_builders/fake_quantize.cpp index 17ab1065867972..48870dab00a624 100644 --- a/src/tests/test_utils/common_test_utils/src/node_builders/fake_quantize.cpp +++ b/src/tests/test_utils/common_test_utils/src/node_builders/fake_quantize.cpp @@ -4,10 +4,10 @@ #include "common_test_utils/node_builders/fake_quantize.hpp" +#include "common_test_utils/data_utils.hpp" #include "common_test_utils/node_builders/constant.hpp" #include "common_test_utils/node_builders/fake_quantize.hpp" #include "openvino/op/fake_quantize.hpp" -#include "ov_models/utils/data_utils.hpp" namespace ov { namespace test { diff --git a/src/tests/test_utils/functional_test_utils/CMakeLists.txt b/src/tests/test_utils/functional_test_utils/CMakeLists.txt index e1148d82ee1132..20de6f1ee3cee1 100644 --- a/src/tests/test_utils/functional_test_utils/CMakeLists.txt +++ b/src/tests/test_utils/functional_test_utils/CMakeLists.txt @@ -20,7 +20,6 @@ ov_add_target( openvino::runtime openvino::runtime::dev PRIVATE - ov_models openvino::pugixml )