Skip to content

Commit 223b8d0

Browse files
committed
TPC: place shared constants in the Metal constant address space
MSL requires namespace-scope constexpr to live in the constant address space. Generic pointers do not help here: constant is explicitly not among the address spaces MSL 4.1 makes generic, so the annotation is required whatever the language version. Guarded on __METAL__, so no other build changes.
1 parent 7675f01 commit 223b8d0

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • DataFormats/Detectors/TPC/include/DataFormatsTPC

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#ifndef AliceO2_TPC_Constants_H
1818
#define AliceO2_TPC_Constants_H
1919

20+
#include "GPUCommonDef.h"
21+
2022
namespace o2
2123
{
2224
namespace tpc
@@ -25,17 +27,27 @@ namespace constants
2527
{
2628

2729
// the number of sectors
30+
#ifdef __METAL__
31+
GPUconstant() constexpr int MAXSECTOR = 36;
32+
#else
2833
constexpr int MAXSECTOR = 36;
34+
#endif
2935

3036
// the number of global pad rows
3137
#if defined(GPUCA_STANDALONE) && defined(GPUCA_RUN2)
3238
constexpr int MAXGLOBALPADROW = 159; // Number of pad rows in Run 2, used for GPU TPC tests with Run 2 data
39+
#elif defined(__METAL__)
40+
GPUconstant() constexpr int MAXGLOBALPADROW = 152; // Correct number of pad rows in Run 3
3341
#else
3442
constexpr int MAXGLOBALPADROW = 152; // Correct number of pad rows in Run 3
3543
#endif
3644

3745
// number of LHC bunch crossings per TPC time bin (40 MHz / 5 MHz)
46+
#ifdef __METAL__
47+
GPUconstant() constexpr int LHCBCPERTIMEBIN = 8;
48+
#else
3849
constexpr int LHCBCPERTIMEBIN = 8;
50+
#endif
3951
} // namespace constants
4052
} // namespace tpc
4153
} // namespace o2

0 commit comments

Comments
 (0)