Skip to content

Commit 0ce95a6

Browse files
committed
GPU: Fix CUDA RTC, currently does not support AddOptionArrayRTC and some other fixes
1 parent c8d5874 commit 0ce95a6

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

GPU/GPUTracking/Base/GPUConstantMem.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,16 @@ union GPUConstantMemCopyable {
125125

126126
#if defined(GPUCA_GPUCODE) && defined(GPUCA_NOCOMPAT)
127127
static constexpr size_t gGPUConstantMemBufferSize = (sizeof(GPUConstantMem) + sizeof(uint4) - 1);
128-
#ifndef GPUCA_GPUCODE_HOSTONLY
129-
#if defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM)
128+
#endif
129+
} // namespace gpu
130+
} // namespace GPUCA_NAMESPACE
131+
#if defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM) && !defined(GPUCA_GPUCODE_HOSTONLY)
130132
GPUconstant() GPUCA_NAMESPACE::gpu::GPUConstantMemCopyable gGPUConstantMemBuffer;
131133
#endif // GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM
132-
#endif // !GPUCA_GPUCODE_HOSTONLY
133-
#endif
134+
namespace GPUCA_NAMESPACE
135+
{
136+
namespace gpu
137+
{
134138

135139
// Must be placed here, to avoid circular header dependency
136140
GPUdi() GPUconstantref() const MEM_CONSTANT(GPUConstantMem) * GPUProcessor::GetConstantMem() const

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cu

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ int GPUReconstructionCUDA::genRTC()
173173
printf("Running command %s\n", command.c_str());
174174
}
175175
if (system(command.c_str())) {
176+
if (mProcessingSettings.debugLevel >= 3) {
177+
printf("Source code file: %s", filename.c_str());
178+
}
176179
throw std::runtime_error("Error during CUDA compilation");
177180
}
178181
}

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ AddOptionRTC(extraClusterErrorSplitPadSharedSingleY2, float, 0.03f, "", 0, "Addi
7777
AddOptionRTC(extraClusterErrorFactorSplitPadSharedSingleY2, float, 3.0f, "", 0, "Multiplicative extra cluster error for Y2 if splitpad, shared, or single set")
7878
AddOptionRTC(extraClusterErrorSplitTimeSharedSingleZ2, float, 0.03f, "", 0, "Additive extra cluster error for Z2 if splittime, shared, or single set")
7979
AddOptionRTC(extraClusterErrorFactorSplitTimeSharedSingleZ2, float, 3.0f, "", 0, "Multiplicative extra cluster error for Z2 if splittime, shared, or single set")
80-
AddOptionArrayRTC(errorsCECrossing, float, 5, (0.f, 0.f, 0.f, 0.f, 0.f), "", 0, "Extra errors to add to track when crossing CE, depending on addErrorsCECrossing")
80+
AddOptionArray(errorsCECrossing, float, 5, (0.f, 0.f, 0.f, 0.f, 0.f), "", 0, "Extra errors to add to track when crossing CE, depending on addErrorsCECrossing") // BUG: CUDA cannot yet hand AddOptionArrayRTC
8181
AddOptionRTC(globalTrackingYRangeUpper, float, 0.85f, "", 0, "Inner portion of y-range in slice that is not used in searching for global track candidates")
8282
AddOptionRTC(globalTrackingYRangeLower, float, 0.85f, "", 0, "Inner portion of y-range in slice that is not used in searching for global track candidates")
8383
AddOptionRTC(trackFollowingYFactor, float, 4.f, "", 0, "Weight of y residual vs z residual in tracklet constructor")
@@ -89,7 +89,7 @@ AddOptionRTC(maxTimeBinAboveThresholdIn1000Bin, unsigned short, 500, "", 0, "Exc
8989
AddOptionRTC(maxConsecTimeBinAboveThreshold, unsigned short, 200, "", 0, "Except pad from cluster finding if number of consecutive charges in a fragment is above this baseline (disable = 0)")
9090
AddOptionRTC(noisyPadSaturationThreshold, unsigned short, 700, "", 0, "Threshold where a timebin is considered saturated, disabling the noisy pad check for that pad")
9191
AddOptionRTC(trackFitCovLimit, unsigned short, 1000, "", 0, "Abort fit when y/z cov exceed the limit")
92-
AddOption(addErrorsCECrossing, unsigned char, 0, "", 0, "Add additional custom track errors when crossing CE, 0 = no custom errors but att 0.5 to sigma_z^2, 1 = only to cov diagonal, 2 = preserve correlations")
92+
AddOptionRTC(addErrorsCECrossing, unsigned char, 0, "", 0, "Add additional custom track errors when crossing CE, 0 = no custom errors but att 0.5 to sigma_z^2, 1 = only to cov diagonal, 2 = preserve correlations")
9393
AddOptionRTC(trackMergerMinPartHits, unsigned char, 10, "", 0, "Minimum hits of track part during track merging")
9494
AddOptionRTC(trackMergerMinTotalHits, unsigned char, 20, "", 0, "Minimum total of track part during track merging")
9595
AddOptionRTC(mergerCERowLimit, unsigned char, 5, "", 0, "Distance from first / last row in order to attempt merging accross CE")
@@ -132,7 +132,7 @@ AddOptionRTC(mergerReadFromTrackerDirectly, char, 1, "", 0, "Forward data direct
132132
AddOptionRTC(dropSecondaryLegsInOutput, char, 1, "", 0, "Do not store secondary legs of looping track in TrackTPC")
133133
AddOptionRTC(enablePID, char, 1, "", 0, "Enable PID response")
134134
AddOptionRTC(PID_useNsigma, char, 1, "", 0, "Use nSigma instead of absolute distance in PID response")
135-
AddOptionArrayRTC(PID_remap, char, 9, (0, 1, 2, 3, 4, 5, 6, 7, 8), "", 0, "Remap Ipid to PID_reamp[Ipid] (no remap if<0)")
135+
AddOptionArray(PID_remap, char, 9, (0, 1, 2, 3, 4, 5, 6, 7, 8), "", 0, "Remap Ipid to PID_reamp[Ipid] (no remap if<0)") // BUG: CUDA cannot yet hand AddOptionArrayRTC
136136
AddHelp("help", 'h')
137137
EndConfig()
138138

0 commit comments

Comments
 (0)