[template] Fix debug build for linux (#24490)

### Tickets:
 - *[CVS-138757](https://jira.devtools.intel.com/browse/CVS-138757)*
This commit is contained in:
Sofya Balandina 2024-05-21 16:23:42 +01:00 committed by GitHub
parent ffc77d0bcc
commit 76d3410a7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 31 additions and 11 deletions

View File

@ -100,9 +100,13 @@ void CommonReferenceTest::ValidateBlobs(const ov::Tensor& refBlob,
if (actual_comparision_size == 0)
actual_comparision_size = refBlob.get_size();
// compare() get fundamental element type with element_type_traits firstly and cast data to relative ov type with
// 'from' types listed below have a fundamental analogue as int8_t, but int8_t is converted only to i8 with from
std::vector<ov::element::Type> raw_data_comp_only =
{ov::element::u1, ov::element::u2, ov::element::u3, ov::element::u4, ov::element::u6, ov::element::i4};
const auto& element_type = refBlob.get_element_type();
if (!legacy_compare) {
if (!legacy_compare &&
std::find(raw_data_comp_only.begin(), raw_data_comp_only.end(), element_type) == raw_data_comp_only.end()) {
switch (element_type) {
case ov::element::boolean:
case ov::element::bf16:
@ -117,9 +121,17 @@ void CommonReferenceTest::ValidateBlobs(const ov::Tensor& refBlob,
case ov::element::u16:
case ov::element::u32:
case ov::element::u64:
case ov::element::f8e4m3:
case ov::element::f8e5m2:
ov::test::utils::compare(refBlob, outBlob, abs_threshold, threshold);
return;
break;
case ov::element::string:
ov::test::utils::compare_str(refBlob, outBlob);
break;
default:
FAIL() << "Comparator for " << element_type << " element type isn't supported";
}
return;
}
switch (element_type) {
case ov::element::bf16:

View File

@ -109,19 +109,23 @@ private:
TEST_P(ReferenceReadValueAssignV3LayerTest, ReadValueAssignWithHardcodedRefs) {
Exec();
const int COUNT_RUNS = 10;
for (int i = 0; i < COUNT_RUNS; ++i) {
Infer();
Validate();
if (executableNetwork) {
const int COUNT_RUNS = 10;
for (int i = 0; i < COUNT_RUNS; ++i) {
Infer();
Validate();
}
}
}
TEST_P(ReferenceReadValueAssignV6LayerTest, ReadValueAssignWithHardcodedRefs) {
Exec();
const int COUNT_RUNS = 10;
for (int i = 0; i < COUNT_RUNS; ++i) {
Infer();
Validate();
if (executableNetwork) {
const int COUNT_RUNS = 10;
for (int i = 0; i < COUNT_RUNS; ++i) {
Infer();
Validate();
}
}
}

View File

@ -625,6 +625,8 @@ void compare(const ov::Tensor& expected,
CASE0(X, ov::element::Type_t::u16) \
CASE0(X, ov::element::Type_t::u32) \
CASE0(X, ov::element::Type_t::u64) \
CASE0(X, ov::element::Type_t::f8e4m3) \
CASE0(X, ov::element::Type_t::f8e5m2) \
default: \
OPENVINO_THROW("Unsupported element type: ", \
"expected ", \
@ -651,6 +653,8 @@ void compare(const ov::Tensor& expected,
CASE(ov::element::Type_t::u16)
CASE(ov::element::Type_t::u32)
CASE(ov::element::Type_t::u64)
CASE(ov::element::Type_t::f8e4m3)
CASE(ov::element::Type_t::f8e5m2)
case ov::element::Type_t::string:
compare_str(expected, actual);
break;