Skip to content

Commit be055df

Browse files
committed
Compute number of required blocks relative to block size.
1 parent dc58aef commit be055df

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,8 +962,9 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
962962
checkForNoisyPads &= !GetProcessingSettings().disableTPCNoisyPadFilter;
963963

964964
if (checkForNoisyPads) {
965-
const int32_t padsPerBlock = doGPU ? 16 : 8; // FIXME: Don't hardcode this!!!
966-
const int32_t nBlocks = TPC_PADS_IN_SECTOR / padsPerBlock;
965+
const auto props = getKernelProperties<GPUTPCCFCheckPadBaseline>();
966+
967+
const int32_t nBlocks = GPUTPCCFCheckPadBaseline::GetNBlocks(doGPU, props.nThreads);
967968

968969
runKernel<GPUTPCCFCheckPadBaseline>({GetGridBlk(nBlocks, lane), {iSector}});
969970
getKernelTimer<GPUTPCCFCheckPadBaseline>(RecoStep::TPCClusterFinding, iSector, TPC_PADS_IN_SECTOR * fragment.lengthWithoutOverlap() * sizeof(PackedCharge), false);

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ class GPUTPCCFCheckPadBaseline : public GPUKernelTemplate
4949
return gpudatatypes::RecoStep::TPCClusterFinding;
5050
}
5151

52+
static int32_t GetNBlocks(bool isGPU, int32_t nThreads)
53+
{
54+
const int32_t padsPerBlock = isGPU ? nThreads / TimebinsPerCacheline : PadsPerCacheline;
55+
const int32_t nBlocks = TPC_PADS_IN_SECTOR / padsPerBlock;
56+
return nBlocks;
57+
}
58+
5259
template <int32_t iKernel = defaultKernel>
5360
GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer);
5461

0 commit comments

Comments
 (0)