forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGPUTrackingInputProvider.cxx
More file actions
108 lines (95 loc) · 5.48 KB
/
GPUTrackingInputProvider.cxx
File metadata and controls
108 lines (95 loc) · 5.48 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
// 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 GPUTrackingInputProvider.cxx
/// \author David Rohr
#include "GPUTrackingInputProvider.h"
#include "GPUDataTypes.h"
#include "GPUTRDTrackletWord.h"
#include "GPUReconstruction.h"
#include "GPUTPCClusterOccupancyMap.h"
#include "GPUErrors.h"
#include "GPUParam.h"
#include "DataFormatsTPC/ClusterNative.h"
#include "GPUTRDSpacePoint.h"
using namespace o2::gpu;
using namespace o2::tpc;
void GPUTrackingInputProvider::InitializeProcessor() {}
void* GPUTrackingInputProvider::SetPointersInputZS(void* mem)
{
if (mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCClusterFinding) {
computePointerWithAlignment(mem, mPzsMeta);
computePointerWithAlignment(mem, mPzsSizes, GPUTrackingInOutZS::NSECTORS * GPUTrackingInOutZS::NENDPOINTS);
computePointerWithAlignment(mem, mPzsPtrs, GPUTrackingInOutZS::NSECTORS * GPUTrackingInOutZS::NENDPOINTS);
}
return mem;
}
void* GPUTrackingInputProvider::SetPointersInputClusterNativeAccess(void* mem)
{
if (mHoldTPCClusterNative) {
computePointerWithAlignment(mem, mPclusterNativeAccess);
}
return mem;
}
void* GPUTrackingInputProvider::SetPointersInputClusterNativeBuffer(void* mem)
{
if (mHoldTPCClusterNative) {
computePointerWithAlignment(mem, mPclusterNativeBuffer, mNClusterNative);
}
return mem;
}
void* GPUTrackingInputProvider::SetPointersInputClusterNativeOutput(void* mem)
{
if (mHoldTPCClusterNativeOutput) {
computePointerWithoutAlignment(mem, mPclusterNativeOutput, mNClusterNative); // TODO: Should decide based on some settings whether with or without alignment. Without only needed for output to unaligned shared memory in workflow.
}
return mem;
}
void* GPUTrackingInputProvider::SetPointersErrorCodes(void* mem)
{
computePointerWithAlignment(mem, mErrorCodes, 4 * GPUErrors::getMaxErrors() + 1);
return mem;
}
void* GPUTrackingInputProvider::SetPointersInputTRD(void* mem)
{
computePointerWithAlignment(mem, mTRDTracklets, mNTRDTracklets);
if (mDoSpacepoints) {
computePointerWithAlignment(mem, mTRDSpacePoints, mNTRDTracklets);
}
computePointerWithAlignment(mem, mTRDTriggerTimes, mNTRDTriggerRecords);
computePointerWithAlignment(mem, mTRDTrackletIdxFirst, mNTRDTriggerRecords);
computePointerWithAlignment(mem, mTRDTrigRecMask, mNTRDTriggerRecords);
return mem;
}
void* GPUTrackingInputProvider::SetPointersTPCOccupancyMap(void* mem)
{
if (mHoldTPCOccupancyMap) {
mTPCClusterOccupancyMapSize = mRec->GetParam().rec.tpc.occupancyMapTimeBins ? GPUTPCClusterOccupancyMapBin::getNBins(mRec->GetParam()) : 0;
computePointerWithAlignment(mem, mTPCClusterOccupancyMap, (mRec->GetParam().rec.tpc.occupancyMapTimeBins ? mTPCClusterOccupancyMapSize + 1 : 0) + 1); // +1 for total occupancy estimator, +1 for sanity check information
}
return mem;
}
void GPUTrackingInputProvider::RegisterMemoryAllocation()
{
mResourceErrorCodes = mRec->RegisterMemoryAllocation(this, &GPUTrackingInputProvider::SetPointersErrorCodes, GPUMemoryResource::MEMORY_PERMANENT, "ErrorCodes");
mResourceZS = mRec->RegisterMemoryAllocation(this, &GPUTrackingInputProvider::SetPointersInputZS, GPUMemoryResource::MEMORY_INPUT | GPUMemoryResource::MEMORY_PERMANENT, "InputZS");
mResourceOccupancyMap = mRec->RegisterMemoryAllocation(this, &GPUTrackingInputProvider::SetPointersTPCOccupancyMap, GPUMemoryResource::MEMORY_INOUT | GPUMemoryResource::MEMORY_CUSTOM, "OccupancyMap");
mResourceClusterNativeAccess = mRec->RegisterMemoryAllocation(this, &GPUTrackingInputProvider::SetPointersInputClusterNativeAccess, GPUMemoryResource::MEMORY_INPUT, "ClusterNativeAccess");
mResourceClusterNativeBuffer = mRec->RegisterMemoryAllocation(this, &GPUTrackingInputProvider::SetPointersInputClusterNativeBuffer, GPUMemoryResource::MEMORY_INPUT_FLAG | GPUMemoryResource::MEMORY_GPU | GPUMemoryResource::MEMORY_EXTERNAL | GPUMemoryResource::MEMORY_CUSTOM, "ClusterNativeBuffer");
mResourceClusterNativeOutput = mRec->RegisterMemoryAllocation(this, &GPUTrackingInputProvider::SetPointersInputClusterNativeOutput, GPUMemoryResource::MEMORY_OUTPUT_FLAG | GPUMemoryResource::MEMORY_HOST | GPUMemoryResource::MEMORY_CUSTOM, "ClusterNativeOutput");
mResourceTRD = mRec->RegisterMemoryAllocation(this, &GPUTrackingInputProvider::SetPointersInputTRD, GPUMemoryResource::MEMORY_INPUT_FLAG | GPUMemoryResource::MEMORY_GPU | GPUMemoryResource::MEMORY_EXTERNAL | GPUMemoryResource::MEMORY_CUSTOM, "TRDInputBuffer");
}
void GPUTrackingInputProvider::SetMaxData(const GPUTrackingInOutPointers& io)
{
mHoldTPCZS = io.tpcZS && (mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCClusterFinding);
mHoldTPCClusterNative = (io.tpcZS || io.tpcPackedDigits || io.clustersNative || io.tpcCompressedClusters) && (mRec->IsGPU() || io.tpcCompressedClusters);
mHoldTPCOccupancyMap = (io.tpcZS || io.tpcPackedDigits || io.clustersNative || io.tpcCompressedClusters) && (mRec->GetParam().rec.tpc.occupancyMapTimeBins || mRec->GetParam().rec.tpc.sysClusErrorC12Norm);
mHoldTPCClusterNativeOutput = io.tpcZS || io.tpcPackedDigits || io.tpcCompressedClusters;
}