Skip to content

Commit

Permalink
Delete ov_models target
Browse files Browse the repository at this point in the history
  • Loading branch information
vurusovs committed Feb 21, 2024
1 parent 746b8d9 commit 03a679b
Show file tree
Hide file tree
Showing 23 changed files with 103 additions and 161 deletions.
2 changes: 0 additions & 2 deletions src/plugins/auto/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/auto_batch/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/plugins/hetero/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ ov_add_test_target(
${OBJ_LIB}
LINK_LIBRARIES
unit_test_utils
ov_models
DEPENDENCIES
mock_engine
ADD_CLANG_FORMAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion src/plugins/intel_cpu/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 0 additions & 1 deletion src/tests/functional/plugin/shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ ov_add_target(
openvino::pugixml
common_test_utils
func_test_utils
ov_models
ov_lpt_models
sharedTestClasses
PRIVATE
Expand Down
1 change: 0 additions & 1 deletion src/tests/functional/shared_test_classes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ ov_add_target(
LINK_LIBRARIES
PRIVATE
func_test_utils
ov_models
)

ov_build_target_faster(${TARGET_NAME}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <tuple>
#include <vector>

#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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/tests/ov_helpers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# SPDX-License-Identifier: Apache-2.0
#

add_subdirectory(ov_models)
add_subdirectory(ov_lpt_models)

if(TARGET openvino::snippets)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ov_helpers/ov_lpt_models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
36 changes: 0 additions & 36 deletions src/tests/ov_helpers/ov_models/CMakeLists.txt

This file was deleted.

104 changes: 0 additions & 104 deletions src/tests/ov_helpers/ov_models/include/ov_models/utils/data_utils.hpp

This file was deleted.

1 change: 0 additions & 1 deletion src/tests/test_utils/common_test_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function(add_common_utils ADD_TARGET_NAME)
gtest
gtest_main
gmock
ov_models
openvino::runtime
openvino::runtime::dev
PRIVATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,99 @@
#include "openvino/core/type/element_type_traits.hpp"
#include "openvino/runtime/tensor.hpp"

namespace NGraphFunctions {
namespace Utils {

template <ov::element::Type_t dType>
std::vector<typename ov::element_type_traits<dType>::value_type> inline generateVector(
size_t vec_len,
typename ov::element_type_traits<dType>::value_type upTo = 10,
typename ov::element_type_traits<dType>::value_type startFrom = 1,
int32_t seed = 1) {
using dataType = typename ov::element_type_traits<dType>::value_type;
std::vector<dataType> res(vec_len);

std::mt19937 gen(seed);
if (std::is_floating_point<dataType>()) {
// chose values between this range to avoid type overrun (e.g. in case of I8 precision)
std::uniform_real_distribution<double> dist(static_cast<double>(startFrom), static_cast<double>(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<dataType>(dist(gen));
}
return res;
} else if (std::is_same<bool, dataType>()) {
std::bernoulli_distribution dist;
for (size_t i = 0; i < vec_len; i++) {
res[i] = static_cast<dataType>(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<long> dist(static_cast<long>(startFrom), static_cast<long>(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<dataType>(dist(gen));
}
return res;
}
}

template <>
std::vector<ov::float16> inline generateVector<ov::element::Type_t::f16>(size_t vec_len,
ov::float16 upTo,
ov::float16 startFrom,
int32_t seed) {
std::vector<ov::float16> 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<float> 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<ov::bfloat16> inline generateVector<ov::element::Type_t::bf16>(size_t vec_len,
ov::bfloat16 upTo,
ov::bfloat16 startFrom,
int32_t seed) {
std::vector<ov::bfloat16> 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<float> 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 <typename fromType, typename toType>
std::vector<toType> castVector(const std::vector<fromType>& vec) {
std::vector<toType> resVec;
resVec.reserve(vec.size());
for (const auto& el : vec) {
resVec.push_back(static_cast<toType>(el));
}
return resVec;
}

} // namespace Utils
} // namespace NGraphFunctions

namespace ov {
namespace test {
namespace utils {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit 03a679b

Please sign in to comment.