Skip to content

Commit 4bab503

Browse files
committed
Fix OpenCL compilation
1 parent b5c0a55 commit 4bab503

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

DataFormats/Detectors/TPC/include/DataFormatsTPC/ClusterNative.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef ALICEO2_DATAFORMATSTPC_CLUSTERNATIVE_H
1616
#define ALICEO2_DATAFORMATSTPC_CLUSTERNATIVE_H
1717
#ifndef GPUCA_GPUCODE_DEVICE
18+
#include <climits>
1819
#include <cstdint>
1920
#include <cstddef> // for size_t
2021
#include <utility>
@@ -63,7 +64,7 @@ struct ClusterNative {
6364
static constexpr int scaleSigmaTimePacked = 32; // 1/32nd of pad/timebin precision for cluster size
6465
static constexpr int scaleSigmaPadPacked = 32;
6566
static constexpr int scaleSaturatedQTot = 4;
66-
static constexpr int maxSaturatedQTot = UINT16_MAX * scaleSaturatedQTot;
67+
static constexpr int maxSaturatedQTot = USHRT_MAX * scaleSaturatedQTot;
6768

6869
uint32_t timeFlagsPacked; //< Contains the time in the lower 24 bits in a packed format, contains the flags in the
6970
// upper 8 bits
@@ -90,7 +91,7 @@ struct ClusterNative {
9091
if (isSaturated()) [[unlikely]] {
9192
// Check for overflow, so return type can stay uint16
9293
auto sqtot = getSaturatedQtot();
93-
return sqtot <= UINT16_MAX ? sqtot : UINT16_MAX;
94+
return sqtot <= USHRT_MAX ? sqtot : UINT16_MAX;
9495
}
9596
return qTot;
9697
}

0 commit comments

Comments
 (0)