Skip to content

Commit e30ce92

Browse files
committed
ITS: GPU: propagate changes to framework
1 parent f965d0a commit e30ce92

File tree

11 files changed

+23
-51
lines changed

11 files changed

+23
-51
lines changed

GPU/GPUTracking/Base/GPUReconstruction.cxx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,11 @@ GPUReconstruction::~GPUReconstruction()
112112
}
113113
}
114114

115-
void GPUReconstruction::GetITSTraits(std::unique_ptr<o2::its::TrackerTraits<7>>* trackerTraits, std::unique_ptr<o2::its::VertexerTraits<7>>* vertexerTraits, std::unique_ptr<o2::its::TimeFrame<7>>* timeFrame)
115+
void GPUReconstruction::GetITSTraits(std::unique_ptr<o2::its::TrackerTraits<7>>* trackerTraits, std::unique_ptr<o2::its::TimeFrame<7>>* timeFrame)
116116
{
117117
if (trackerTraits) {
118118
trackerTraits->reset(new o2::its::TrackerTraits<7>);
119119
}
120-
if (vertexerTraits) {
121-
vertexerTraits->reset(new o2::its::VertexerTraits<7>);
122-
}
123120
if (timeFrame) {
124121
timeFrame->reset(new o2::its::TimeFrame<7>);
125122
}

GPU/GPUTracking/Base/GPUReconstruction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class GPUReconstruction
118118
TRD_SPACEPOINT = 17,
119119
TRD_TRIGGERRECORDS = 18,
120120
TF_SETTINGS = 19 };
121-
static constexpr const char* const IOTYPENAMES[] = {"TPC HLT Clusters", "TPC Sector Tracks", "TPC Sector Track Clusters", "TPC Cluster MC Labels", "TPC Track MC Informations", "TPC Tracks", "TPC Track Clusters", "TRD Tracks", "TRD Tracklets",
121+
static constexpr const char* const IOTYPENAMES[] = {"TPC HLT Clusters", "TPC Sector Tracks", "TPC Sector Track Clusters", "TPC Cluster MC Labels", "TPC Track MC Information", "TPC Tracks", "TPC Track Clusters", "TRD Tracks", "TRD Tracklets",
122122
"TPC Raw Clusters", "TPC Native Clusters", "TRD Tracklet MC Labels", "TPC Compressed Clusters", "TPC Digit", "TPC ZS Page", "TPC Native Clusters MC Labels", "TPC Digit MC Labeels",
123123
"TRD Spacepoints", "TRD Triggerrecords", "TF Settings"};
124124
static uint32_t getNIOTypeMultiplicity(InOutPointerType type) { return (type == CLUSTER_DATA || type == SECTOR_OUT_TRACK || type == SECTOR_OUT_CLUSTER || type == RAW_CLUSTERS || type == TPC_DIGIT || type == TPC_DIGIT_MC) ? NSECTORS : 1; }
@@ -192,7 +192,7 @@ class GPUReconstruction
192192
GPUMemorySizeScalers* MemoryScalers() { return mMemoryScalers.get(); }
193193

194194
// Helpers to fetch processors from other shared libraries
195-
virtual void GetITSTraits(std::unique_ptr<o2::its::TrackerTraits<7>>* trackerTraits, std::unique_ptr<o2::its::VertexerTraits<7>>* vertexerTraits, std::unique_ptr<o2::its::TimeFrame<7>>* timeFrame);
195+
virtual void GetITSTraits(std::unique_ptr<o2::its::TrackerTraits<7>>* trackerTraits, std::unique_ptr<o2::its::TimeFrame<7>>* timeFrame);
196196
bool slavesExist() { return mSlaves.size() || mMaster; }
197197
int slaveId() { return mSlaveId; }
198198

GPU/GPUTracking/Base/GPUReconstructionIncludesITS.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,22 @@
1717

1818
#if !defined(GPUCA_STANDALONE)
1919
#include "ITStracking/TrackerTraits.h"
20-
#include "ITStracking/VertexerTraits.h"
2120
#include "ITStracking/TimeFrame.h"
2221
#if defined(__CUDACC__) || defined(__HIPCC__)
2322
#include "ITStrackingGPU/TrackerTraitsGPU.h"
24-
#include "ITStrackingGPU/VertexerTraitsGPU.h"
2523
#include "ITStrackingGPU/TimeFrameGPU.h"
2624
#endif
2725
#else
2826
namespace o2::its
2927
{
3028
template <int32_t>
31-
class VertexerTraits
32-
{
33-
};
34-
template <int32_t>
3529
class TrackerTraits
3630
{
3731
};
3832
template <int32_t>
3933
class TimeFrame
4034
{
4135
};
42-
template <int32_t NLayers>
43-
class VertexerTraitsGPU : public VertexerTraits<NLayers>
44-
{
45-
};
4636
template <int32_t NLayers = 7>
4737
class TrackerTraitsGPU : public TrackerTraits<NLayers>
4838
{

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,11 @@ int32_t GPUReconstructionCUDA::GPUChkErrInternal(const int64_t error, const char
9191

9292
GPUReconstruction* GPUReconstruction_Create_CUDA(const GPUSettingsDeviceBackend& cfg) { return new GPUReconstructionCUDA(cfg); }
9393

94-
void GPUReconstructionCUDA::GetITSTraits(std::unique_ptr<o2::its::TrackerTraits<7>>* trackerTraits, std::unique_ptr<o2::its::VertexerTraits<7>>* vertexerTraits, std::unique_ptr<o2::its::TimeFrame<7>>* timeFrame)
94+
void GPUReconstructionCUDA::GetITSTraits(std::unique_ptr<o2::its::TrackerTraits<7>>* trackerTraits, std::unique_ptr<o2::its::TimeFrame<7>>* timeFrame)
9595
{
9696
if (trackerTraits) {
9797
trackerTraits->reset(new o2::its::TrackerTraitsGPU);
9898
}
99-
if (vertexerTraits) {
100-
vertexerTraits->reset(new o2::its::VertexerTraits<7>);
101-
// TODO gpu-code to be implemented then remove line above and uncomment line below
102-
// vertexerTraits->reset(new o2::its::VertexerTraitsGPU<7>);
103-
}
10499
if (timeFrame) {
105100
timeFrame->reset(new o2::its::gpu::TimeFrameGPU);
106101
}
@@ -333,9 +328,9 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
333328
}
334329
}
335330

336-
#ifndef __HIPCC__ // CUDA
331+
#ifndef __HIPCC__ // CUDA
337332
dummyInitKernel<<<mMultiprocessorCount, 256>>>(mDeviceMemoryBase); // TODO: Can't we just use the CUDA version and hipify will take care of the rest?
338-
#else // HIP
333+
#else // HIP
339334
hipLaunchKernelGGL(HIP_KERNEL_NAME(dummyInitKernel), dim3(mMultiprocessorCount), dim3(256), 0, 0, mDeviceMemoryBase);
340335
#endif
341336

@@ -374,7 +369,7 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
374369
#endif
375370
mDeviceConstantMem = (GPUConstantMem*)devPtrConstantMem;
376371

377-
GPUInfo("CUDA Initialisation successfull (Device %d: %s (Frequency %d, Cores %d), %ld / %ld bytes host / global memory, Stack frame %d, Constant memory %ld)", mDeviceId, deviceProp.name, deviceClockRate, deviceProp.multiProcessorCount, (int64_t)mHostMemorySize, (int64_t)mDeviceMemorySize, (int32_t)GPUCA_GPU_STACK_SIZE, (int64_t)gGPUConstantMemBufferSize);
372+
GPUInfo("CUDA Initialisation successful (Device %d: %s (Frequency %d, Cores %d), %ld / %ld bytes host / global memory, Stack frame %d, Constant memory %ld)", mDeviceId, deviceProp.name, deviceClockRate, deviceProp.multiProcessorCount, (int64_t)mHostMemorySize, (int64_t)mDeviceMemorySize, (int32_t)GPUCA_GPU_STACK_SIZE, (int64_t)gGPUConstantMemBufferSize);
378373
} else {
379374
GPUReconstructionCUDA* master = dynamic_cast<GPUReconstructionCUDA*>(mMaster);
380375
mDeviceId = master->mDeviceId;
@@ -388,7 +383,7 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
388383
mInternals = master->mInternals;
389384
GPUChkErr(cudaSetDevice(mDeviceId));
390385

391-
GPUInfo("CUDA Initialisation successfull (from master)");
386+
GPUInfo("CUDA Initialisation successful (from master)");
392387
}
393388

394389
for (uint32_t i = 0; i < mEvents.size(); i++) {

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class GPUReconstructionCUDA : public GPUReconstructionProcessing::KernelInterfac
7676
void RecordMarker(deviceEvent* ev, int32_t stream) override;
7777
void SetONNXGPUStream(Ort::SessionOptions& session_options, int32_t stream, int32_t* deviceId) override;
7878

79-
void GetITSTraits(std::unique_ptr<o2::its::TrackerTraits<7>>* trackerTraits, std::unique_ptr<o2::its::VertexerTraits<7>>* vertexerTraits, std::unique_ptr<o2::its::TimeFrame<7>>* timeFrame) override;
79+
void GetITSTraits(std::unique_ptr<o2::its::TrackerTraits<7>>* trackerTraits, std::unique_ptr<o2::its::TimeFrame<7>>* timeFrame) override;
8080

8181
#ifndef __HIPCC__ // CUDA
8282
bool CanQueryMaxMemory() override { return true; }

GPU/GPUTracking/Global/GPUChainITS.cxx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,15 @@ int32_t GPUChainITS::Init() { return 0; }
5454
o2::its::TrackerTraits<7>* GPUChainITS::GetITSTrackerTraits()
5555
{
5656
if (mITSTrackerTraits == nullptr) {
57-
mRec->GetITSTraits(&mITSTrackerTraits, nullptr, nullptr);
57+
mRec->GetITSTraits(&mITSTrackerTraits, nullptr);
5858
}
5959
return mITSTrackerTraits.get();
6060
}
6161

62-
o2::its::VertexerTraits<7>* GPUChainITS::GetITSVertexerTraits()
63-
{
64-
if (mITSVertexerTraits == nullptr) {
65-
mRec->GetITSTraits(nullptr, &mITSVertexerTraits, nullptr);
66-
}
67-
return mITSVertexerTraits.get();
68-
}
69-
7062
o2::its::TimeFrame<7>* GPUChainITS::GetITSTimeframe()
7163
{
7264
if (mITSTimeFrame == nullptr) {
73-
mRec->GetITSTraits(nullptr, nullptr, &mITSTimeFrame);
65+
mRec->GetITSTraits(nullptr, &mITSTimeFrame);
7466
}
7567
#if !defined(GPUCA_STANDALONE)
7668
if (mITSTimeFrame->isGPU()) {

GPU/GPUTracking/Global/GPUChainITS.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,13 @@ class GPUChainITS final : public GPUChain
4545
void MemorySize(size_t&, size_t&) final {};
4646

4747
o2::its::TrackerTraits<7>* GetITSTrackerTraits();
48-
o2::its::VertexerTraits<7>* GetITSVertexerTraits();
4948
o2::its::TimeFrame<7>* GetITSTimeframe();
5049

5150
protected:
5251
GPUChainITS(GPUReconstruction* rec);
5352
std::unique_ptr<o2::its::GPUFrameworkExternalAllocator> mFrameworkAllocator;
5453
std::unique_ptr<o2::its::TimeFrame<7>> mITSTimeFrame;
5554
std::unique_ptr<o2::its::TrackerTraits<7>> mITSTrackerTraits;
56-
std::unique_ptr<o2::its::VertexerTraits<7>> mITSVertexerTraits;
5755
};
5856
} // namespace o2::gpu
5957

GPU/GPUTracking/Interface/GPUO2Interface.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,9 @@ void GPUO2Interface::setErrorCodeOutput(std::vector<std::array<uint32_t, 4>>* v)
252252
}
253253
}
254254

255-
void GPUO2Interface::GetITSTraits(o2::its::TrackerTraits<7>*& trackerTraits, o2::its::VertexerTraits<7>*& vertexerTraits, o2::its::TimeFrame<7>*& timeFrame)
255+
void GPUO2Interface::GetITSTraits(o2::its::TrackerTraits<7>*& trackerTraits, o2::its::TimeFrame<7>*& timeFrame)
256256
{
257257
trackerTraits = mChainITS->GetITSTrackerTraits();
258-
vertexerTraits = mChainITS->GetITSVertexerTraits();
259258
timeFrame = mChainITS->GetITSTimeframe();
260259
}
261260

GPU/GPUTracking/Interface/GPUO2Interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class GPUO2Interface
7474
void DumpEvent(int32_t nEvent, GPUTrackingInOutPointers* data, uint32_t iThread, const char* dir = "");
7575
void DumpSettings(uint32_t iThread, const char* dir = "");
7676

77-
void GetITSTraits(o2::its::TrackerTraits<7>*& trackerTraits, o2::its::VertexerTraits<7>*& vertexerTraits, o2::its::TimeFrame<7>*& timeFrame);
77+
void GetITSTraits(o2::its::TrackerTraits<7>*& trackerTraits, o2::its::TimeFrame<7>*& timeFrame);
7878
const o2::base::Propagator* GetDeviceO2Propagator(int32_t iThread = 0) const;
7979
void UseGPUPolynomialFieldInPropagator(o2::base::Propagator* prop) const;
8080

GPU/Workflow/src/GPUWorkflowITS.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ void GPURecoWorkflowSpec::initFunctionITS(o2::framework::InitContext& ic)
5555
mITSTrackingInterface = std::make_unique<o2::its::ITSTrackingInterface>(mSpecConfig.processMC,
5656
mSpecConfig.itsTriggerType,
5757
mSpecConfig.itsOverrBeamEst);
58-
mGPUReco->GetITSTraits(trkTraits, vtxTraits, mITSTimeFrame);
59-
mITSTrackingInterface->setTraitsFromProvider(vtxTraits, trkTraits, mITSTimeFrame);
58+
mGPUReco->GetITSTraits(trkTraits, mITSTimeFrame);
59+
mITSTrackingInterface->setTraitsFromProvider(trkTraits, mITSTimeFrame);
6060
}
6161

6262
void GPURecoWorkflowSpec::finaliseCCDBITS(o2::framework::ConcreteDataMatcher& matcher, void* obj)

0 commit comments

Comments
 (0)