summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0004-refactor-use-std-numeric_limits-to-get-max-value.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0004-refactor-use-std-numeric_limits-to-get-max-value.patch')
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0004-refactor-use-std-numeric_limits-to-get-max-value.patch107
1 files changed, 107 insertions, 0 deletions
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0004-refactor-use-std-numeric_limits-to-get-max-value.patch b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0004-refactor-use-std-numeric_limits-to-get-max-value.patch
new file mode 100644
index 00000000..2d857c6b
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0004-refactor-use-std-numeric_limits-to-get-max-value.patch
@@ -0,0 +1,107 @@
1From 3e7b32bf2d6042314772249532e80517e9126bc5 Mon Sep 17 00:00:00 2001
2From: Bartosz Dunajski <bartosz.dunajski@intel.com>
3Date: Wed, 7 Jan 2026 08:11:57 +0000
4Subject: [PATCH] refactor: use std::numeric_limits to get max value
5
6Newer GCC (16.x) no longer pulls in <climits> transitively, so the use
7of ULONG_MAX failed to build. Upstream replaced ULONG_MAX with
8std::numeric_limits<uint64_t>::max(), which removes the dependency on
9the macro entirely. Backported verbatim to fix the build on the pinned
10releases/25.48 branch.
11
12Upstream-Status: Backport [https://github.com/intel/compute-runtime/commit/3e7b32bf2d6042314772249532e80517e9126bc5]
13
14Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
15Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com>
16---
17 shared/source/os_interface/linux/pmt_util.cpp | 9 ++++-----
18 .../linux/product_helper_uuid_xehp_and_later.inl | 4 ++--
19 shared/source/xe_hpc_core/linux/product_helper_pvc.cpp | 4 +++-
20 3 files changed, 9 insertions(+), 8 deletions(-)
21
22diff --git a/shared/source/os_interface/linux/pmt_util.cpp b/shared/source/os_interface/linux/pmt_util.cpp
23index 1f8546afb8e17..6ac63aa99a400 100644
24--- a/shared/source/os_interface/linux/pmt_util.cpp
25+++ b/shared/source/os_interface/linux/pmt_util.cpp
26@@ -1,5 +1,5 @@
27 /*
28- * Copyright (C) 2021-2023 Intel Corporation
29+ * Copyright (C) 2021-2026 Intel Corporation
30 *
31 * SPDX-License-Identifier: MIT
32 *
33@@ -11,12 +11,11 @@
34 #include "shared/source/os_interface/linux/sys_calls.h"
35 #include "shared/source/utilities/directory.h"
36
37-#include <climits>
38-
39 #include <algorithm>
40 #include <array>
41 #include <cstdint>
42 #include <fcntl.h>
43+#include <limits>
44 #include <map>
45 #include <sstream>
46 #include <string_view>
47@@ -75,7 +74,7 @@ bool PmtUtil::readOffset(std::string_view telemDir, uint64_t &offset) {
48 ssize_t bytesRead = 0;
49 std::array<char, 16> offsetString = {'\0'};
50 if (fd > 0) {
51- offset = ULONG_MAX;
52+ offset = std::numeric_limits<uint64_t>::max();
53 bytesRead = SysCalls::pread(fd, offsetString.data(), offsetString.size() - 1, 0);
54 }
55 if (bytesRead <= 0) {
56@@ -85,7 +84,7 @@ bool PmtUtil::readOffset(std::string_view telemDir, uint64_t &offset) {
57 std::replace(offsetString.begin(), offsetString.end(), '\n', '\0');
58 offset = std::strtoul(offsetString.data(), nullptr, 10);
59
60- if (offset == ULONG_MAX) {
61+ if (offset == std::numeric_limits<uint64_t>::max()) {
62 return false;
63 }
64 return true;
65diff --git a/shared/source/os_interface/linux/product_helper_uuid_xehp_and_later.inl b/shared/source/os_interface/linux/product_helper_uuid_xehp_and_later.inl
66index d2187052db709..cd940cd149b41 100644
67--- a/shared/source/os_interface/linux/product_helper_uuid_xehp_and_later.inl
68+++ b/shared/source/os_interface/linux/product_helper_uuid_xehp_and_later.inl
69@@ -1,5 +1,5 @@
70 /*
71- * Copyright (C) 2021-2025 Intel Corporation
72+ * Copyright (C) 2021-2026 Intel Corporation
73 *
74 * SPDX-License-Identifier: MIT
75 *
76@@ -37,7 +37,7 @@ bool ProductHelperHw<gfxProduct>::getUuid(DriverModel *driverModel, const uint32
77 return false;
78 }
79
80- uint64_t offset = ULONG_MAX;
81+ uint64_t offset = std::numeric_limits<uint64_t>::max();
82 if (!PmtUtil::readOffset(telemDir, offset)) {
83 return false;
84 }
85diff --git a/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp b/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp
86index 6451de9b4f6a6..8ea0239c7ef90 100644
87--- a/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp
88+++ b/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp
89@@ -1,5 +1,5 @@
90 /*
91- * Copyright (C) 2021-2025 Intel Corporation
92+ * Copyright (C) 2021-2026 Intel Corporation
93 *
94 * SPDX-License-Identifier: MIT
95 *
96@@ -18,6 +18,8 @@
97 #include "shared/source/utilities/directory.h"
98 #include "shared/source/xe_hpc_core/hw_cmds_pvc.h"
99
100+#include <limits>
101+
102 constexpr static auto gfxProduct = IGFX_PVC;
103
104 namespace NEO {
105--
1062.34.1
107