Fix string literal conditions used in OPENVINO_ASSERT#33911
Fix string literal conditions used in OPENVINO_ASSERT#33911aobolensk wants to merge 25 commits intoopenvinotoolkit:masterfrom
Conversation
0940e67 to
e47d20b
Compare
07e770d to
d09b6a8
Compare
5bc283a to
c522f11
Compare
…conditions in OPENVINO_ASSERT Add guard and update hetero/gpu code paths to use OPENVINO_THROW or explicit predicate asserts
277aecc to
c649f8f
Compare
| do { \ | ||
| auto _ov_check_condition = [](const auto& v) -> void { \ | ||
| using _ov_check_t = ::std::remove_reference_t<decltype(v)>; \ | ||
| if constexpr (::std::is_array_v<_ov_check_t> && \ |
There was a problem hiding this comment.
Does it make sense to have different error messages for different types of strings?
There was a problem hiding this comment.
Fair enough, removed
c649f8f to
5d630a6
Compare
0e431b4 to
1fa16fa
Compare
| explicit NotImplemented(const std::string& what_arg) : ov::AssertFailure(what_arg) {} | ||
| }; | ||
|
|
||
| namespace detail { |
There was a problem hiding this comment.
Remove this section and hide inside the macro. There should be more public functions to handle OV exceptions for internal checks
| auto dest_type_i64 = std::pair<std::string, detail::AttrAny>({"destination_type", "i64"}); | ||
| auto dest_type_f32 = std::pair<std::string, detail::AttrAny>({"destination_type", "f32"}); | ||
| auto dest_type_f16 = std::pair<std::string, detail::AttrAny>({"destination_type", "f16"}); | ||
| auto dest_type_i64 = std::pair<std::string, gen_pattern::detail::AttrAny>({"destination_type", "i64"}); |
There was a problem hiding this comment.
This should not be required because of exception changes.
|
The solution is cumbersome if we use C++17 only. There is no robust way to implement in a proper way without triggering many other compiler warnings. Decided to postpone proper solution until C++20 enabling. For now, fixed all incorrect assertions only without changes to |
|
build_jenkins |
|
build_jenkins |
Details:
Fix "always true" assertions when string literal is passed as an assert argument.
Tickets: