Skip to content

Commit 22d2b7c

Browse files
committed
WIP: generate HIP tails.
1 parent 99442a9 commit 22d2b7c

2 files changed

Lines changed: 42 additions & 2 deletions

File tree

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#include "utils/strtag.h"
5959
#include <fstream>
6060
#include <numeric>
61+
#include <random>
6162
#include <vector>
6263

6364
using namespace o2::gpu;
@@ -160,6 +161,40 @@ namespace
160161
struct TPCCFDecodeScanTmp {
161162
int32_t zsPtrFirst, zsPageFirst, zsPtrLast, zsPageLast, hasData, pageCounter;
162163
};
164+
165+
struct InjectedADC {
166+
std::array<std::vector<Digit>, GPUCA_ROW_COUNT> digitsByRow;
167+
};
168+
169+
// Additional ADC values must be generated at start of clusterizer
170+
// This is required, so enough memory is allocated for the charge points
171+
// And ADCs can be injected simply
172+
// -> copying chargeMap + chargePositions to host
173+
// -> writing additional adcs to chargeMap + positions
174+
// -> copying values to device
175+
InjectedADC GenerateSaturatedSignals()
176+
{
177+
InjectedADC adcs;
178+
179+
const int32_t nHIPs = 1;
180+
const int32_t firstTB = 0; // Place all HIPs in first fragment for now
181+
const int32_t lastTB = 4000;
182+
183+
std::mt19937 gen{42};
184+
std::uniform_int_distribution<> randomRow(0, GPUCA_ROW_COUNT - 1);
185+
std::uniform_int_distribution<> randomTB(0, lastTB - 1);
186+
std::uniform_int_distribution<> randomPad(0, TPC_PADS_PER_ROW - 1);
187+
188+
189+
for (int32_t iHIP = 0; iHIP < nHIPs; iHIP++) {
190+
const int32_t row = randomRow(gen);
191+
auto &digits = adcs.digitsByRow[row];
192+
193+
194+
}
195+
196+
return adcs;
197+
}
163198
} // namespace
164199

165200
std::pair<uint32_t, uint32_t> GPUChainTracking::TPCClusterizerDecodeZSCount(uint32_t iSector, const CfFragment& fragment)

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,18 @@ GPUd() void GPUTPCCFCheckPadBaseline::CheckBaselineGPU(int32_t nBlocks, int32_t
9595

9696
PadChargeAccu acc;
9797

98-
HipTailRange activeHIPTail{-1, -1};
99-
10098
const int16_t iPadOffset = iThread % MaxNPadsPerRow;
10199
const int16_t iTimeOffset = iThread / MaxNPadsPerRow;
102100
const int16_t iPadHandle = iThread;
103101
const bool handlePad = iPadHandle < rowinfo.nPads;
104102

103+
HipTailRange activeHIPTail{-1, -1};
104+
if (iPadHandle < MaxNPadsPerRow) {
105+
smem.tails[iPadHandle] = {-1, -1};
106+
}
107+
GPUbarrier();
108+
109+
105110
const auto firstTB = fragment.firstNonOverlapTimeBin();
106111
const auto lastTB = fragment.lastNonOverlapTimeBin();
107112

0 commit comments

Comments
 (0)