Skip to content

Commit 89b35ba

Browse files
committed
GPU: Workaround for Clang Frontend issue
This is fixed with Clang >= 20 and C++23 (P2280R4)
1 parent 760f73e commit 89b35ba

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ 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+
#ifndef GPUCA_HIP_WORKAROUND_CONSTEXPR // TODO: Fixme, once we have C++ P2280R4 in Clang
4142
std::string(GetProcessingSettings().rtc.optConstexpr ? "#define GPUCA_RTC_CONSTEXPR constexpr\n" : "#define GPUCA_RTC_CONSTEXPR\n") +
43+
#else
44+
std::string("#define GPUCA_RTC_CONSTEXPR\n") +
45+
#endif
4246
GPUParamRTC::generateRTCCode(param(), GetProcessingSettings().rtc.optConstexpr);
4347
if (filename == "") {
4448
filename = "/tmp/o2cagpu_rtc_";

GPU/GPUTracking/Base/hip/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,8 @@ add_dependencies(GPUTrackingHIPExternalProvider O2::GPUTracking) # must not depe
270270
if(NOT DEFINED GPUCA_HIP_HIPIFY_FROM_CUDA OR "${GPUCA_HIP_HIPIFY_FROM_CUDA}")
271271
add_dependencies(GPUTrackingHIPExternalProvider ${MODULE}_HIPIFIED)
272272
endif()
273+
274+
set_source_files_properties("${GPUCA_HIP_SOURCE_DIR}/GPUReconstructionHIPGenRTC.cxx"
275+
TARGET_DIRECTORY O2::GPUTrackingHIP
276+
PROPERTIES
277+
COMPILE_DEFINITIONS "GPUCA_HIP_WORKAROUND_CONSTEXPR")

0 commit comments

Comments
 (0)