Skip to content

Commit 64315ad

Browse files
committed
GPU: Check that we do not optimize RTC when we have 2 different GPUReconstruction instances
1 parent 5b5f1d9 commit 64315ad

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

GPU/GPUTracking/Base/GPUReconstruction.cxx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,15 +347,22 @@ int32_t GPUReconstruction::InitPhaseBeforeDevice()
347347
mProcessingSettings->nTPCClustererLanes = GPUCA_NSECTORS;
348348
}
349349

350+
if (GetProcessingSettings().doublePipeline) {
351+
mProcessingSettings->rtctech.allowOptimizedSlaveReconstruction = true;
352+
}
350353
if (GetProcessingSettings().doublePipeline && (mChains.size() != 1 || mChains[0]->SupportsDoublePipeline() == false || !IsGPU() || GetProcessingSettings().memoryAllocationStrategy != GPUMemoryResource::ALLOCATION_GLOBAL)) {
351354
GPUError("Must use double pipeline mode only with exactly one chain that must support it");
352355
return 1;
353356
}
354-
355357
if (mMaster == nullptr && GetProcessingSettings().doublePipeline) {
356358
mPipelineContext.reset(new GPUReconstructionPipelineContext);
357359
}
358360

361+
if (mMaster && GetProcessingSettings().rtc.enable && (GetProcessingSettings().rtc.optConstexpr || GetProcessingSettings().rtc.optSpecialCode) && !GetProcessingSettings().rtctech.allowOptimizedSlaveReconstruction) {
362+
GPUError("Not allowed to create optimized RTC code with more than one GPUReconstruction instances");
363+
return 1;
364+
}
365+
359366
mDeviceMemorySize = mHostMemorySize = 0;
360367
for (uint32_t i = 0; i < mChains.size(); i++) {
361368
if (mChains[i]->EarlyConfigure()) {

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ AddOption(runTest, int32_t, 0, "", 0, "Do not run the actual benchmark, but just
228228
AddOption(cacheMutex, bool, true, "", 0, "Use a file lock to serialize access to the cache folder")
229229
AddOption(ignoreCacheValid, bool, false, "", 0, "If set, allows to use RTC cached code files even if they are not valid for the current source code / parameters")
230230
AddOption(printLaunchBounds, bool, false, "", 0, "Print launch bounds used for RTC code as debugging option")
231+
AddOption(allowOptimizedSlaveReconstruction, bool, false, "", 0, "Allow RTC with slave GPUReconstruction instances with optConstexpr and optSpecialcode")
231232
AddOption(cacheFolder, std::string, "./rtccache/", "", 0, "Folder in which the cache file is stored")
232233
AddOption(prependCommand, std::string, "", "", 0, "Prepend RTC compilation commands by this string")
233234
AddOption(overrideArchitecture, std::string, "", "", 0, "Override arhcitecture part of RTC compilation command line") // Part of cmdLine, so checked against the cache

0 commit comments

Comments
 (0)