Skip to content

Commit 0ecf843

Browse files
committed
GPU TPC: Compile-time disable V/M-Shape correction during RTC
1 parent 31e6731 commit 0ecf843

7 files changed

Lines changed: 16 additions & 1 deletion

File tree

GPU/Common/GPUCommonDef.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@
9797
#define GPUCA_DEBUG_STREAMER_CHECK(...)
9898
#endif
9999

100+
#ifndef GPUCA_RTC_SPECIAL_CODE
101+
#define GPUCA_RTC_SPECIAL_CODE(...)
102+
#endif
100103

101104
// API Definitions for GPU Compilation
102105
#include "GPUCommonDefAPI.h"

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ QGET_LD_BINARY_SYMBOLS(GPUReconstructionCUDArtc_command_arch);
3939
int GPUReconstructionCUDA::genRTC(std::string& filename, unsigned int& nCompile)
4040
{
4141
#ifndef GPUCA_ALIROOT_LIB
42-
std::string rtcparam = GPUParamRTC::generateRTCCode(param(), mProcessingSettings.rtc.optConstexpr);
42+
std::string rtcparam = std::string(mProcessingSettings.rtc.optSpecialCode ? "#define GPUCA_RTC_SPECIAL_CODE(...) __VA_ARGS__\n" : "#define GPUCA_RTC_SPECIAL_CODE(...)\n") + GPUParamRTC::generateRTCCode(param(), mProcessingSettings.rtc.optConstexpr);
4343
if (filename == "") {
4444
filename = "/tmp/o2cagpu_rtc_";
4545
}

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDArtc.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#define GPUCA_GPUCODE_GENRTC
1616
#define GPUCA_GPUCODE_COMPILEKERNELS
17+
#define GPUCA_RTC_SPECIAL_CODE(...) GPUCA_RTC_SPECIAL_CODE(__VA_ARGS__)
1718
#include "GPUReconstructionCUDADef.h"
1819
#include "GPUReconstructionIncludesDeviceAll.h"
1920

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ EndConfig()
198198
BeginSubConfig(GPUSettingsProcessingRTC, rtc, configStandalone.proc, "RTC", 0, "Processing settings", proc_rtc)
199199
AddOption(cacheOutput, bool, false, "", 0, "Cache RTC compilation results")
200200
AddOption(optConstexpr, bool, true, "", 0, "Replace constant variables by static constexpr expressions")
201+
AddOption(optSpecialCode, signed char, -1, "", 0, "Insert GPUCA_RTC_SPECIAL_CODE special code during RTC")
201202
AddOption(compilePerKernel, bool, true, "", 0, "Run one RTC compilation per kernel")
202203
AddOption(enable, bool, false, "", 0, "Use RTC to optimize GPU code")
203204
AddOption(runTest, int, 0, "", 0, "Do not run the actual benchmark, but just test RTC compilation (1 full test, 2 test only compilation)")

GPU/GPUTracking/Standalone/Benchmark/standalone.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,9 @@ int SetupReconstruction()
434434
procSet.eventDisplay = nullptr;
435435
}
436436
}
437+
if (configStandalone.proc.rtc.optSpecialCode == -1) {
438+
configStandalone.proc.rtc.optSpecialCode = configStandalone.testSyncAsync || configStandalone.testSync;
439+
}
437440

438441
rec->SetSettings(&grp, &recSet, &procSet, &steps);
439442
if (configStandalone.proc.doublePipeline) {
@@ -453,6 +456,7 @@ int SetupReconstruction()
453456
procSet.runQA = false;
454457
procSet.eventDisplay = eventDisplay.get();
455458
procSet.runCompressionStatistics = 0;
459+
procSet.rtc.optSpecialCode = 0;
456460
if (recSet.tpc.rejectionStrategy >= GPUSettings::RejectionStrategyB) {
457461
procSet.tpcInputWithClusterRejection = 1;
458462
}

GPU/TPCFastTransformation/TPCFastTransform.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ GPUdi() void TPCFastTransform::getTOFcorrection(int slice, int /*row*/, float x,
446446

447447
GPUdi() void TPCFastTransform::TransformInternal(int slice, int row, float& u, float& v, float& x, const TPCFastTransform* ref, const TPCFastTransform* ref2, float scale, float scale2, int scaleMode) const
448448
{
449+
GPUCA_RTC_SPECIAL_CODE(ref2 = nullptr; scale2 = 0.f;);
449450
if (mApplyCorrection) {
450451
float dx = 0.f, du = 0.f, dv = 0.f;
451452
if ((scale >= 0.f) || (scaleMode == 1) || (scaleMode == 2)) {
@@ -776,6 +777,7 @@ GPUdi() float TPCFastTransform::getMaxDriftTime(int slice) const
776777

777778
GPUdi() void TPCFastTransform::InverseTransformYZtoX(int slice, int row, float y, float z, float& x, const TPCFastTransform* ref, const TPCFastTransform* ref2, float scale, float scale2, int scaleMode) const
778779
{
780+
GPUCA_RTC_SPECIAL_CODE(ref2 = nullptr; scale2 = 0.f;);
779781
/// Transformation y,z -> x
780782
float u = 0, v = 0;
781783
getGeometry().convLocalToUV(slice, y, z, u, v);
@@ -816,6 +818,7 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoX(int slice, int row, float y
816818

817819
GPUdi() void TPCFastTransform::InverseTransformYZtoNominalYZ(int slice, int row, float y, float z, float& ny, float& nz, const TPCFastTransform* ref, const TPCFastTransform* ref2, float scale, float scale2, int scaleMode) const
818820
{
821+
GPUCA_RTC_SPECIAL_CODE(ref2 = nullptr; scale2 = 0.f;);
819822
/// Transformation y,z -> x
820823
float u = 0, v = 0, un = 0, vn = 0;
821824
getGeometry().convLocalToUV(slice, y, z, u, v);

GPU/Workflow/src/GPUWorkflowSpec.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ void GPURecoWorkflowSpec::init(InitContext& ic)
187187
if (mConfParam->synchronousProcessing) {
188188
mConfig->configReconstruction.useMatLUT = false;
189189
}
190+
if (mConfig->configProcessing.rtc.optSpecialCode == -1) {
191+
mConfig->configProcessing.rtc.optSpecialCode = mConfParam->synchronousProcessing;
192+
}
190193

191194
// Configure the "GPU workflow" i.e. which steps we run on the GPU (or CPU)
192195
if (mSpecConfig.outputTracks || mSpecConfig.outputCompClusters || mSpecConfig.outputCompClustersFlat) {

0 commit comments

Comments
 (0)