From 47eb04f031e3346ca7e09cac6ee791defc96b79b Mon Sep 17 00:00:00 2001 From: David Rohr Date: Sun, 19 Jan 2025 21:35:05 +0100 Subject: [PATCH] GPU: Remove C++ <17 protections from GPU code --- GPU/Common/GPUCommonAlgorithm.h | 3 +-- GPU/Common/GPUCommonConstants.h | 2 +- GPU/Common/GPUCommonDef.h | 7 ------ GPU/Common/GPUCommonLogger.h | 2 +- GPU/Common/GPUCommonMath.h | 12 +++++----- GPU/GPUTracking/Base/GPUGeneralKernels.h | 6 ++--- GPU/GPUTracking/Base/GPUParam.inc | 2 +- GPU/GPUTracking/Base/GPUProcessor.h | 2 +- .../Base/opencl/GPUReconstructionOCL.cl | 3 --- .../GPUTPCCompressionKernels.cxx | 24 +++++++++---------- .../GPUTPCCompressionKernels.h | 2 +- GPU/GPUTracking/DataTypes/GPUSettings.h | 2 +- .../DataTypes/GPUTPCGMPolynomialField.h | 6 ++--- GPU/GPUTracking/DataTypes/GPUTPCGeometry.h | 8 +++---- .../Definitions/GPUDefGPUParameters.h | 7 +----- GPU/GPUTracking/Definitions/GPULogging.h | 2 +- GPU/GPUTracking/ITS/GPUITSFitterKernels.h | 2 +- GPU/GPUTracking/Merger/GPUTPCGMMerger.h | 2 +- GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.h | 2 +- .../Merger/GPUTPCGlobalDebugSortKernels.h | 2 +- .../Refit/GPUTrackingRefitKernel.h | 2 +- .../SliceTracker/GPUTPCCreateOccupancyMap.h | 2 +- .../SliceTracker/GPUTPCCreateSliceData.h | 2 +- .../SliceTracker/GPUTPCGlobalTracking.h | 4 ++-- .../SliceTracker/GPUTPCNeighboursCleaner.h | 2 +- .../SliceTracker/GPUTPCNeighboursFinder.h | 2 +- .../GPUTPCSectorDebugSortKernels.h | 2 +- .../SliceTracker/GPUTPCSliceData.cxx | 4 ++-- .../SliceTracker/GPUTPCStartHitsFinder.h | 2 +- .../SliceTracker/GPUTPCStartHitsSorter.h | 2 +- .../SliceTracker/GPUTPCTrackletConstructor.h | 2 +- .../SliceTracker/GPUTPCTrackletSelector.h | 2 +- .../GPUTPCCFChargeMapFiller.h | 2 +- .../GPUTPCCFCheckPadBaseline.h | 2 +- .../TPCClusterFinder/GPUTPCCFClusterizer.h | 2 +- .../TPCClusterFinder/GPUTPCCFDecodeZS.cxx | 10 ++++---- .../TPCClusterFinder/GPUTPCCFDecodeZS.h | 4 ++-- .../TPCClusterFinder/GPUTPCCFDeconvolution.h | 2 +- .../TPCClusterFinder/GPUTPCCFGather.h | 2 +- .../GPUTPCCFMCLabelFlattener.h | 2 +- .../GPUTPCCFNoiseSuppression.h | 2 +- .../TPCClusterFinder/GPUTPCCFPeakFinder.h | 2 +- .../GPUTPCCFStreamCompaction.h | 2 +- .../TPCConvert/GPUTPCConvertKernel.h | 2 +- GPU/GPUTracking/TRDTracking/GPUTRDGeometry.h | 2 +- GPU/GPUTracking/TRDTracking/GPUTRDTracker.h | 2 +- .../TRDTracking/GPUTRDTrackerKernels.cxx | 5 +--- .../TRDTracking/GPUTRDTrackerKernels.h | 2 +- GPU/GPUTracking/utils/qconfigrtc.h | 4 ---- GPU/GPUTracking/utils/strtag.h | 6 +---- GPU/TPCFastTransformation/Spline2D.h | 2 +- GPU/TPCFastTransformation/Spline2DSpec.h | 2 +- GPU/TPCFastTransformation/SplineSpec.h | 2 +- .../devtools/IrregularSpline2D3D.h | 4 ++-- 54 files changed, 82 insertions(+), 109 deletions(-) diff --git a/GPU/Common/GPUCommonAlgorithm.h b/GPU/Common/GPUCommonAlgorithm.h index e5a963b4c2020..dd3cc1925b04a 100644 --- a/GPU/Common/GPUCommonAlgorithm.h +++ b/GPU/Common/GPUCommonAlgorithm.h @@ -17,8 +17,7 @@ #include "GPUCommonDef.h" -#if !defined(GPUCA_GPUCODE) -//&& (!defined __cplusplus || __cplusplus < 201402L) // This would enable to custom search also on the CPU if available by the compiler, but it is not always faster, so we stick to std::sort +#if !defined(GPUCA_GPUCODE) // Could also enable custom search on the CPU, but it is not always faster, so we stick to std::sort #include #define GPUCA_ALGORITHM_STD #endif diff --git a/GPU/Common/GPUCommonConstants.h b/GPU/Common/GPUCommonConstants.h index c6dfedc14ab7e..d209b6a42a794 100644 --- a/GPU/Common/GPUCommonConstants.h +++ b/GPU/Common/GPUCommonConstants.h @@ -19,7 +19,7 @@ namespace GPUCA_NAMESPACE::gpu::gpu_common_constants { -static CONSTEXPR const float kCLight = 0.000299792458f; // TODO: Duplicate of MathConstants, fix this now that we use only OpenCL CPP +static constexpr const float kCLight = 0.000299792458f; // TODO: Duplicate of MathConstants, fix this now that we use only OpenCL CPP } #endif diff --git a/GPU/Common/GPUCommonDef.h b/GPU/Common/GPUCommonDef.h index 2b3164d16d981..059e011a715d8 100644 --- a/GPU/Common/GPUCommonDef.h +++ b/GPU/Common/GPUCommonDef.h @@ -40,13 +40,6 @@ #endif #endif -// Definitions for C++11 features -#if defined(__cplusplus) && __cplusplus >= 201703L - #define CONSTEXPR constexpr -#else - #define CONSTEXPR -#endif - // Set AliRoot / O2 namespace #if defined(GPUCA_STANDALONE) || (defined(GPUCA_O2_LIB) && !defined(GPUCA_O2_INTERFACE)) || defined(GPUCA_ALIROOT_LIB) || defined (GPUCA_GPUCODE) #define GPUCA_ALIGPUCODE diff --git a/GPU/Common/GPUCommonLogger.h b/GPU/Common/GPUCommonLogger.h index 6818564c048db..ca5a8ff3c3410 100644 --- a/GPU/Common/GPUCommonLogger.h +++ b/GPU/Common/GPUCommonLogger.h @@ -45,7 +45,7 @@ struct DummyLogger { #define LOGP(...) // #define LOGP(...) static_assert(false, "LOGP(...) unsupported in GPU code"); -#elif defined(GPUCA_STANDALONE) || defined(GPUCA_ALIROOT_LIB) || (!defined(__cplusplus) || __cplusplus < 201703L) +#elif defined(GPUCA_STANDALONE) || defined(GPUCA_ALIROOT_LIB) #include #include #define LOG(type) std::cout diff --git a/GPU/Common/GPUCommonMath.h b/GPU/Common/GPUCommonMath.h index ec1c3d54096a3..27b3be8869b94 100644 --- a/GPU/Common/GPUCommonMath.h +++ b/GPU/Common/GPUCommonMath.h @@ -73,8 +73,8 @@ class GPUCommonMath GPUd() static float Log(float x); GPUd() static float Exp(float x); GPUhdni() static float Copysign(float x, float y); - GPUd() static CONSTEXPR float TwoPi() { return 6.2831853f; } - GPUd() static CONSTEXPR float Pi() { return 3.1415927f; } + GPUd() static constexpr float TwoPi() { return 6.2831853f; } + GPUd() static constexpr float Pi() { return 3.1415927f; } GPUd() static float Round(float x); GPUd() static float Floor(float x); GPUd() static uint32_t Float2UIntReint(const float& x); @@ -143,12 +143,12 @@ class GPUCommonMath GPUd() static float FMulRZ(float a, float b); template - GPUd() CONSTEXPR static T nextMultipleOf(T val); + GPUd() constexpr static T nextMultipleOf(T val); template GPUdi() static float Sum2(float w, Args... args) { - if CONSTEXPR (sizeof...(Args) == 0) { + if constexpr (sizeof...(Args) == 0) { return w * w; } else { return w * w + Sum2(args...); @@ -181,9 +181,9 @@ typedef GPUCommonMath CAMath; #endif // clang-format on template -GPUdi() CONSTEXPR T GPUCommonMath::nextMultipleOf(T val) +GPUdi() constexpr T GPUCommonMath::nextMultipleOf(T val) { - if CONSTEXPR (I & (I - 1)) { + if constexpr (I & (I - 1)) { T tmp = val % I; if (tmp) { val += I - tmp; diff --git a/GPU/GPUTracking/Base/GPUGeneralKernels.h b/GPU/GPUTracking/Base/GPUGeneralKernels.h index 9829fe350fde1..333a53576663b 100644 --- a/GPU/GPUTracking/Base/GPUGeneralKernels.h +++ b/GPU/GPUTracking/Base/GPUGeneralKernels.h @@ -81,7 +81,7 @@ class GPUKernelTemplate }; typedef GPUconstantref() GPUConstantMem processorType; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::NoRecoStep; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::NoRecoStep; } GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return &processors; @@ -96,7 +96,7 @@ class GPUKernelTemplate class GPUMemClean16 : public GPUKernelTemplate { public: - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::NoRecoStep; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::NoRecoStep; } template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& processors, GPUglobalref() void* ptr, uint64_t size); }; @@ -105,7 +105,7 @@ class GPUMemClean16 : public GPUKernelTemplate class GPUitoa : public GPUKernelTemplate { public: - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::NoRecoStep; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::NoRecoStep; } template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& processors, GPUglobalref() int32_t* ptr, uint64_t size); }; diff --git a/GPU/GPUTracking/Base/GPUParam.inc b/GPU/GPUTracking/Base/GPUParam.inc index 0b32067f8980c..357af42276575 100644 --- a/GPU/GPUTracking/Base/GPUParam.inc +++ b/GPU/GPUTracking/Base/GPUParam.inc @@ -116,7 +116,7 @@ GPUdi() float GPUParam::GetSystematicClusterErrorC122(float x, float y, uint8_t if (dx > occupancyTotal * rec.tpc.sysClusErrorC12Box) { return 0.f; } - CONSTEXPR float dEdgeInv = 18.f / CAMath::Pi(); + constexpr float dEdgeInv = 18.f / CAMath::Pi(); const float dy = (sector == (GPUCA_NSLICES / 2 + 1) ? 0.5f : -0.5f) * (y / x) * dEdgeInv + 0.5f; const float errC12 = rec.tpc.sysClusErrorC12Norm * occupancyTotal * dy; return errC12 * errC12; diff --git a/GPU/GPUTracking/Base/GPUProcessor.h b/GPU/GPUTracking/Base/GPUProcessor.h index eb635ae210b73..473b6dd903226 100644 --- a/GPU/GPUTracking/Base/GPUProcessor.h +++ b/GPU/GPUTracking/Base/GPUProcessor.h @@ -108,7 +108,7 @@ class GPUProcessor if (basePtr == 0) { basePtr = 1; } - CONSTEXPR const size_t maxAlign = (alignof(S) > alignment) ? alignof(S) : alignment; + constexpr const size_t maxAlign = (alignof(S) > alignment) ? alignof(S) : alignment; basePtr += getAlignment(basePtr); S* retVal = (S*)(basePtr); basePtr += nEntries * sizeof(S); diff --git a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cl b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cl index 863cd82cb56eb..4a3cda6c2cddc 100644 --- a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cl +++ b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cl @@ -14,9 +14,6 @@ // clang-format off #define __OPENCL__ -#if defined(__cplusplus) && __cplusplus >= 201703L - #define __OPENCL__ -#endif #define GPUCA_GPUTYPE_OPENCL #ifdef __OPENCL__ diff --git a/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.cxx b/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.cxx index 15888e14eec04..8f28cbe5563af 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.cxx +++ b/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.cxx @@ -332,7 +332,7 @@ GPUdi() GPUTPCCompressionGatherKernels::Vec128* GPUTPCCompressionGatherKernels:: template GPUdi() bool GPUTPCCompressionGatherKernels::isAlignedTo(const S* ptr) { - if CONSTEXPR (alignof(S) >= alignof(T)) { + if constexpr (alignof(S) >= alignof(T)) { static_cast(ptr); return true; } else { @@ -343,10 +343,10 @@ GPUdi() bool GPUTPCCompressionGatherKernels::isAlignedTo(const S* ptr) template <> GPUdi() void GPUTPCCompressionGatherKernels::compressorMemcpy(uint8_t* GPUrestrict() dst, const uint8_t* GPUrestrict() src, uint32_t size, int32_t nThreads, int32_t iThread) { - CONSTEXPR const int32_t vec128Elems = CpyVector::Size; - CONSTEXPR const int32_t vec64Elems = CpyVector::Size; - CONSTEXPR const int32_t vec32Elems = CpyVector::Size; - CONSTEXPR const int32_t vec16Elems = CpyVector::Size; + constexpr const int32_t vec128Elems = CpyVector::Size; + constexpr const int32_t vec64Elems = CpyVector::Size; + constexpr const int32_t vec32Elems = CpyVector::Size; + constexpr const int32_t vec16Elems = CpyVector::Size; if (size >= uint32_t(nThreads * vec128Elems)) { compressorMemcpyVectorised(dst, src, size, nThreads, iThread); @@ -364,9 +364,9 @@ GPUdi() void GPUTPCCompressionGatherKernels::compressorMemcpy(uint8_t* template <> GPUdi() void GPUTPCCompressionGatherKernels::compressorMemcpy(uint16_t* GPUrestrict() dst, const uint16_t* GPUrestrict() src, uint32_t size, int32_t nThreads, int32_t iThread) { - CONSTEXPR const int32_t vec128Elems = CpyVector::Size; - CONSTEXPR const int32_t vec64Elems = CpyVector::Size; - CONSTEXPR const int32_t vec32Elems = CpyVector::Size; + constexpr const int32_t vec128Elems = CpyVector::Size; + constexpr const int32_t vec64Elems = CpyVector::Size; + constexpr const int32_t vec32Elems = CpyVector::Size; if (size >= uint32_t(nThreads * vec128Elems)) { compressorMemcpyVectorised(dst, src, size, nThreads, iThread); @@ -382,8 +382,8 @@ GPUdi() void GPUTPCCompressionGatherKernels::compressorMemcpy(uint16_t template <> GPUdi() void GPUTPCCompressionGatherKernels::compressorMemcpy(uint32_t* GPUrestrict() dst, const uint32_t* GPUrestrict() src, uint32_t size, int32_t nThreads, int32_t iThread) { - CONSTEXPR const int32_t vec128Elems = CpyVector::Size; - CONSTEXPR const int32_t vec64Elems = CpyVector::Size; + constexpr const int32_t vec128Elems = CpyVector::Size; + constexpr const int32_t vec64Elems = CpyVector::Size; if (size >= uint32_t(nThreads * vec128Elems)) { compressorMemcpyVectorised(dst, src, size, nThreads, iThread); @@ -446,8 +446,8 @@ GPUdi() void GPUTPCCompressionGatherKernels::compressorMemcpyBuffered(V* buf, T* V* GPUrestrict() dstAligned = nullptr; T* bufT = reinterpret_cast(buf); - CONSTEXPR const int32_t bufSize = GPUCA_WARP_SIZE; - CONSTEXPR const int32_t bufTSize = bufSize * sizeof(V) / sizeof(T); + constexpr const int32_t bufSize = GPUCA_WARP_SIZE; + constexpr const int32_t bufTSize = bufSize * sizeof(V) / sizeof(T); for (uint32_t i = 0; i < nEntries; i++) { uint32_t srcPos = 0; diff --git a/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.h b/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.h index 5186b16c49be3..2fc114324830e 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.h +++ b/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.h @@ -27,7 +27,7 @@ namespace GPUCA_NAMESPACE::gpu class GPUTPCCompressionKernels : public GPUKernelTemplate { public: - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCCompression; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCCompression; } enum K : int32_t { step0attached = 0, diff --git a/GPU/GPUTracking/DataTypes/GPUSettings.h b/GPU/GPUTracking/DataTypes/GPUSettings.h index 499287dc3200d..d4cee937b727f 100644 --- a/GPU/GPUTracking/DataTypes/GPUSettings.h +++ b/GPU/GPUTracking/DataTypes/GPUSettings.h @@ -45,7 +45,7 @@ class GPUSettings RejectionStrategyA = 1, RejectionStrategyB = 2 }; - static CONSTEXPR const uint32_t TPC_MAX_TF_TIME_BIN = ((256 * 3564 + 2 * 8 - 2) / 8); + static constexpr const uint32_t TPC_MAX_TF_TIME_BIN = ((256 * 3564 + 2 * 8 - 2) / 8); }; // Settings describing the global run parameters diff --git a/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.h b/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.h index 88294b2b06c25..19b72c8a7be90 100644 --- a/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.h +++ b/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.h @@ -55,9 +55,9 @@ class GPUTPCGMPolynomialField void Print() const; - static CONSTEXPR const int32_t NTPCM = 10; // number of coefficients - static CONSTEXPR const int32_t NTRDM = 20; // number of coefficients for the TRD field - static CONSTEXPR const int32_t NITSM = 10; // number of coefficients for the ITS field + static constexpr const int32_t NTPCM = 10; // number of coefficients + static constexpr const int32_t NTRDM = 20; // number of coefficients for the TRD field + static constexpr const int32_t NITSM = 10; // number of coefficients for the ITS field GPUd() static void GetPolynomsTpc(float x, float y, float z, float f[NTPCM]); GPUd() static void GetPolynomsTrd(float x, float y, float z, float f[NTRDM]); diff --git a/GPU/GPUTracking/DataTypes/GPUTPCGeometry.h b/GPU/GPUTracking/DataTypes/GPUTPCGeometry.h index fcafa34547828..b77961c11c0d4 100644 --- a/GPU/GPUTracking/DataTypes/GPUTPCGeometry.h +++ b/GPU/GPUTracking/DataTypes/GPUTPCGeometry.h @@ -60,7 +60,7 @@ class GPUTPCGeometry // TODO: Make values constexpr const float mPadHeight[10] = {.75f, .75f, .75f, .75f, 1.f, 1.f, 1.2f, 1.2f, 1.5f, 1.5f}; const float mPadWidth[10] = {.416f, .420f, .420f, .436f, .6f, .6f, .608f, .588f, .604f, .607f}; - static CONSTEXPR float FACTOR_T2Z = 250.f / 512.f; // Used in compression, must remain constant at 250cm, 512 time bins! + static constexpr float FACTOR_T2Z = 250.f / 512.f; // Used in compression, must remain constant at 250cm, 512 time bins! public: GPUd() int32_t GetRegion(int32_t row) const { return mRegion[row]; } @@ -90,7 +90,7 @@ class GPUTPCGeometry // TODO: Make values constexpr const float mPadHeight[3] = {.75f, 1.f, 1.5f}; const float mPadWidth[3] = {.4f, .6f, .6f}; - static CONSTEXPR float FACTOR_T2Z = 250.f / 1024.f; // Used in compression, must remain constant at 250cm, 1024 time bins! + static constexpr float FACTOR_T2Z = 250.f / 1024.f; // Used in compression, must remain constant at 250cm, 1024 time bins! public: GPUd() int32_t GetRegion(int32_t row) const { return (row < 63 ? 0 : row < 63 + 64 ? 1 : 2); } @@ -102,10 +102,10 @@ class GPUTPCGeometry // TODO: Make values constexpr GPUd() int32_t EndOROC2() const { return GPUCA_ROW_COUNT; } #endif private: - static CONSTEXPR float FACTOR_Z2T = 1.f / FACTOR_T2Z; + static constexpr float FACTOR_Z2T = 1.f / FACTOR_T2Z; public: - GPUd() static CONSTEXPR float TPCLength() { return 250.f - 0.275f; } + GPUd() static constexpr float TPCLength() { return 250.f - 0.275f; } GPUd() float Row2X(int32_t row) const { return (mX[row]); } GPUd() float PadHeight(int32_t row) const { return (mPadHeight[GetRegion(row)]); } GPUd() float PadHeightByRegion(int32_t region) const { return (mPadHeight[region]); } diff --git a/GPU/GPUTracking/Definitions/GPUDefGPUParameters.h b/GPU/GPUTracking/Definitions/GPUDefGPUParameters.h index 7cd41e1a4f846..d246f77a50290 100644 --- a/GPU/GPUTracking/Definitions/GPUDefGPUParameters.h +++ b/GPU/GPUTracking/Definitions/GPUDefGPUParameters.h @@ -632,13 +632,8 @@ #define GPUCA_SORT_STARTHITS #endif -#if defined(__cplusplus) && __cplusplus >= 201703L #define GPUCA_NEW_ALIGNMENT (std::align_val_t{GPUCA_BUFFER_ALIGNMENT}) #define GPUCA_OPERATOR_NEW_ALIGNMENT ,GPUCA_NEW_ALIGNMENT -#else -#define GPUCA_NEW_ALIGNMENT -#define GPUCA_OPERATOR_NEW_ALIGNMENT -#endif -// clang-format on + // clang-format on #endif diff --git a/GPU/GPUTracking/Definitions/GPULogging.h b/GPU/GPUTracking/Definitions/GPULogging.h index 79f888501745f..e33c9463a2f48 100644 --- a/GPU/GPUTracking/Definitions/GPULogging.h +++ b/GPU/GPUTracking/Definitions/GPULogging.h @@ -44,7 +44,7 @@ fmt::fprintf(stderr, string "\n", ##__VA_ARGS__); \ throw std::exception(); \ } -#elif defined(GPUCA_STANDALONE) || defined(GPUCA_GPUCODE_DEVICE) || (defined(GPUCA_ALIROOT_LIB) && defined(GPUCA_GPUCODE) && defined(__cplusplus) && __cplusplus < 201703L) +#elif defined(GPUCA_STANDALONE) || defined(GPUCA_GPUCODE_DEVICE) || (defined(GPUCA_ALIROOT_LIB) && defined(GPUCA_GPUCODE)) // For standalone / CUDA / HIP, we just use printf, which should be available // Temporarily, we also have to handle CUDA on AliRoot with O2 defaults due to ROOT / CUDA incompatibilities #include diff --git a/GPU/GPUTracking/ITS/GPUITSFitterKernels.h b/GPU/GPUTracking/ITS/GPUITSFitterKernels.h index f4b120564f179..9b3d300fc2bec 100644 --- a/GPU/GPUTracking/ITS/GPUITSFitterKernels.h +++ b/GPU/GPUTracking/ITS/GPUITSFitterKernels.h @@ -30,7 +30,7 @@ class GPUITSTrack; class GPUITSFitterKernels : public GPUKernelTemplate { public: - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::ITSTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::ITSTracking; } template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& processors); diff --git a/GPU/GPUTracking/Merger/GPUTPCGMMerger.h b/GPU/GPUTracking/Merger/GPUTPCGMMerger.h index af5f7d177e6cc..931b58d41e21b 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMMerger.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMMerger.h @@ -66,7 +66,7 @@ class GPUTPCGMMerger : public GPUProcessor ~GPUTPCGMMerger() = default; GPUTPCGMMerger(const GPUTPCGMMerger&) = delete; const GPUTPCGMMerger& operator=(const GPUTPCGMMerger&) const = delete; - static CONSTEXPR const int32_t NSLICES = GPUCA_NSLICES; //* N slices + static constexpr const int32_t NSLICES = GPUCA_NSLICES; //* N slices struct memory { GPUAtomic(uint32_t) nRetryRefit; diff --git a/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.h b/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.h index 1d5d445a7de67..958d5081baf81 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.h @@ -26,7 +26,7 @@ namespace gpu class GPUTPCGMMergerGeneral : public GPUKernelTemplate { public: - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCMerging; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCMerging; } #if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) typedef GPUTPCGMMerger processorType; GPUhdi() static processorType* Processor(GPUConstantMem& processors) diff --git a/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.h b/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.h index 4abf4ecae9a7a..e54fb8885091d 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.h +++ b/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.h @@ -32,7 +32,7 @@ class GPUTPCGlobalDebugSortKernels : public GPUKernelTemplate globalTracks1 = 2, globalTracks2 = 3, borderTracks = 4 }; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCMerging; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCMerging; } typedef GPUTPCGMMerger processorType; GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return &processors.tpcMerger; } diff --git a/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.h b/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.h index d52a3f3fdedb5..9b99ffb8402c0 100644 --- a/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.h +++ b/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.h @@ -24,7 +24,7 @@ namespace o2::gpu class GPUTrackingRefitKernel : public GPUKernelTemplate { public: - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCCompression; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCCompression; } enum K : int32_t { mode0asGPU = 0, diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.h b/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.h index 86a1a66eeef43..8b96ad8e74183 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.h @@ -29,7 +29,7 @@ class GPUTPCCreateOccupancyMap : public GPUKernelTemplate enum K { defaultKernel = 0, fill = 0, fold = 1 }; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCSliceTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCSliceTracking; } template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& processors, Args... args); }; diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.h b/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.h index 916891c2035ef..2789621a7de5c 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.h @@ -34,7 +34,7 @@ class GPUTPCCreateSliceData : public GPUKernelTemplate }; typedef GPUconstantref() GPUTPCTracker processorType; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return processors.tpcTrackers; diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.h b/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.h index 367b4314814fe..5dc469e2654f5 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.h @@ -32,7 +32,7 @@ class GPUTPCGlobalTracking : public GPUKernelTemplate }; typedef GPUconstantref() GPUTPCTracker processorType; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return processors.tpcTrackers; @@ -52,7 +52,7 @@ class GPUTPCGlobalTrackingCopyNumbers : public GPUKernelTemplate { public: typedef GPUconstantref() GPUTPCTracker processorType; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return processors.tpcTrackers; diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.h b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.h index 23c1e21e87ab0..311fef5204c3d 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.h @@ -40,7 +40,7 @@ class GPUTPCNeighboursCleaner : public GPUKernelTemplate }; typedef GPUconstantref() GPUTPCTracker processorType; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return processors.tpcTrackers; diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.h b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.h index a121a0f14eb67..882428821ae84 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.h @@ -51,7 +51,7 @@ class GPUTPCNeighboursFinder : public GPUKernelTemplate }; typedef GPUconstantref() GPUTPCTracker processorType; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return processors.tpcTrackers; diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.h b/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.h index 50a3738501e2e..04001603a2a28 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.h @@ -30,7 +30,7 @@ class GPUTPCSectorDebugSortKernels : public GPUKernelTemplate hitData = 0, startHits = 1, sliceTracks = 2 }; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCSliceTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCSliceTracking; } typedef GPUTPCTracker processorType; GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return processors.tpcTrackers; } diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.cxx index 5177c48b6a834..48c490a6f5559 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.cxx @@ -233,7 +233,7 @@ GPUdii() int32_t GPUTPCSliceData::InitFromClusterData(int32_t nBlocks, int32_t n const uint32_t NumberOfClusters = EarlyTransformWithoutClusterNative ? NumberOfClustersInRow[rowIndex] : mem->ioPtrs.clustersNative->nClusters[iSlice][rowIndex]; const uint32_t RowOffset = EarlyTransformWithoutClusterNative ? RowOffsets[rowIndex] : (mem->ioPtrs.clustersNative->clusterOffset[iSlice][rowIndex] - mem->ioPtrs.clustersNative->clusterOffset[iSlice][0]); - CONSTEXPR const uint32_t maxN = 1u << (sizeof(calink) < 3 ? (sizeof(calink) * 8) : 24); + constexpr const uint32_t maxN = 1u << (sizeof(calink) < 3 ? (sizeof(calink) * 8) : 24); GPUTPCRow& row = mRows[rowIndex]; if (iThread == 0) { row.mFirstHitInBinOffset = CAMath::nextMultipleOf(GetGridSize(RowOffset, rowIndex) + rowIndex * GPUCA_ROWALIGNMENT / sizeof(int32_t)); @@ -318,7 +318,7 @@ GPUdii() int32_t GPUTPCSliceData::InitFromClusterData(int32_t nBlocks, int32_t n GPUbarrier(); const GPUTPCGrid& grid = row.mGrid; const int32_t numberOfBins = grid.N(); - CONSTEXPR const int32_t maxBins = sizeof(calink) < 4 ? (int32_t)(1ul << (sizeof(calink) * 8)) : 0x7FFFFFFF; // NOLINT: false warning + constexpr const int32_t maxBins = sizeof(calink) < 4 ? (int32_t)(1ul << (sizeof(calink) * 8)) : 0x7FFFFFFF; // NOLINT: false warning if (sizeof(calink) < 4 && numberOfBins >= maxBins) { if (iThread == 0) { mem->errorCodes.raiseError(GPUErrors::ERROR_SLICEDATA_BIN_OVERFLOW, iSlice * 1000 + rowIndex, numberOfBins, maxBins); diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.h b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.h index b2b9bfb355fa1..ed49fad8fc6dc 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.h @@ -40,7 +40,7 @@ class GPUTPCStartHitsFinder : public GPUKernelTemplate }; typedef GPUconstantref() GPUTPCTracker processorType; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return processors.tpcTrackers; diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.h b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.h index 838fcf7e7d7e1..4c937b0414e30 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.h @@ -40,7 +40,7 @@ class GPUTPCStartHitsSorter : public GPUKernelTemplate }; typedef GPUconstantref() GPUTPCTracker processorType; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return processors.tpcTrackers; diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.h b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.h index b1ef74b9896c1..a961501207911 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.h @@ -99,7 +99,7 @@ class GPUTPCTrackletConstructor GPUd() static int32_t GPUTPCTrackletConstructorGlobalTracking(GPUconstantref() GPUTPCTracker& tracker, GPUsharedref() T& sMem, GPUTPCTrackParam& tParam, int32_t startrow, int32_t increment, int32_t iTracklet, calink* rowHits); typedef GPUconstantref() GPUTPCTracker processorType; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return processors.tpcTrackers; diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.h b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.h index af13b30022e6f..115f0785fc212 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.h @@ -44,7 +44,7 @@ class GPUTPCTrackletSelector : public GPUKernelTemplate }; typedef GPUconstantref() GPUTPCTracker processorType; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TPCSliceTracking; } GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return processors.tpcTrackers; diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.h index ffb13dbbb0607..8a0d8089ad1f5 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.h @@ -49,7 +49,7 @@ class GPUTPCCFChargeMapFiller : public GPUKernelTemplate } #endif - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCClusterFinding; } diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.h index 0440121175f3a..1e1b94cd43b74 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.h @@ -45,7 +45,7 @@ class GPUTPCCFCheckPadBaseline : public GPUKernelTemplate } #endif - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCClusterFinding; } diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.h index 928a23db7c025..ff8820efc1d69 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.h @@ -51,7 +51,7 @@ class GPUTPCCFClusterizer : public GPUKernelTemplate } #endif - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCClusterFinding; } diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.cxx index 5413878421884..daacbc0994295 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.cxx @@ -300,7 +300,7 @@ GPUd() void GPUTPCCFDecodeZSLink::DecodeTBSingleThread( { const CfFragment& fragment = clusterer.mPmemory->fragment; - if CONSTEXPR (TPCZSHDRV2::TIGHTLY_PACKED_V3) { + if constexpr (TPCZSHDRV2::TIGHTLY_PACKED_V3) { uint32_t byte = 0, bits = 0, nSamplesWritten = 0, rawFECChannel = 0; @@ -396,7 +396,7 @@ GPUd() void GPUTPCCFDecodeZSLink::DecodeTBMultiThread( uint32_t adc = 0; - if CONSTEXPR (TPCZSHDRV2::TIGHTLY_PACKED_V3) { + if constexpr (TPCZSHDRV2::TIGHTLY_PACKED_V3) { // Try to access adcData with 4 byte reads instead of 1 byte. // You'd think this would improve performace, but it's actually slower... @@ -668,7 +668,7 @@ GPUd() uint16_t GPUTPCCFDecodeZSDenseLink::DecodeTB( [[maybe_unused]] const uint8_t* nextPage) { - if CONSTEXPR (DecodeInParallel) { + if constexpr (DecodeInParallel) { return DecodeTBMultiThread(clusterer, smem, iThread, page, pageDigitOffset, rawDataHeader, firstHBF, cru, payloadEnd, nextPage); } else { uint16_t nSamplesWritten = 0; @@ -693,7 +693,7 @@ GPUd() uint16_t GPUTPCCFDecodeZSDenseLink::DecodeTBMultiThread( [[maybe_unused]] const uint8_t* nextPage) { #define MAYBE_PAGE_OVERFLOW(pagePtr) \ - if CONSTEXPR (PayloadExtendsToNextPage) { \ + if constexpr (PayloadExtendsToNextPage) { \ if (pagePtr >= payloadEnd && pagePtr < nextPage) { \ ptrdiff_t diff = pagePtr - payloadEnd; \ pagePtr = nextPage; \ @@ -840,7 +840,7 @@ GPUd() uint16_t GPUTPCCFDecodeZSDenseLink::DecodeTBSingleThread( [[maybe_unused]] const uint8_t* nextPage) { #define MAYBE_PAGE_OVERFLOW(pagePtr) \ - if CONSTEXPR (PayloadExtendsToNextPage) { \ + if constexpr (PayloadExtendsToNextPage) { \ if (pagePtr >= payloadEnd && pagePtr < nextPage) { \ ptrdiff_t diff = pagePtr - payloadEnd; \ pagePtr = nextPage; \ diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.h index 3d5f4dd4380d4..bf34b78227f19 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.h @@ -55,7 +55,7 @@ class GPUTPCCFDecodeZS : public GPUKernelTemplate } #endif - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCClusterFinding; } @@ -76,7 +76,7 @@ class GPUTPCCFDecodeZSLinkBase : public GPUKernelTemplate } #endif - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCClusterFinding; } diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.h index f3f572646751a..0fb27c07e2825 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.h @@ -44,7 +44,7 @@ class GPUTPCCFDeconvolution : public GPUKernelTemplate } #endif - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCClusterFinding; } diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.h index 681c3c9b5c380..da486741ea62c 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.h @@ -34,7 +34,7 @@ class GPUTPCCFGather : public GPUKernelTemplate } #endif - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCClusterFinding; } diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.h index bb1473ec832df..b1c266cf5fed1 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.h @@ -46,7 +46,7 @@ class GPUTPCCFMCLabelFlattener : public GPUKernelTemplate } #endif - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCClusterFinding; } diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.h index fe518a3a96d39..41f463fd4fe89 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.h @@ -48,7 +48,7 @@ class GPUTPCCFNoiseSuppression : public GPUKernelTemplate } #endif - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCClusterFinding; } diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.h index c0a263f61eaa6..4aa3574abd3ff 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.h @@ -44,7 +44,7 @@ class GPUTPCCFPeakFinder : public GPUKernelTemplate } #endif - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCClusterFinding; } diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.h index 2ea7c8012e53f..8b2206da3088c 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.h @@ -46,7 +46,7 @@ class GPUTPCCFStreamCompaction : public GPUKernelTemplate } #endif - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCClusterFinding; } diff --git a/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.h b/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.h index cf743d059b3f7..5bfe05de0c631 100644 --- a/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.h +++ b/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.h @@ -24,7 +24,7 @@ namespace gpu class GPUTPCConvertKernel : public GPUKernelTemplate { public: - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCConversion; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCConversion; } template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& processors); }; diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDGeometry.h b/GPU/GPUTracking/TRDTracking/GPUTRDGeometry.h index 8cde81cec9626..49a6178dbbff1 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDGeometry.h +++ b/GPU/GPUTracking/TRDTracking/GPUTRDGeometry.h @@ -175,7 +175,7 @@ class GPUTRDGeometry GPUd() int32_t GetRowMax(int32_t layer, int32_t stack, int32_t /* sector */) const { return 0; } GPUd() bool ChamberInGeometry(int32_t det) const { return false; } - static CONSTEXPR const int32_t kNstack = 0; + static constexpr const int32_t kNstack = 0; }; } // namespace gpu } // namespace GPUCA_NAMESPACE diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTracker.h b/GPU/GPUTracking/TRDTracking/GPUTRDTracker.h index 96a5547ad28de..d688e2957846d 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTracker.h +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTracker.h @@ -194,7 +194,7 @@ class GPUTRDTracker_t : public GPUProcessor float mAngleToDyC; // parameterization for conversion track angle -> tracklet deflection /// ---- end error parametrization ---- bool mDebugOutput; // store debug output - static CONSTEXPR const float sRadialOffset = -0.1f; // due to (possible) mis-calibration of t0 -> will become obsolete when tracklet conversion is done outside of the tracker + static constexpr const float sRadialOffset = -0.1f; // due to (possible) mis-calibration of t0 -> will become obsolete when tracklet conversion is done outside of the tracker float mMaxEta; // TPC tracks with higher eta are ignored float mRoadZ; // in z, a constant search road is used float mZCorrCoefNRC; // tracklet z-position depends linearly on track dip angle diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.cxx b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.cxx index a69bb9394f735..336e54e9efc67 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.cxx +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.cxx @@ -27,10 +27,7 @@ GPUdii() void GPUTRDTrackerKernels::Thread(int32_t nBlocks, int32_t nThreads, in { auto* trdTracker = &processors.getTRDTracker(); #ifndef GPUCA_GPUCODE_DEVICE -#if defined(__cplusplus) && __cplusplus >= 201703L - if constexpr (std::is_same_v) -#endif - { + if constexpr (std::is_same_v) { if (externalInstance) { trdTracker = externalInstance; } diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.h b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.h index 79e996ab79c71..4430ce850fb14 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.h +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.h @@ -28,7 +28,7 @@ class GPUTRDTrackerKernels : public GPUKernelTemplate enum K { defaultKernel = 0, gpuVersion = 0, o2Version = 1 }; - GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TRDTracking; } + GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUCA_RECO_STEP::TRDTracking; } template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& processors, T* externalInstance = nullptr); }; diff --git a/GPU/GPUTracking/utils/qconfigrtc.h b/GPU/GPUTracking/utils/qconfigrtc.h index 54114cb3846f7..97365a6412c5d 100644 --- a/GPU/GPUTracking/utils/qconfigrtc.h +++ b/GPU/GPUTracking/utils/qconfigrtc.h @@ -30,15 +30,11 @@ template static std::string qConfigPrintRtc(const T& tSrc, bool useConstexpr) { -#if defined(__cplusplus) && __cplusplus >= 201703L std::stringstream out; #define QCONFIG_PRINT_RTC #include "qconfig.h" #undef QCONFIG_PRINT_RTC return out.str(); -#else - throw std::runtime_error("not supported"); -#endif } #define QCONFIG_CONVERT_RTC diff --git a/GPU/GPUTracking/utils/strtag.h b/GPU/GPUTracking/utils/strtag.h index 69e79de004779..24c527ca11a8c 100644 --- a/GPU/GPUTracking/utils/strtag.h +++ b/GPU/GPUTracking/utils/strtag.h @@ -19,11 +19,7 @@ #include template -#if defined(__cplusplus) && __cplusplus >= 201402L -constexpr -#endif - T - qStr2Tag(const char* str) +constexpr T qStr2Tag(const char* str) { if (strlen(str) != sizeof(T)) { throw std::runtime_error("Invalid tag length"); diff --git a/GPU/TPCFastTransformation/Spline2D.h b/GPU/TPCFastTransformation/Spline2D.h index ccd68b029c0f1..64c1b487987fc 100644 --- a/GPU/TPCFastTransformation/Spline2D.h +++ b/GPU/TPCFastTransformation/Spline2D.h @@ -22,7 +22,7 @@ #include "FlatObject.h" #include "GPUCommonDef.h" -#if !defined(__ROOTCLING__) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC) && defined(__cplusplus) && __cplusplus >= 201703L +#if !defined(__ROOTCLING__) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC) #include #include #endif diff --git a/GPU/TPCFastTransformation/Spline2DSpec.h b/GPU/TPCFastTransformation/Spline2DSpec.h index ab8c3cb39754d..b626df3fa7e51 100644 --- a/GPU/TPCFastTransformation/Spline2DSpec.h +++ b/GPU/TPCFastTransformation/Spline2DSpec.h @@ -22,7 +22,7 @@ #include "GPUCommonDef.h" #include "SplineUtil.h" -#if !defined(__ROOTCLING__) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC) && defined(__cplusplus) && __cplusplus >= 201703L +#if !defined(__ROOTCLING__) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC) #include #include #endif diff --git a/GPU/TPCFastTransformation/SplineSpec.h b/GPU/TPCFastTransformation/SplineSpec.h index d4e64b8dad1f6..f9d3ec0613f64 100644 --- a/GPU/TPCFastTransformation/SplineSpec.h +++ b/GPU/TPCFastTransformation/SplineSpec.h @@ -22,7 +22,7 @@ #include "GPUCommonDef.h" #include "SplineUtil.h" -#if !defined(__ROOTCLING__) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC) && defined(__cplusplus) && __cplusplus >= 201703L +#if !defined(__ROOTCLING__) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC) #include #include #endif diff --git a/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.h b/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.h index 99550cc12219f..026338b3380fa 100644 --- a/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.h +++ b/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.h @@ -21,7 +21,7 @@ #include "FlatObject.h" #include "GPUCommonDef.h" -#if !defined(__ROOTCLING__) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC) && defined(__cplusplus) && __cplusplus >= 201703L +#if !defined(__ROOTCLING__) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC) #include #include #endif @@ -331,7 +331,7 @@ GPUdi() void IrregularSpline2D3D::getSplineVec(const float* correctedData, float // Same as getSpline, but using vectorized calculation. // \param correctedData should be at least 128-bit aligned -#if !defined(__ROOTCLING__) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC) && defined(__cplusplus) && __cplusplus >= 201703L +#if !defined(__ROOTCLING__) && !defined(GPUCA_GPUCODE) && !defined(GPUCA_NO_VC) const IrregularSpline1D& gridU = getGridU(); const IrregularSpline1D& gridV = getGridV(); int32_t nu = gridU.getNumberOfKnots();