Skip to content

Commit 8de7193

Browse files
committed
GPU: Add GPUCA_RTC_CONSTEXPR macro for constexpr only in RTC
1 parent 751bb12 commit 8de7193

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

GPU/Common/GPUCommonDef.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
#define GPUCA_RTC_SPECIAL_CODE(...)
7373
#endif
7474

75+
#ifndef GPUCA_RTC_CONSTEXPR
76+
#define GPUCA_RTC_CONSTEXPR
77+
#endif
78+
7579
#ifndef GPUCA_DETERMINISTIC_CODE
7680
#ifdef GPUCA_DETERMINISTIC_MODE
7781
#define GPUCA_DETERMINISTIC_CODE(det, indet) det // In deterministic mode, take deterministic code path

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ int32_t GPUReconstructionCUDA::genRTC(std::string& filename, uint32_t& nCompile)
3838
{
3939
std::string rtcparam = std::string("#define GPUCA_RTC_CODE\n") +
4040
std::string(GetProcessingSettings().rtc.optSpecialCode ? "#define GPUCA_RTC_SPECIAL_CODE(...) __VA_ARGS__\n" : "#define GPUCA_RTC_SPECIAL_CODE(...)\n") +
41+
std::string(GetProcessingSettings().rtc.optConstexpr ? "#define GPUCA_RTC_CONSTEXPR constexpr\n" : "#define GPUCA_RTC_CONSTEXPR\n") +
4142
GPUParamRTC::generateRTCCode(param(), GetProcessingSettings().rtc.optConstexpr);
4243
if (filename == "") {
4344
filename = "/tmp/o2cagpu_rtc_";

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDArtc.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Keep some preprocessor calls unprocessed
1919
#define GPUCA_RTC_SPECIAL_CODE(...) GPUCA_RTC_SPECIAL_CODE(__VA_ARGS__)
2020
#define GPUCA_DETERMINISTIC_CODE(...) GPUCA_DETERMINISTIC_CODE(__VA_ARGS__)
21+
#define GPUCA_RTC_CONSTEXPR GPUCA_RTC_CONSTEXPR
2122

2223
// GPUReconstructionCUDAIncludesSystem.h prependended by CMakewithout preprocessor running
2324
#include "GPUReconstructionCUDADef.h"

0 commit comments

Comments
 (0)