Skip to content

Commit 629e6da

Browse files
committed
DataFormatsTPC: place the zero-suppression constants in the constant address space
MSL requires every variable at program scope, class-scope statics included, to name an address space. GPUglobalconstexpr() expands to constexpr everywhere except Metal, so this is a no-op for host, CUDA, HIP, OpenCL and cling. These were missed by the earlier pass: the header they sit in only started being compiled once the errors ahead of it were gone.
1 parent a60f748 commit 629e6da

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎DataFormats/Detectors/TPC/include/DataFormatsTPC/ZeroSuppression.h‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ enum ZSVersion : unsigned char {
3535
};
3636

3737
struct TPCZSHDR {
38-
static constexpr size_t TPC_ZS_PAGE_SIZE = 8192;
39-
static constexpr size_t TPC_MAX_SEQ_LEN = 138;
40-
static constexpr size_t TPC_MAX_ZS_ROW_IN_ENDPOINT = 9;
41-
static constexpr unsigned int MAX_DIGITS_IN_PAGE = (TPC_ZS_PAGE_SIZE - 64 - 6 - 4 - 3) * 8 / 10;
42-
static constexpr unsigned int TPC_ZS_NBITS_V1 = 10;
43-
static constexpr unsigned int TPC_ZS_NBITS_V2 = 12;
38+
static GPUglobalconstexpr() size_t TPC_ZS_PAGE_SIZE = 8192;
39+
static GPUglobalconstexpr() size_t TPC_MAX_SEQ_LEN = 138;
40+
static GPUglobalconstexpr() size_t TPC_MAX_ZS_ROW_IN_ENDPOINT = 9;
41+
static GPUglobalconstexpr() unsigned int MAX_DIGITS_IN_PAGE = (TPC_ZS_PAGE_SIZE - 64 - 6 - 4 - 3) * 8 / 10;
42+
static GPUglobalconstexpr() unsigned int TPC_ZS_NBITS_V1 = 10;
43+
static GPUglobalconstexpr() unsigned int TPC_ZS_NBITS_V2 = 12;
4444

4545
unsigned char version; // ZS format version:
4646
// 1: original row-based format with 10-bit ADC values
@@ -53,10 +53,10 @@ struct TPCZSHDR {
5353
unsigned short nADCsamples; // Total number of ADC samples in this raw page
5454
};
5555
struct TPCZSHDRV2 : public TPCZSHDR {
56-
static constexpr unsigned int TPC_ZS_NBITS_V34 = 12;
57-
static constexpr bool TIGHTLY_PACKED_V3 = false;
58-
static constexpr unsigned int SAMPLESPER64BIT = 64 / TPC_ZS_NBITS_V34; // 5 12-bit samples with 4 bit padding per 64 bit word for non-TIGHTLY_PACKED data
59-
static constexpr unsigned int TRIGGER_WORD_SIZE = 16; // trigger word size in bytes
56+
static GPUglobalconstexpr() unsigned int TPC_ZS_NBITS_V34 = 12;
57+
static GPUglobalconstexpr() bool TIGHTLY_PACKED_V3 = false;
58+
static GPUglobalconstexpr() unsigned int SAMPLESPER64BIT = 64 / TPC_ZS_NBITS_V34; // 5 12-bit samples with 4 bit padding per 64 bit word for non-TIGHTLY_PACKED data
59+
static GPUglobalconstexpr() unsigned int TRIGGER_WORD_SIZE = 16; // trigger word size in bytes
6060
enum ZSFlags : unsigned char {
6161
TriggerWordPresent = 1,
6262
nTimeBinSpanBit8 = 2,
@@ -89,7 +89,7 @@ struct ZeroSuppressedContainer { // Struct for the TPC zero suppressed data form
8989
///
9090
/// Trigger word is always 128bit and occurs always in the last page of a HBF before the meta header
9191
struct TriggerWordDLBZS {
92-
static constexpr uint16_t MaxTriggerEntries = 8; ///< Maximum number of trigger information
92+
static GPUglobalconstexpr() uint16_t MaxTriggerEntries = 8; ///< Maximum number of trigger information
9393

9494
/// trigger types as in the ttype bits
9595
enum TriggerType : uint8_t {

‎DataFormats/Detectors/TPC/include/DataFormatsTPC/ZeroSuppressionLinkBased.h‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ namespace tpc
3030
namespace zerosupp_link_based
3131
{
3232

33-
static constexpr uint32_t DataWordSizeBits = 128; ///< size of header word and data words in bits
34-
static constexpr uint32_t DataWordSizeBytes = DataWordSizeBits / 8; ///< size of header word and data words in bytes
35-
static constexpr uint32_t ChannelPerTBHeader = 80;
33+
static GPUglobalconstexpr() uint32_t DataWordSizeBits = 128; ///< size of header word and data words in bits
34+
static GPUglobalconstexpr() uint32_t DataWordSizeBytes = DataWordSizeBits / 8; ///< size of header word and data words in bytes
35+
static GPUglobalconstexpr() uint32_t ChannelPerTBHeader = 80;
3636

3737
/// common header definition of the zero suppressed link based data
3838
struct CommonHeader {
39-
static constexpr uint32_t MagicWordLinkZS = 0xFC;
40-
static constexpr uint32_t MagicWordLinkZSMetaHeader = 0xFD;
41-
static constexpr uint32_t MagicWordTrigger = 0xAA;
42-
static constexpr uint32_t MagicWordTriggerV2 = 0xAB;
39+
static GPUglobalconstexpr() uint32_t MagicWordLinkZS = 0xFC;
40+
static GPUglobalconstexpr() uint32_t MagicWordLinkZSMetaHeader = 0xFD;
41+
static GPUglobalconstexpr() uint32_t MagicWordTrigger = 0xAA;
42+
static GPUglobalconstexpr() uint32_t MagicWordTriggerV2 = 0xAB;
4343

4444
union {
4545
uint64_t word0 = 0; ///< lower 64 bits

0 commit comments

Comments
 (0)