Skip to content

Commit 51509a4

Browse files
authored
Merge pull request #47330 from iarspider/iarspider-patches-20250212-1
[GCC14] Fix compilation errors
2 parents fae8592 + e3f9bef commit 51509a4

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

JetMETCorrections/Modules/src/JetResolution.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include "JetResolution.h"
1010
#endif
1111

12+
#include <algorithm>
13+
1214
namespace JME {
1315

1416
JetResolution::JetResolution(const std::string& filename) {

L1Trigger/GlobalCaloTrigger/src/L1GlobalCaloTrigger.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include "FWCore/MessageLogger/interface/MessageLogger.h"
1616

17+
#include <algorithm>
18+
1719
using std::vector;
1820

1921
//DEFINE STATICS

RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder {
7676
// fill hist (bin shall be wider than "eps")
7777
for (auto i : cms::alpakatools::uniform_elements(acc, nt)) {
7878
int iz = static_cast<int>(zt[i] * 10.f); // valid if eps <= 0.1
79-
iz = std::clamp(iz, INT8_MIN, INT8_MAX);
79+
// Equivalent of iz = std::clamp(iz, INT8_MIN, INT8_MAX)
80+
// which doesn't compile with gcc14 due to reference to __glibcxx_assert
81+
// See https://github.com/llvm/llvm-project/issues/95183
82+
int tmp_max = std::max<int>(iz, INT8_MIN);
83+
iz = std::min<int>(tmp_max, INT8_MAX);
8084
izt[i] = iz - INT8_MIN;
8185
ALPAKA_ASSERT_ACC(iz - INT8_MIN >= 0);
8286
ALPAKA_ASSERT_ACC(iz - INT8_MIN < 256);

RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder {
7676
// fill hist (bin shall be wider than "eps")
7777
for (auto i : cms::alpakatools::uniform_elements(acc, nt)) {
7878
int iz = static_cast<int>(zt[i] * 10.f); // valid if eps <= 0.1
79-
iz = std::clamp(iz, INT8_MIN, INT8_MAX);
79+
// Equivalent of iz = std::clamp(iz, INT8_MIN, INT8_MAX)
80+
// which doesn't compile with gcc14 due to reference to __glibcxx_assert
81+
// See https://github.com/llvm/llvm-project/issues/95183
82+
int tmp_max = std::max<int>(iz, INT8_MIN);
83+
iz = std::min<int>(tmp_max, INT8_MAX);
8084
izt[i] = iz - INT8_MIN;
8185
ALPAKA_ASSERT_ACC(iz - INT8_MIN >= 0);
8286
ALPAKA_ASSERT_ACC(iz - INT8_MIN < 256);

0 commit comments

Comments
 (0)