Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

Update Clang version to 18 in Dockerfile (#29921)

barnasm1bb17c4446e3a
diff --git a/.github/dockerfiles/docker_tag b/.github/dockerfiles/docker_tag
index 2e044e4715e..21335ee9034 100644
--- a/.github/dockerfiles/docker_tag
+++ b/.github/dockerfiles/docker_tag
@@ -1 +1 @@
-pr-30139
\ No newline at end of file
+pr-29921
diff --git a/.github/dockerfiles/ov_build/ubuntu_22_04_x64_cc/Dockerfile b/.github/dockerfiles/ov_build/ubuntu_22_04_x64_cc/Dockerfile
index aaddaff726a..d53bed4e492 100644
--- a/.github/dockerfiles/ov_build/ubuntu_22_04_x64_cc/Dockerfile
+++ b/.github/dockerfiles/ov_build/ubuntu_22_04_x64_cc/Dockerfile
@@ -38,11 +38,11 @@ RUN apt-get update && \
# For Java API
default-jdk \
# Compiler \
- clang-15 \
+ clang-18 \
# Static analyzer
clang-tidy-18 \
# clang-tidy uses clang-format as a dependency
- clang-format-15 \
+ clang-format-18 \
&& \
rm -rf /var/lib/apt/lists/*
@@ -53,8 +53,8 @@ RUN chmod +x /install_build_dependencies.sh && \
rm -rf /var/lib/apt/lists/*
# Set clang as a default compiler
-RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-15 100 && \
- update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-15 100
+RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-18 100 && \
+ update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-18 100
# Install sscache
ARG SCCACHE_VERSION="v0.7.5"
diff --git a/src/frontends/onnx/tests/onnx_reader_external_data.cpp b/src/frontends/onnx/tests/onnx_reader_external_data.cpp
index 7ad1d132367..8b8a7f1e100 100644
--- a/src/frontends/onnx/tests/onnx_reader_external_data.cpp
+++ b/src/frontends/onnx/tests/onnx_reader_external_data.cpp
@@ -289,7 +289,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_data_int8) {
const auto model = core.read_model(path);
auto test_case = test::TestCase(model);
test_case.add_input<int8_t>({-100});
- test_case.add_expected_output<int8_t>(Shape{2, 2}, {-100, 106, -100, -37});
+ test_case.add_expected_output<int8_t>(Shape{2, 2}, {-100, -100, 28, -37});
test_case.run();
}
diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/all_close.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/all_close.hpp
index 90fd1210037..69b7f642cc8 100644
--- a/src/tests/test_utils/common_test_utils/include/common_test_utils/all_close.hpp
+++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/all_close.hpp
@@ -61,9 +61,24 @@ typename std::enable_if<std::is_integral<T>::value, ::testing::AssertionResult>:
::testing::AssertionResult ar_fail = ::testing::AssertionFailure();
for (size_t i = 0; i < size; ++i) {
T abs_diff = (a[i] > b[i]) ? (a[i] - b[i]) : (b[i] - a[i]);
- if (abs_diff > atol + rtol * b[i]) {
+ bool is_overflow{};
+
+ if constexpr (std::is_signed_v<T> && std::is_integral_v<T>) {
+ auto check_sub_overflow = [](T a, T b) {
+ if ((b > 0 && a < std::numeric_limits<T>::min() + b) || // Negative overflow
+ (b < 0 && a > std::numeric_limits<T>::max() + b)) { // Positive overflow
+ return true;
+ }
+ return false;
+ };
+
+ is_overflow = (a[i] > b[i]) ? check_sub_overflow(a[i], b[i]) : check_sub_overflow(b[i], a[i]);
+ }
+
+ if (is_overflow || abs_diff > atol + rtol * b[i]) {
// use unary + operator to force integral values to be displayed as numbers
- ar_fail << +a[i] << " is not close to " << +b[i] << " at index " << i << std::endl;
+ ar_fail << (is_overflow ? "Overvlow detected. " : "") << +a[i] << " is not close to " << +b[i]
+ << " at index " << i << std::endl;
rc = false;
}
}