@@ -19,6 +19,12 @@ using namespace GPUCA_NAMESPACE::gpu;
1919
2020void GPUTPCCompression::InitializeProcessor () {}
2121
22+ void * GPUTPCCompression::SetPointersOutputGPU (void * mem)
23+ {
24+ SetPointersCompressedClusters (mem, *mOutputA , mOutputA ->nAttachedClusters , mOutputA ->nTracks , mOutputA ->nUnattachedClusters , true );
25+ return mem;
26+ }
27+
2228void * GPUTPCCompression::SetPointersOutputHost (void * mem)
2329{
2430 computePointerWithoutAlignment (mem, mOutputFlat );
@@ -29,7 +35,7 @@ void* GPUTPCCompression::SetPointersOutputHost(void* mem)
2935void * GPUTPCCompression::SetPointersScratch (void * mem)
3036{
3137 computePointerWithAlignment (mem, mClusterStatus , mMaxClusters );
32- if (mRec ->GetProcessingSettings ().tpcCompressionGatherMode = = 2 ) {
38+ if (mRec ->GetProcessingSettings ().tpcCompressionGatherMode > = 2 ) {
3339 computePointerWithAlignment (mem, mAttachedClusterFirstIndex , mMaxTracks );
3440 }
3541 if (mRec ->GetProcessingSettings ().tpcCompressionGatherMode != 1 ) {
@@ -50,7 +56,7 @@ void* GPUTPCCompression::SetPointersOutput(void* mem)
5056template <class T >
5157void GPUTPCCompression::SetPointersCompressedClusters (void *& mem, T& c, unsigned int nClA, unsigned int nTr, unsigned int nClU, bool reducedClA)
5258{
53- computePointerWithAlignment (mem, c.qTotU , nClU);
59+ computePointerWithAlignment (mem, c.qTotU , nClU); // Do not reorder, qTotU ist used as first address in GPUChainTracking::RunTPCCompression
5460 computePointerWithAlignment (mem, c.qMaxU , nClU);
5561 computePointerWithAlignment (mem, c.flagsU , nClU);
5662 computePointerWithAlignment (mem, c.padDiffU , nClU);
@@ -87,17 +93,22 @@ void* GPUTPCCompression::SetPointersMemory(void* mem)
8793{
8894 computePointerWithAlignment (mem, mMemory );
8995 computePointerWithAlignment (mem, mOutput );
96+ mOutputA = mOutput ;
9097 return mem;
9198}
9299
93100void GPUTPCCompression::RegisterMemoryAllocation ()
94101{
95102 AllocateAndInitializeLate ();
96103 mMemoryResOutputHost = mRec ->RegisterMemoryAllocation (this , &GPUTPCCompression::SetPointersOutputHost, GPUMemoryResource::MEMORY_OUTPUT_FLAG | GPUMemoryResource::MEMORY_HOST | GPUMemoryResource::MEMORY_CUSTOM , " TPCCompressionOutputHost" );
97- if (mRec ->GetProcessingSettings ().tpcCompressionGatherMode != 2 ) {
98- mRec ->RegisterMemoryAllocation (this , &GPUTPCCompression::SetPointersOutput, GPUMemoryResource::MEMORY_OUTPUT | GPUMemoryResource::MEMORY_STACK , " TPCCompressionOutput" );
104+ if (mRec ->GetProcessingSettings ().tpcCompressionGatherMode == 3 ) {
105+ mMemoryResOutputGPU = mRec ->RegisterMemoryAllocation (this , &GPUTPCCompression::SetPointersOutputGPU, GPUMemoryResource::MEMORY_SCRATCH | GPUMemoryResource::MEMORY_GPU | GPUMemoryResource::MEMORY_CUSTOM | GPUMemoryResource::MEMORY_STACK , " TPCCompressionOutputGPU" );
106+ }
107+ unsigned int stackScratch = (mRec ->GetProcessingSettings ().tpcCompressionGatherMode != 3 ) ? GPUMemoryResource::MEMORY_STACK : 0 ;
108+ if (mRec ->GetProcessingSettings ().tpcCompressionGatherMode < 2 ) {
109+ mRec ->RegisterMemoryAllocation (this , &GPUTPCCompression::SetPointersOutput, GPUMemoryResource::MEMORY_OUTPUT | stackScratch, " TPCCompressionOutput" );
99110 }
100- mRec ->RegisterMemoryAllocation (this , &GPUTPCCompression::SetPointersScratch, GPUMemoryResource::MEMORY_SCRATCH | GPUMemoryResource:: MEMORY_STACK , " TPCCompressionScratch" );
111+ mRec ->RegisterMemoryAllocation (this , &GPUTPCCompression::SetPointersScratch, GPUMemoryResource::MEMORY_SCRATCH | stackScratch , " TPCCompressionScratch" );
101112 mRec ->RegisterMemoryAllocation (this , &GPUTPCCompression::SetPointersMemory, GPUMemoryResource::MEMORY_PERMANENT , " TPCCompressionMemory" );
102113}
103114
0 commit comments