Skip to content

Commit 8cd5556

Browse files
authored
Make it explicit we are currently using a signed char (#13375)
1 parent 740e425 commit 8cd5556

File tree

3 files changed

+48
-43
lines changed

3 files changed

+48
-43
lines changed

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -126,34 +126,34 @@ AddOptionRTC(cfInnerThreshold, unsigned char, 0, "", 0, "Cluster Finder extends
126126
AddOptionRTC(cfMinSplitNum, unsigned char, 1, "", 0, "Minimum number of split charges in a cluster for the cluster to be marked as split")
127127
AddOptionRTC(cfNoiseSuppressionEpsilon, unsigned char, 10, "", 0, "Cluster Finder: Difference between peak and charge for the charge to count as a minima during noise suppression")
128128
AddOptionRTC(cfNoiseSuppressionEpsilonRelative, unsigned char, 76, "", 0, "Cluster Finder: Difference between peak and charge for the charge to count as a minima during noise suppression, relative as fraction of 255")
129-
AddOptionRTC(nWays, char, 3, "", 0, "Do N fit passes in final fit of merger")
130-
AddOptionRTC(nWaysOuter, char, 0, "", 0, "Store outer param")
131-
AddOptionRTC(trackFitRejectMode, char, 5, "", 0, "0: no limit on rejection or missed hits, >0: break after n rejected hits, <0: reject at max -n hits")
129+
AddOptionRTC(nWays, signed char, 3, "", 0, "Do N fit passes in final fit of merger")
130+
AddOptionRTC(nWaysOuter, signed char, 0, "", 0, "Store outer param")
131+
AddOptionRTC(trackFitRejectMode, signed char, 5, "", 0, "0: no limit on rejection or missed hits, >0: break after n rejected hits, <0: reject at max -n hits")
132132
AddOptionRTC(dEdxTruncLow, unsigned char, 2, "", 0, "Low truncation threshold, fraction of 128")
133133
AddOptionRTC(dEdxTruncHigh, unsigned char, 77, "", 0, "High truncation threshold, fraction of 128")
134-
AddOptionRTC(globalTracking, char, 1, "", 0, "Enable Global Tracking (prolong tracks to adjacent sectors to find short segments)")
134+
AddOptionRTC(globalTracking, signed char, 1, "", 0, "Enable Global Tracking (prolong tracks to adjacent sectors to find short segments)")
135135
AddOptionRTC(disableRefitAttachment, unsigned char, 0, "", 0, "Bitmask to disable certain attachment steps during refit (1: attachment, 2: propagation, 4: loop following, 8: mirroring)")
136136
AddOptionRTC(rejectionStrategy, unsigned char, GPUCA_NAMESPACE::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression (0 = no, 1 = strategy A, 2 = strategy B)")
137137
AddOptionRTC(mergeLoopersAfterburner, unsigned char, 1, "", 0, "Run afterburner for additional looper merging")
138138
AddOptionRTC(compressionTypeMask, unsigned char, GPUCA_NAMESPACE::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits (1=truncate charge/width LSB, 2=differences, 4=track-model)")
139139
AddOptionRTC(compressionSortOrder, unsigned char, GPUCA_NAMESPACE::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression (0 = time, 1 = pad, 2 = Z-time-pad, 3 = Z-pad-time, 4 = no sorting (use incoming order))")
140140
AddOptionRTC(sigBitsCharge, unsigned char, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1")
141141
AddOptionRTC(sigBitsWidth, unsigned char, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1")
142-
AddOptionRTC(forceEarlyTransform, char, -1, "", 0, "Force early TPC transformation also for continuous data (-1 = auto)")
142+
AddOptionRTC(forceEarlyTransform, signed char, -1, "", 0, "Force early TPC transformation also for continuous data (-1 = auto)")
143143
AddOptionRTC(dropLoopers, unsigned char, 0, "", 0, "Drop looping tracks starting from second loop")
144144
AddOptionRTC(mergerCovSource, unsigned char, 2, "", 0, "Method to obtain covariance in track merger: 0 = simple filterErrors method, 1 = use cov from track following, 2 = refit (default)")
145145
AddOptionRTC(mergerInterpolateErrors, unsigned char, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection")
146146
AddOptionRTC(mergeCE, unsigned char, 1, "", 0, "Merge tracks accross the central electrode")
147-
AddOptionRTC(retryRefit, char, 1, "", 0, "Retry refit with seeding errors and without cluster rejection when fit fails (=2 means retry in same kernel, =1 for separate kernel")
148-
AddOptionRTC(looperInterpolationInExtraPass, char, -1, "", 0, "Perform looper interpolation in an extra pass")
149-
AddOptionRTC(mergerReadFromTrackerDirectly, char, 1, "", 0, "Forward data directly from tracker to merger on GPU")
150-
AddOptionRTC(dropSecondaryLegsInOutput, char, 1, "", 0, "Do not store secondary legs of looping track in TrackTPC")
151-
AddOptionRTC(enablePID, char, 1, "", 0, "Enable PID response")
152-
AddOptionRTC(PID_useNsigma, char, 1, "", 0, "Use nSigma instead of absolute distance in PID response")
153-
AddOptionRTC(adddEdxSubThresholdClusters, char, 1, "", 0, "Add sub threshold clusters in TPC dEdx computation")
154-
AddOptionRTC(rejectEdgeClustersInSeeding, char, 0, "", 0, "Reject edge clusters based on uncorrected track Y during seeding")
155-
AddOptionRTC(rejectEdgeClustersInTrackFit, char, 0, "", 0, "Reject edge clusters based on uncorrected track Y during track fit")
156-
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
147+
AddOptionRTC(retryRefit, signed char, 1, "", 0, "Retry refit with seeding errors and without cluster rejection when fit fails (=2 means retry in same kernel, =1 for separate kernel")
148+
AddOptionRTC(looperInterpolationInExtraPass, signed char, -1, "", 0, "Perform looper interpolation in an extra pass")
149+
AddOptionRTC(mergerReadFromTrackerDirectly, signed char, 1, "", 0, "Forward data directly from tracker to merger on GPU")
150+
AddOptionRTC(dropSecondaryLegsInOutput, signed char, 1, "", 0, "Do not store secondary legs of looping track in TrackTPC")
151+
AddOptionRTC(enablePID, signed char, 1, "", 0, "Enable PID response")
152+
AddOptionRTC(PID_useNsigma, signed char, 1, "", 0, "Use nSigma instead of absolute distance in PID response")
153+
AddOptionRTC(adddEdxSubThresholdClusters, signed char, 1, "", 0, "Add sub threshold clusters in TPC dEdx computation")
154+
AddOptionRTC(rejectEdgeClustersInSeeding, signed char, 0, "", 0, "Reject edge clusters based on uncorrected track Y during seeding")
155+
AddOptionRTC(rejectEdgeClustersInTrackFit, signed char, 0, "", 0, "Reject edge clusters based on uncorrected track Y during track fit")
156+
AddOptionArray(PID_remap, signed 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
157157
AddHelp("help", 'h')
158158
EndConfig()
159159

@@ -180,13 +180,13 @@ EndConfig()
180180

181181
BeginSubConfig(GPUSettingsRec, rec, configStandalone, "REC", 0, "Reconstruction settings", rec)
182182
AddOptionRTC(maxTrackQPtB5, float, 1.f / GPUCA_MIN_TRACK_PTB5_DEFAULT, "", 0, "required max Q/Pt (==min Pt) of tracks")
183-
AddOptionRTC(nonConsecutiveIDs, char, false, "", 0, "Non-consecutive cluster IDs as in HLT, disables features that need access to slice data in TPC merger")
183+
AddOptionRTC(nonConsecutiveIDs, signed char, false, "", 0, "Non-consecutive cluster IDs as in HLT, disables features that need access to slice data in TPC merger")
184184
AddOptionRTC(fwdTPCDigitsAsClusters, unsigned char, 0, "", 0, "Forward TPC digits as clusters (if they pass the ZS threshold)")
185185
AddOptionRTC(bz0Pt10MeV, unsigned char, 60, "", 0, "Nominal Pt to set when bz = 0 (in 10 MeV)")
186-
AddOptionRTC(fitInProjections, char, -1, "", 0, "Fit in projection, -1 to enable full fit for all but passes but the first one")
187-
AddOptionRTC(fitPropagateBzOnly, char, -1, "", 0, "Propagate using Bz only for n passes")
188-
AddOptionRTC(useMatLUT, char, 0, "", 0, "Use material lookup table for TPC refit")
189-
AddOptionRTC(trackingRefitGPUModel, char, 1, "", 0, "Use GPU track model for the Global Track Refit")
186+
AddOptionRTC(fitInProjections, signed char, -1, "", 0, "Fit in projection, -1 to enable full fit for all but passes but the first one")
187+
AddOptionRTC(fitPropagateBzOnly, signed char, -1, "", 0, "Propagate using Bz only for n passes")
188+
AddOptionRTC(useMatLUT, signed char, 0, "", 0, "Use material lookup table for TPC refit")
189+
AddOptionRTC(trackingRefitGPUModel, signed char, 1, "", 0, "Use GPU track model for the Global Track Refit")
190190
AddCustomCPP(void SetMinTrackPtB5(float v) { maxTrackQPtB5 = v > 0.001f ? (1.f / v) : (1.f / 0.001f); })
191191
AddSubConfig(GPUSettingsRecTPC, tpc)
192192
AddSubConfig(GPUSettingsRecTRD, trd)
@@ -228,12 +228,12 @@ AddOption(checkKernelFailures, bool, false, "", 0, "Synchronize after each kerne
228228
AddOption(deterministicGPUReconstruction, int, -1, "", 0, "Make CPU and GPU debug output comparable (sort / skip concurrent parts), -1 = automatic if debugLevel >= 6")
229229
AddOption(showOutputStat, bool, false, "", 0, "Print some track output statistics")
230230
AddOption(runCompressionStatistics, bool, false, "compressionStat", 0, "Run statistics and verification for cluster compression")
231-
AddOption(resetTimers, char, 1, "", 0, "Reset timers every event")
231+
AddOption(resetTimers, signed char, 1, "", 0, "Reset timers every event")
232232
AddOption(deviceTimers, bool, true, "", 0, "Use device timers instead of host-based time measurement")
233233
AddOption(keepAllMemory, bool, false, "", 0, "Allocate all memory on both device and host, and do not reuse")
234234
AddOption(keepDisplayMemory, bool, false, "", 0, "Like keepAllMemory, but only for memory required for event display")
235235
AddOption(disableMemoryReuse, bool, false, "", 0, "Disable memory reusage (for debugging only)")
236-
AddOption(memoryAllocationStrategy, char, 0, "", 0, "Memory Allocation Stragegy (0 = auto, 1 = individual allocations, 2 = single global allocation)")
236+
AddOption(memoryAllocationStrategy, signed char, 0, "", 0, "Memory Allocation Stragegy (0 = auto, 1 = individual allocations, 2 = single global allocation)")
237237
AddOption(forceMemoryPoolSize, unsigned long, 1, "memSize", 0, "Force size of allocated GPU / page locked host memory", min(0ul))
238238
AddOption(forceHostMemoryPoolSize, unsigned long, 0, "hostMemSize", 0, "Force size of allocated host page locked host memory (overriding memSize)", min(0ul))
239239
AddOption(memoryScalingFactor, float, 1.f, "", 0, "Factor to apply to all memory scalers")
@@ -245,28 +245,28 @@ AddOption(ompThreads, int, -1, "omp", 't', "Number of OMP threads to run (-1: al
245245
AddOption(ompKernels, unsigned char, 2, "", 0, "Parallelize with OMP inside kernels instead of over slices, 2 for nested parallelization over TPC sectors and inside kernels")
246246
AddOption(ompAutoNThreads, bool, true, "", 0, "Auto-adjust number of OMP threads, decreasing the number for small input data")
247247
AddOption(nDeviceHelperThreads, int, 1, "", 0, "Number of CPU helper threads for CPU processing")
248-
AddOption(nStreams, char, 8, "", 0, "Number of GPU streams / command queues")
249-
AddOption(nTPCClustererLanes, char, -1, "", 0, "Number of TPC clusterers that can run in parallel (-1 = autoset)")
248+
AddOption(nStreams, signed char, 8, "", 0, "Number of GPU streams / command queues")
249+
AddOption(nTPCClustererLanes, signed char, -1, "", 0, "Number of TPC clusterers that can run in parallel (-1 = autoset)")
250250
AddOption(overrideClusterizerFragmentLen, int, -1, "", 0, "Force the cluster max fragment len to a certain value (-1 = autodetect)")
251-
AddOption(trackletSelectorSlices, char, -1, "", 0, "Number of slices to processes in parallel at max")
252-
AddOption(trackletConstructorInPipeline, char, -1, "", 0, "Run tracklet constructor in the pipeline")
253-
AddOption(trackletSelectorInPipeline, char, -1, "", 0, "Run tracklet selector in the pipeline")
251+
AddOption(trackletSelectorSlices, signed char, -1, "", 0, "Number of slices to processes in parallel at max")
252+
AddOption(trackletConstructorInPipeline, signed char, -1, "", 0, "Run tracklet constructor in the pipeline")
253+
AddOption(trackletSelectorInPipeline, signed char, -1, "", 0, "Run tracklet selector in the pipeline")
254254
AddOption(fullMergerOnGPU, bool, true, "", 0, "Perform full TPC track merging on GPU instead of only refit")
255255
AddOption(delayedOutput, bool, true, "", 0, "Delay output to be parallel to track fit")
256-
AddOption(mergerSortTracks, char, -1, "", 0, "Sort track indizes for GPU track fit")
257-
AddOption(alternateBorderSort, char, -1, "", 0, "Alternative implementation for sorting of border tracks")
258-
AddOption(tpcCompressionGatherMode, char, -1, "", 0, "TPC Compressed Clusters Gather Mode (0: DMA transfer gather gpu to host, 1: serial DMA to host and gather by copy on CPU, 2. gather via GPU kernal DMA access, 3. gather on GPU via kernel, dma afterwards")
259-
AddOption(tpcCompressionGatherModeKernel, char, -1, "", 0, "TPC Compressed Clusters Gather Mode Kernel (0: unbufferd, 1-3: buffered, 4: multi-block)")
256+
AddOption(mergerSortTracks, signed char, -1, "", 0, "Sort track indizes for GPU track fit")
257+
AddOption(alternateBorderSort, signed char, -1, "", 0, "Alternative implementation for sorting of border tracks")
258+
AddOption(tpcCompressionGatherMode, signed char, -1, "", 0, "TPC Compressed Clusters Gather Mode (0: DMA transfer gather gpu to host, 1: serial DMA to host and gather by copy on CPU, 2. gather via GPU kernal DMA access, 3. gather on GPU via kernel, dma afterwards")
259+
AddOption(tpcCompressionGatherModeKernel, signed char, -1, "", 0, "TPC Compressed Clusters Gather Mode Kernel (0: unbufferd, 1-3: buffered, 4: multi-block)")
260260
AddOption(tpccfGatherKernel, bool, true, "", 0, "Use a kernel instead of the DMA engine to gather the clusters")
261261
AddOption(doublePipeline, bool, false, "", 0, "Double pipeline mode")
262262
AddOption(doublePipelineClusterizer, bool, true, "", 0, "Include the input data of the clusterizer in the double-pipeline")
263-
AddOption(prefetchTPCpageScan, char, 0, "", 0, "Prefetch Data for TPC page scan in CPU cache")
263+
AddOption(prefetchTPCpageScan, signed char, 0, "", 0, "Prefetch Data for TPC page scan in CPU cache")
264264
AddOption(runMC, bool, false, "", 0, "Process MC labels")
265265
AddOption(runQA, int, 0, "qa", 'q', "Enable tracking QA (negative number to provide bitmask for QA tasks)", message("Running QA: %s"), def(1))
266266
AddOption(qcRunFraction, float, 100.f, "", 0, "Percentage of events to process with QC")
267267
AddOption(outputSharedClusterMap, bool, false, "", 0, "Ship optional shared cluster map as output for further use")
268268
AddOption(disableTPCNoisyPadFilter, bool, false, "", 0, "Disables all TPC noisy pad filters (Not the normal noise filter!)")
269-
AddOption(createO2Output, char, 2, "", 0, "Create Track output in O2 format (2 = skip non-O2 output in GPU track format (reverts to =1 if QA is requested))")
269+
AddOption(createO2Output, signed char, 2, "", 0, "Create Track output in O2 format (2 = skip non-O2 output in GPU track format (reverts to =1 if QA is requested))")
270270
AddOption(clearO2OutputFromGPU, bool, false, "", 0, "Free the GPU memory used for O2 output after copying to host, prevents further O2 processing on the GPU")
271271
AddOption(ignoreNonFatalGPUErrors, bool, false, "", 0, "Continue running after having received non fatal GPU errors, e.g. abort due to overflow")
272272
AddOption(tpcIncreasedMinClustersPerRow, unsigned int, 0, "", 0, "Impose a minimum buffer size for the clustersPerRow during TPC clusterization")
@@ -559,13 +559,13 @@ EndConfig()
559559
// Derrived parameters used in GPUParam
560560
BeginHiddenConfig(GPUSettingsParam, param)
561561
AddVariableRTC(dAlpha, float, 0.f) // angular size
562-
AddVariableRTC(assumeConstantBz, char, 0) // Assume a constant magnetic field
563-
AddVariableRTC(toyMCEventsFlag, char, 0) // events were build with home-made event generator
564-
AddVariableRTC(continuousTracking, char, 0) // Continuous tracking, estimate bz and errors for abs(z) = 125cm during seeding
565-
AddVariableRTC(resetTimers, char, 0) // Reset benchmark timers before event processing
566-
AddVariableRTC(dodEdx, char, 0) // Do dEdx computation
567-
AddVariableRTC(earlyTpcTransform, char, 0) // do Early TPC transformation
568-
AddVariableRTC(debugLevel, char, 0) // Debug level
562+
AddVariableRTC(assumeConstantBz, signed char, 0) // Assume a constant magnetic field
563+
AddVariableRTC(toyMCEventsFlag, signed char, 0) // events were build with home-made event generator
564+
AddVariableRTC(continuousTracking, signed char, 0) // Continuous tracking, estimate bz and errors for abs(z) = 125cm during seeding
565+
AddVariableRTC(resetTimers, signed char, 0) // Reset benchmark timers before event processing
566+
AddVariableRTC(dodEdx, signed char, 0) // Do dEdx computation
567+
AddVariableRTC(earlyTpcTransform, signed char, 0) // do Early TPC transformation
568+
AddVariableRTC(debugLevel, signed char, 0) // Debug level
569569
AddVariableRTC(continuousMaxTimeBin, int, 0) // Max time bin for continuous tracking
570570
EndConfig()
571571

GPU/GPUTracking/utils/qconfig.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,10 @@ inline int qAddOptionType<bool>(qConfigSettings<bool>& settings, bool& ref, int&
334334
true);
335335
}
336336
template <>
337-
inline int qAddOptionType<char>(qConfigSettings<char>& settings, char& ref, int& i, const char** argv, const int argc, char /*def*/)
337+
inline int qAddOptionType<signed char>(qConfigSettings<signed char>& settings, signed char& ref, int& i, const char** argv, const int argc, signed char /*def*/)
338338
{
339-
return qAddOptionGeneric<char>(
340-
settings, ref, i, argv, argc, settings.set, [](const char* a) -> char {
339+
return qAddOptionGeneric<signed char>(
340+
settings, ref, i, argv, argc, settings.set, [](const char* a) -> signed char {
341341
return atoi(a);
342342
},
343343
settings.doDefault);

GPU/GPUTracking/utils/qconfig_helpers.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ inline std::string print_type<char>(char val)
4242
return std::to_string(val);
4343
};
4444
template <>
45+
inline std::string print_type<signed char>(signed char val)
46+
{
47+
return std::to_string(val);
48+
};
49+
template <>
4550
inline std::string print_type<unsigned char>(unsigned char val)
4651
{
4752
return std::to_string(val);

0 commit comments

Comments
 (0)