Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions GPU/Common/GPUCommonDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
#define GPUCA_DEBUG_STREAMER_CHECK(...)
#endif

#ifndef GPUCA_RTC_SPECIAL_CODE
#define GPUCA_RTC_SPECIAL_CODE(...)
#endif

// API Definitions for GPU Compilation
#include "GPUCommonDefAPI.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ QGET_LD_BINARY_SYMBOLS(GPUReconstructionCUDArtc_command_arch);
int GPUReconstructionCUDA::genRTC(std::string& filename, unsigned int& nCompile)
{
#ifndef GPUCA_ALIROOT_LIB
std::string rtcparam = GPUParamRTC::generateRTCCode(param(), mProcessingSettings.rtc.optConstexpr);
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);
if (filename == "") {
filename = "/tmp/o2cagpu_rtc_";
}
Expand Down
1 change: 1 addition & 0 deletions GPU/GPUTracking/Base/cuda/GPUReconstructionCUDArtc.cu
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#define GPUCA_GPUCODE_GENRTC
#define GPUCA_GPUCODE_COMPILEKERNELS
#define GPUCA_RTC_SPECIAL_CODE(...) GPUCA_RTC_SPECIAL_CODE(__VA_ARGS__)
#include "GPUReconstructionCUDADef.h"
#include "GPUReconstructionIncludesDeviceAll.h"

Expand Down
1 change: 1 addition & 0 deletions GPU/GPUTracking/Definitions/GPUSettingsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ EndConfig()
BeginSubConfig(GPUSettingsProcessingRTC, rtc, configStandalone.proc, "RTC", 0, "Processing settings", proc_rtc)
AddOption(cacheOutput, bool, false, "", 0, "Cache RTC compilation results")
AddOption(optConstexpr, bool, true, "", 0, "Replace constant variables by static constexpr expressions")
AddOption(optSpecialCode, signed char, -1, "", 0, "Insert GPUCA_RTC_SPECIAL_CODE special code during RTC")
AddOption(compilePerKernel, bool, true, "", 0, "Run one RTC compilation per kernel")
AddOption(enable, bool, false, "", 0, "Use RTC to optimize GPU code")
AddOption(runTest, int, 0, "", 0, "Do not run the actual benchmark, but just test RTC compilation (1 full test, 2 test only compilation)")
Expand Down
4 changes: 4 additions & 0 deletions GPU/GPUTracking/Standalone/Benchmark/standalone.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ int SetupReconstruction()
procSet.eventDisplay = nullptr;
}
}
if (configStandalone.proc.rtc.optSpecialCode == -1) {
configStandalone.proc.rtc.optSpecialCode = configStandalone.testSyncAsync || configStandalone.testSync;
}

rec->SetSettings(&grp, &recSet, &procSet, &steps);
if (configStandalone.proc.doublePipeline) {
Expand All @@ -453,6 +456,7 @@ int SetupReconstruction()
procSet.runQA = false;
procSet.eventDisplay = eventDisplay.get();
procSet.runCompressionStatistics = 0;
procSet.rtc.optSpecialCode = 0;
if (recSet.tpc.rejectionStrategy >= GPUSettings::RejectionStrategyB) {
procSet.tpcInputWithClusterRejection = 1;
}
Expand Down
3 changes: 3 additions & 0 deletions GPU/TPCFastTransformation/TPCFastTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ GPUdi() void TPCFastTransform::getTOFcorrection(int slice, int /*row*/, float x,

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
{
GPUCA_RTC_SPECIAL_CODE(ref2 = nullptr; scale2 = 0.f;);
if (mApplyCorrection) {
float dx = 0.f, du = 0.f, dv = 0.f;
if ((scale >= 0.f) || (scaleMode == 1) || (scaleMode == 2)) {
Expand Down Expand Up @@ -776,6 +777,7 @@ GPUdi() float TPCFastTransform::getMaxDriftTime(int slice) const

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
{
GPUCA_RTC_SPECIAL_CODE(ref2 = nullptr; scale2 = 0.f;);
/// Transformation y,z -> x
float u = 0, v = 0;
getGeometry().convLocalToUV(slice, y, z, u, v);
Expand Down Expand Up @@ -816,6 +818,7 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoX(int slice, int row, float y

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
{
GPUCA_RTC_SPECIAL_CODE(ref2 = nullptr; scale2 = 0.f;);
/// Transformation y,z -> x
float u = 0, v = 0, un = 0, vn = 0;
getGeometry().convLocalToUV(slice, y, z, u, v);
Expand Down
3 changes: 3 additions & 0 deletions GPU/Workflow/src/GPUWorkflowSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ void GPURecoWorkflowSpec::init(InitContext& ic)
if (mConfParam->synchronousProcessing) {
mConfig->configReconstruction.useMatLUT = false;
}
if (mConfig->configProcessing.rtc.optSpecialCode == -1) {
mConfig->configProcessing.rtc.optSpecialCode = mConfParam->synchronousProcessing;
}

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