Skip to content

Commit

Permalink
GPU TPC: Fix typo in name, and clean up setting of inputGPU struct
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrohr committed Nov 26, 2024
1 parent 061a310 commit 106df5e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct CompressedClustersCounters {
unsigned int nUnattachedClusters = 0;
unsigned int nAttachedClustersReduced = 0;
unsigned int nSliceRows = 36 * 152;
unsigned char nComppressionModes = 0;
unsigned char nCompressionModes = 0;
float solenoidBz = -1e6f;
int maxTimeBin = -1e6;

Expand Down
2 changes: 1 addition & 1 deletion Detectors/CTF/test/test_ctf_io_tpc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ BOOST_DATA_TEST_CASE(CTFTest, boost_data::make(ANSVersions) ^ boost_data::make(C
BOOST_CHECK(countOrig->nUnattachedClusters == countDeco->nUnattachedClusters);
BOOST_CHECK(countOrig->nAttachedClustersReduced == countDeco->nAttachedClustersReduced);
BOOST_CHECK(countOrig->nSliceRows == countDeco->nSliceRows);
BOOST_CHECK(countOrig->nComppressionModes == countDeco->nComppressionModes);
BOOST_CHECK(countOrig->nCompressionModes == countDeco->nCompressionModes);
BOOST_CHECK(countOrig->solenoidBz == countDeco->solenoidBz);
BOOST_CHECK(countOrig->maxTimeBin == countDeco->maxTimeBin);
BOOST_CHECK(memcmp(vecIn.data() + sizeof(o2::tpc::CompressedClustersCounters), bVec.data() + sizeof(o2::tpc::CompressedClustersCounters), bVec.size() - sizeof(o2::tpc::CompressedClustersCounters)) == 0);
Expand Down
2 changes: 1 addition & 1 deletion Detectors/TPC/workflow/src/EntropyEncoderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void EntropyEncoderSpec::run(ProcessingContext& pc)
} else {
outBuffer.first.emplace_back(0);
outBuffer.second.emplace_back(0);
GPUTPCCompression_EncodeUnattached(clustersFiltered.nComppressionModes, cl, outBuffer.first.back(), outBuffer.second.back(), count++ ? &preCl : nullptr);
GPUTPCCompression_EncodeUnattached(clustersFiltered.nCompressionModes, cl, outBuffer.first.back(), outBuffer.second.back(), count++ ? &preCl : nullptr);
preCl = cl;
}
};
Expand Down
4 changes: 2 additions & 2 deletions GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.inc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
namespace o2::gpu
{

GPUdii() void GPUTPCCompression_EncodeUnattached(uint8_t nComppressionModes, const o2::tpc::ClusterNative& orgCl, uint32_t& outTime, uint16_t& outPad, const o2::tpc::ClusterNative* orgClPre = nullptr)
GPUdii() void GPUTPCCompression_EncodeUnattached(uint8_t nCompressionModes, const o2::tpc::ClusterNative& orgCl, uint32_t& outTime, uint16_t& outPad, const o2::tpc::ClusterNative* orgClPre = nullptr)
{
if (nComppressionModes & GPUSettings::CompressionDifferences) {
if (nCompressionModes & GPUSettings::CompressionDifferences) {
uint32_t lastTime = 0, lastPad = 0;
if (orgClPre) {
lastPad = orgClPre->padPacked;
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUTracking/DataCompression/GPUTPCDecompression.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void GPUTPCDecompression::SetPointersCompressedClusters(void*& mem, T& c, uint32

uint32_t nClAreduced = reducedClA ? nClA - nTr : nClA;

if (!(mRec->GetParam().rec.tpc.compressionTypeMask & GPUSettings::CompressionTrackModel)) {
if (!(c.nCompressionModes & GPUSettings::CompressionTrackModel)) {
return; // Track model disabled, do not allocate memory
}
computePointerWithAlignment(mem, c.qTotA, nClA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class TPCClusterDecompressionCore
if (changeLeg) {
tmpSlice -= GPUCA_NSLICES;
}
if (cmprClusters.nComppressionModes & GPUSettings::CompressionDifferences) {
if (cmprClusters.nCompressionModes & GPUSettings::CompressionDifferences) {
slice += tmpSlice;
if (slice >= GPUCA_NSLICES) {
slice -= GPUCA_NSLICES;
Expand Down Expand Up @@ -170,7 +170,7 @@ class TPCClusterDecompressionCore
uint32_t time = 0;
uint16_t pad = 0;
for (uint32_t k = start; k < end; k++) {
if (cmprClusters.nComppressionModes & GPUSettings::CompressionDifferences) {
if (cmprClusters.nCompressionModes & GPUSettings::CompressionDifferences) {
uint32_t timeTmp = cmprClusters.timeDiffU[k];
if (timeTmp & 800000) {
timeTmp |= 0xFF000000;
Expand Down
36 changes: 3 additions & 33 deletions GPU/GPUTracking/Global/GPUChainTrackingCompression.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int32_t GPUChainTracking::RunTPCCompression()
O->nUnattachedClusters = Compressor.mMemory->nStoredUnattachedClusters;
O->nAttachedClustersReduced = O->nAttachedClusters - O->nTracks;
O->nSliceRows = NSLICES * GPUCA_ROW_COUNT;
O->nComppressionModes = param().rec.tpc.compressionTypeMask;
O->nCompressionModes = param().rec.tpc.compressionTypeMask;
O->solenoidBz = param().bzkG;
O->maxTimeBin = param().continuousMaxTimeBin;
size_t outputSize = AllocateRegisteredMemory(Compressor.mMemoryResOutputHost, mSubOutputControls[GPUTrackingOutputs::getIndex(&GPUTrackingOutputs::compressedClusters)]);
Expand Down Expand Up @@ -254,40 +254,10 @@ int32_t GPUChainTracking::RunTPCDecompression()

int32_t inputStream = 0;
int32_t unattachedStream = mRec->NStreams() - 1;
inputGPU.nAttachedClusters = cmprClsHost.nAttachedClusters;
inputGPU.nUnattachedClusters = cmprClsHost.nUnattachedClusters;
inputGPU.nTracks = cmprClsHost.nTracks;
inputGPU.nAttachedClustersReduced = inputGPU.nAttachedClusters - inputGPU.nTracks;
inputGPU.nSliceRows = NSLICES * GPUCA_ROW_COUNT;
inputGPU.nComppressionModes = param().rec.tpc.compressionTypeMask;
inputGPU.solenoidBz = param().bzkG;
inputGPU.maxTimeBin = param().continuousMaxTimeBin;
inputGPU = cmprClsHost;
SetupGPUProcessor(&Decompressor, true);
WriteToConstantMemory(myStep, (char*)&processors()->tpcDecompressor - (char*)processors(), &DecompressorShadow, sizeof(DecompressorShadow), inputStream);

inputGPU.nTrackClusters = cmprClsHost.nTrackClusters;
inputGPU.qTotU = cmprClsHost.qTotU;
inputGPU.qMaxU = cmprClsHost.qMaxU;
inputGPU.flagsU = cmprClsHost.flagsU;
inputGPU.padDiffU = cmprClsHost.padDiffU;
inputGPU.timeDiffU = cmprClsHost.timeDiffU;
inputGPU.sigmaPadU = cmprClsHost.sigmaPadU;
inputGPU.sigmaTimeU = cmprClsHost.sigmaTimeU;
inputGPU.nSliceRowClusters = cmprClsHost.nSliceRowClusters;
inputGPU.qTotA = cmprClsHost.qTotA;
inputGPU.qMaxA = cmprClsHost.qMaxA;
inputGPU.flagsA = cmprClsHost.flagsA;
inputGPU.rowDiffA = cmprClsHost.rowDiffA;
inputGPU.sliceLegDiffA = cmprClsHost.sliceLegDiffA;
inputGPU.padResA = cmprClsHost.padResA;
inputGPU.timeResA = cmprClsHost.timeResA;
inputGPU.sigmaPadA = cmprClsHost.sigmaPadA;
inputGPU.sigmaTimeA = cmprClsHost.sigmaTimeA;
inputGPU.qPtA = cmprClsHost.qPtA;
inputGPU.rowA = cmprClsHost.rowA;
inputGPU.sliceA = cmprClsHost.sliceA;
inputGPU.timeA = cmprClsHost.timeA;
inputGPU.padA = cmprClsHost.padA;
inputGPU = cmprClsHost;

bool toGPU = true;
runKernel<GPUMemClean16>({GetGridAutoStep(inputStream, RecoStep::TPCDecompression), krnlRunRangeNone, &mEvents->init}, DecompressorShadow.mNativeClustersIndex, NSLICES * GPUCA_ROW_COUNT * sizeof(DecompressorShadow.mNativeClustersIndex[0]));
Expand Down

0 comments on commit 106df5e

Please sign in to comment.