diff --git a/DataFormats/Detectors/TPC/include/DataFormatsTPC/Constants.h b/DataFormats/Detectors/TPC/include/DataFormatsTPC/Constants.h index 0ddf7281be866..c5423420d9fec 100644 --- a/DataFormats/Detectors/TPC/include/DataFormatsTPC/Constants.h +++ b/DataFormats/Detectors/TPC/include/DataFormatsTPC/Constants.h @@ -17,6 +17,8 @@ #ifndef AliceO2_TPC_Constants_H #define AliceO2_TPC_Constants_H +#include "GPUCommonDef.h" + namespace o2 { namespace tpc @@ -25,17 +27,17 @@ namespace constants { // the number of sectors -constexpr int MAXSECTOR = 36; +GPUglobalconstexpr() int MAXSECTOR = 36; // the number of global pad rows #if defined(GPUCA_STANDALONE) && defined(GPUCA_RUN2) -constexpr int MAXGLOBALPADROW = 159; // Number of pad rows in Run 2, used for GPU TPC tests with Run 2 data +GPUglobalconstexpr() int MAXGLOBALPADROW = 159; // Number of pad rows in Run 2, used for GPU TPC tests with Run 2 data #else -constexpr int MAXGLOBALPADROW = 152; // Correct number of pad rows in Run 3 +GPUglobalconstexpr() int MAXGLOBALPADROW = 152; // Correct number of pad rows in Run 3 #endif // number of LHC bunch crossings per TPC time bin (40 MHz / 5 MHz) -constexpr int LHCBCPERTIMEBIN = 8; +GPUglobalconstexpr() int LHCBCPERTIMEBIN = 8; } // namespace constants } // namespace tpc } // namespace o2 diff --git a/GPU/Common/GPUCommonDefAPI.h b/GPU/Common/GPUCommonDefAPI.h index 45cc987453830..a04934304d525 100644 --- a/GPU/Common/GPUCommonDefAPI.h +++ b/GPU/Common/GPUCommonDefAPI.h @@ -48,6 +48,7 @@ #define GPUglobal() // global memory variable declaration (only used for kernel input pointers) #define GPUconstant() // constant memory variable declaraion #define GPUconstexpr() static constexpr // constexpr on GPU that needs to be instantiated for dynamic access (e.g. arrays), becomes __constant on GPU + #define GPUglobalconstexpr() constexpr // constexpr variable at program scope, needs the constant address space in MSL #define GPUprivate() // private memory variable declaration #define GPUgeneric() // reference / ptr to generic address space #define GPUbarrier() // synchronize all GPU threads in block @@ -160,6 +161,7 @@ #define GPUglobal() device #define GPUconstant() constant // TODO: possibly add const __restrict where possible later! #define GPUconstexpr() constant + #define GPUglobalconstexpr() constant constexpr #define GPUprivate() thread #define GPUgeneric() #define GPUglobalref() device @@ -255,6 +257,9 @@ #ifndef GPUconstexprref #define GPUconstexprref() #endif +#ifndef GPUglobalconstexpr +#define GPUglobalconstexpr() constexpr +#endif #define GPUrestrict() __restrict__ @@ -277,5 +282,5 @@ #define get_group_id(dim) iBlock #endif -// clang-format on + // clang-format on #endif