forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGPUTPCDecompression.cxx
More file actions
120 lines (102 loc) · 5.86 KB
/
GPUTPCDecompression.cxx
File metadata and controls
120 lines (102 loc) · 5.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file GPUTPCDecompression.cxx
/// \author Gabriele Cimador
#include "GPUTPCDecompression.h"
#include "GPUTPCCompression.h"
#include "GPUReconstruction.h"
#include "GPUO2DataTypes.h"
#include "GPUMemorySizeScalers.h"
#include "GPULogging.h"
using namespace o2::gpu;
void GPUTPCDecompression::InitializeProcessor() {}
void* GPUTPCDecompression::SetPointersInputGPU(void* mem)
{
SetPointersCompressedClusters(mem, mInputGPU, mInputGPU.nAttachedClusters, mInputGPU.nTracks, mInputGPU.nUnattachedClusters, true);
return mem;
}
template <class T>
void GPUTPCDecompression::SetPointersCompressedClusters(void*& mem, T& c, uint32_t nClA, uint32_t nTr, uint32_t nClU, bool reducedClA)
{
computePointerWithAlignment(mem, c.qTotU, nClU); // Do not reorder, qTotU ist used as first address in GPUChainTracking::RunTPCCompression
computePointerWithAlignment(mem, c.qMaxU, nClU);
computePointerWithAlignment(mem, c.flagsU, nClU);
computePointerWithAlignment(mem, c.padDiffU, nClU);
computePointerWithAlignment(mem, c.timeDiffU, nClU);
computePointerWithAlignment(mem, c.sigmaPadU, nClU);
computePointerWithAlignment(mem, c.sigmaTimeU, nClU);
computePointerWithAlignment(mem, c.nSliceRowClusters, GPUCA_ROW_COUNT * NSECTORS);
uint32_t nClAreduced = reducedClA ? nClA - nTr : nClA;
if (!(c.nComppressionModes & GPUSettings::CompressionTrackModel)) {
return; // Track model disabled, do not allocate memory
}
computePointerWithAlignment(mem, c.qTotA, nClA);
computePointerWithAlignment(mem, c.qMaxA, nClA);
computePointerWithAlignment(mem, c.flagsA, nClA);
computePointerWithAlignment(mem, c.rowDiffA, nClAreduced);
computePointerWithAlignment(mem, c.sliceLegDiffA, nClAreduced);
computePointerWithAlignment(mem, c.padResA, nClAreduced);
computePointerWithAlignment(mem, c.timeResA, nClAreduced);
computePointerWithAlignment(mem, c.sigmaPadA, nClA);
computePointerWithAlignment(mem, c.sigmaTimeA, nClA);
computePointerWithAlignment(mem, c.qPtA, nTr);
computePointerWithAlignment(mem, c.rowA, nTr);
computePointerWithAlignment(mem, c.sliceA, nTr);
computePointerWithAlignment(mem, c.timeA, nTr);
computePointerWithAlignment(mem, c.padA, nTr);
computePointerWithAlignment(mem, c.nTrackClusters, nTr);
}
void* GPUTPCDecompression::SetPointersTmpNativeBuffersGPU(void* mem)
{
computePointerWithAlignment(mem, mTmpNativeClusters, NSECTORS * GPUCA_ROW_COUNT * mMaxNativeClustersPerBuffer);
return mem;
}
void* GPUTPCDecompression::SetPointersTmpNativeBuffersOutput(void* mem)
{
computePointerWithAlignment(mem, mNativeClustersIndex, NSECTORS * GPUCA_ROW_COUNT);
return mem;
}
void* GPUTPCDecompression::SetPointersTmpNativeBuffersInput(void* mem)
{
computePointerWithAlignment(mem, mUnattachedClustersOffsets, NSECTORS * GPUCA_ROW_COUNT);
computePointerWithAlignment(mem, mAttachedClustersOffsets, mInputGPU.nTracks);
return mem;
}
void* GPUTPCDecompression::SetPointersTmpClusterNativeAccessForFiltering(void* mem)
{
computePointerWithAlignment(mem, mNativeClustersBuffer, mNClusterNativeBeforeFiltering);
return mem;
}
void* GPUTPCDecompression::SetPointersInputClusterNativeAccess(void* mem)
{
computePointerWithAlignment(mem, mClusterNativeAccess);
return mem;
}
void* GPUTPCDecompression::SetPointersNClusterPerSectorRow(void* mem)
{
computePointerWithAlignment(mem, mNClusterPerSectorRow, NSECTORS * GPUCA_ROW_COUNT);
return mem;
}
void GPUTPCDecompression::RegisterMemoryAllocation()
{
AllocateAndInitializeLate();
mMemoryResInputGPU = mRec->RegisterMemoryAllocation(this, &GPUTPCDecompression::SetPointersInputGPU, GPUMemoryResource::MEMORY_INPUT_FLAG | GPUMemoryResource::MEMORY_GPU | GPUMemoryResource::MEMORY_EXTERNAL | GPUMemoryResource::MEMORY_SCRATCH, "TPCDecompressionInput");
mRec->RegisterMemoryAllocation(this, &GPUTPCDecompression::SetPointersTmpNativeBuffersGPU, GPUMemoryResource::MEMORY_SCRATCH | GPUMemoryResource::MEMORY_STACK, "TPCDecompressionTmpBuffersGPU");
mResourceTmpIndexes = mRec->RegisterMemoryAllocation(this, &GPUTPCDecompression::SetPointersTmpNativeBuffersOutput, GPUMemoryResource::MEMORY_OUTPUT | GPUMemoryResource::MEMORY_STACK, "TPCDecompressionTmpBuffersOutput");
mResourceTmpClustersOffsets = mRec->RegisterMemoryAllocation(this, &GPUTPCDecompression::SetPointersTmpNativeBuffersInput, GPUMemoryResource::MEMORY_INPUT | GPUMemoryResource::MEMORY_STACK, "TPCDecompressionTmpBuffersInput");
mResourceTmpBufferBeforeFiltering = mRec->RegisterMemoryAllocation(this, &GPUTPCDecompression::SetPointersTmpClusterNativeAccessForFiltering, GPUMemoryResource::MEMORY_CUSTOM | GPUMemoryResource::MEMORY_SCRATCH | GPUMemoryResource::MEMORY_STACK, "TPCDecompressionTmpBufferForFiltering");
mResourceClusterNativeAccess = mRec->RegisterMemoryAllocation(this, &GPUTPCDecompression::SetPointersInputClusterNativeAccess, GPUMemoryResource::MEMORY_INPUT | GPUMemoryResource::MEMORY_CUSTOM | GPUMemoryResource::MEMORY_STACK, "TPCDecompressionTmpClusterAccessForFiltering");
mResourceNClusterPerSectorRow = mRec->RegisterMemoryAllocation(this, &GPUTPCDecompression::SetPointersNClusterPerSectorRow, GPUMemoryResource::MEMORY_OUTPUT | GPUMemoryResource::MEMORY_CUSTOM | GPUMemoryResource::MEMORY_STACK, "TPCDecompressionTmpClusterCountForFiltering");
}
void GPUTPCDecompression::SetMaxData(const GPUTrackingInOutPointers& io)
{
mMaxNativeClustersPerBuffer = mRec->GetProcessingSettings().tpcMaxAttachedClustersPerSectorRow;
}