From 467c2d80f390491c06aa9297fd67878463455e0e Mon Sep 17 00:00:00 2001 From: David Rohr Date: Sun, 16 Nov 2025 23:53:42 +0100 Subject: [PATCH 1/3] GPU: Forward-declare GPUProcessor in GPUMemoryResource --- GPU/GPUTracking/Base/GPUMemoryResource.cxx | 11 +++++++++++ GPU/GPUTracking/Base/GPUMemoryResource.h | 16 ++++++++-------- GPU/GPUTracking/Base/GPUReconstruction.cxx | 2 +- GPU/GPUTracking/Base/GPUReconstruction.h | 9 ++++----- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/GPU/GPUTracking/Base/GPUMemoryResource.cxx b/GPU/GPUTracking/Base/GPUMemoryResource.cxx index b22267859345a..aaf31837d04e3 100644 --- a/GPU/GPUTracking/Base/GPUMemoryResource.cxx +++ b/GPU/GPUTracking/Base/GPUMemoryResource.cxx @@ -13,4 +13,15 @@ /// \author David Rohr #include "GPUMemoryResource.h" +#include "GPUProcessor.h" using namespace o2::gpu; + +void* GPUMemoryResource::SetPointers(void* ptr) const +{ + return (mProcessor->*mSetPointers)(ptr); +} + +void* GPUMemoryResource::SetDevicePointers(void* ptr) const +{ + return (mProcessor->mLinkedProcessor->*mSetPointers)(ptr); +} diff --git a/GPU/GPUTracking/Base/GPUMemoryResource.h b/GPU/GPUTracking/Base/GPUMemoryResource.h index 947bcac504733..79960af9bc188 100644 --- a/GPU/GPUTracking/Base/GPUMemoryResource.h +++ b/GPU/GPUTracking/Base/GPUMemoryResource.h @@ -16,11 +16,14 @@ #define GPUMEMORYRESOURCE_H #include "GPUCommonDef.h" -#include "GPUProcessor.h" +#ifndef GPUCA_GPUCODE_DEVICE +#include +#endif namespace o2::gpu { +class GPUProcessor; struct GPUMemoryReuse { enum Type : int32_t { NONE = 0, @@ -80,13 +83,10 @@ class GPUMemoryResource } GPUMemoryResource(const GPUMemoryResource&) = default; - void* SetPointers(void* ptr) - { - return (mProcessor->*mSetPointers)(ptr); - } - void* SetDevicePointers(void* ptr) { return (mProcessor->mLinkedProcessor->*mSetPointers)(ptr); } - void* Ptr() { return mPtr; } - void* PtrDevice() { return mPtrDevice; } + void* SetPointers(void* ptr) const; + void* SetDevicePointers(void* ptr) const; + void* Ptr() const { return mPtr; } + void* PtrDevice() const { return mPtrDevice; } size_t Size() const { return mSize; } const char* Name() const { return mName; } MemoryType Type() const { return mType; } diff --git a/GPU/GPUTracking/Base/GPUReconstruction.cxx b/GPU/GPUTracking/Base/GPUReconstruction.cxx index 5129ccc4becf1..01af74d903f72 100644 --- a/GPU/GPUTracking/Base/GPUReconstruction.cxx +++ b/GPU/GPUTracking/Base/GPUReconstruction.cxx @@ -567,7 +567,7 @@ size_t GPUReconstruction::AllocateRegisteredPermanentMemory() return total; } -size_t GPUReconstruction::AllocateRegisteredMemoryHelper(GPUMemoryResource* res, void*& ptr, void*& memorypool, void* memorybase, size_t memorysize, void* (GPUMemoryResource::*setPtr)(void*), void*& memorypoolend, const char* device) +size_t GPUReconstruction::AllocateRegisteredMemoryHelper(GPUMemoryResource* res, void*& ptr, void*& memorypool, void* memorybase, size_t memorysize, void* (GPUMemoryResource::*setPtr)(void*) const, void*& memorypoolend, const char* device) { if (res->mReuse >= 0) { ptr = (&ptr == &res->mPtrDevice) ? mMemoryResources[res->mReuse].mPtrDevice : mMemoryResources[res->mReuse].mPtr; diff --git a/GPU/GPUTracking/Base/GPUReconstruction.h b/GPU/GPUTracking/Base/GPUReconstruction.h index b7eda77aeb9fe..fa636fa416538 100644 --- a/GPU/GPUTracking/Base/GPUReconstruction.h +++ b/GPU/GPUTracking/Base/GPUReconstruction.h @@ -30,10 +30,9 @@ #include "GPUDataTypes.h" #include "GPUMemoryResource.h" #include "GPUOutputControl.h" - -/*#include "GPUParam.h" -#include "GPUSettings.h" -#include "GPULogging.h"*/ +#include "GPUParam.h" +#include "GPUConstantMem.h" +#include "GPUDef.h" namespace o2::its { @@ -280,7 +279,7 @@ class GPUReconstruction static std::string getBackendVersions(); // Private helper functions for memory management - size_t AllocateRegisteredMemoryHelper(GPUMemoryResource* res, void*& ptr, void*& memorypool, void* memorybase, size_t memorysize, void* (GPUMemoryResource::*SetPointers)(void*), void*& memorypoolend, const char* device); + size_t AllocateRegisteredMemoryHelper(GPUMemoryResource* res, void*& ptr, void*& memorypool, void* memorybase, size_t memorysize, void* (GPUMemoryResource::*SetPointers)(void*) const, void*& memorypoolend, const char* device); size_t AllocateRegisteredPermanentMemory(); // Private helper functions for reading / writing / allocating IO buffer from/to file From 6be78bc0fb326eff5f4fc66a8380e55794a34b58 Mon Sep 17 00:00:00 2001 From: David Rohr Date: Mon, 17 Nov 2025 01:28:03 +0100 Subject: [PATCH 2/3] GPU: Remove some preprocessor defines, move to GPUParam --- .../Definitions/GPUDefConstantsAndSettings.h | 2 -- GPU/GPUTracking/Definitions/GPUSettingsList.h | 4 ++-- GPU/GPUTracking/qa/GPUQA.cxx | 16 ++++++++-------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h b/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h index e5a2c8eb75bcb..b8b017f04c612 100644 --- a/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h +++ b/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h @@ -35,8 +35,6 @@ #define GPUCA_MERGER_MAX_TRACK_CLUSTERS 1024 // Maximum number of clusters a track may have after merging #define GPUCA_MAXN 40 // Maximum number of neighbor hits to consider in one row in neightbors finder -#define GPUCA_MIN_TRACK_PTB5_DEFAULT 0.010f // Default setting for minimum track Pt at some places (at B=0.5T) -#define GPUCA_MIN_TRACK_PTB5_REJECT_DEFAULT 0.050f // Default setting for Pt (at B=0.5T) where tracks are rejected #define GPUCA_MAX_SIN_PHI_LOW 0.99f // Limits for maximum sin phi during fit #define GPUCA_MAX_SIN_PHI 0.999f // Must be preprocessor define because c++ pre 11 cannot use static constexpr for initializes diff --git a/GPU/GPUTracking/Definitions/GPUSettingsList.h b/GPU/GPUTracking/Definitions/GPUSettingsList.h index 2f1eb72cb3d00..20bb746117d15 100644 --- a/GPU/GPUTracking/Definitions/GPUSettingsList.h +++ b/GPU/GPUTracking/Definitions/GPUSettingsList.h @@ -39,7 +39,7 @@ BeginNamespace(gpu) // Reconstruction parameters for TPC, no bool in here !!! BeginSubConfig(GPUSettingsRecTPC, tpc, configStandalone.rec, "RECTPC", 0, "Reconstruction settings", rec_tpc) -AddOptionRTC(rejectQPtB5, float, 1.f / GPUCA_MIN_TRACK_PTB5_REJECT_DEFAULT, "", 0, "QPt threshold to reject clusters of TPC tracks (Inverse Pt, scaled to B=0.5T!!!)") +AddOptionRTC(rejectQPtB5, float, 1.f / 0.050f, "", 0, "QPt threshold to reject clusters of TPC tracks (Inverse Pt, scaled to B=0.5T!!!)") AddOptionRTC(hitPickUpFactor, float, 1.f, "", 0, "multiplier for the combined cluster+track error during track following") AddOptionRTC(hitSearchArea2, float, 2.f, "", 0, "square of maximum search road of hits during seeding") AddOptionRTC(neighboursSearchArea, float, 3.f, "", 0, "area in cm for the search of neighbours, for z only used if searchWindowDZDR = 0") @@ -195,7 +195,7 @@ EndConfig() // Global reconstruction parameters, no bool in here !!! BeginSubConfig(GPUSettingsRec, rec, configStandalone, "REC", 0, "Reconstruction settings", rec) -AddOptionRTC(maxTrackQPtB5, float, 1.f / GPUCA_MIN_TRACK_PTB5_DEFAULT, "", 0, "required max Q/Pt (==min Pt) of tracks") +AddOptionRTC(maxTrackQPtB5, float, 1.f / 0.010f, "", 0, "required max Q/Pt (==min Pt) of tracks") AddOptionRTC(fwdTPCDigitsAsClusters, uint8_t, 0, "", 0, "Forward TPC digits as clusters (if they pass the ZS threshold)") AddOptionRTC(bz0Pt10MeV, uint8_t, 60, "", 0, "Nominal Pt to set when bz = 0 (in 10 MeV)") AddOptionRTC(fitInProjections, int8_t, -1, "", 0, "Fit in projection, -1 to enable full fit for all but passes but the first one") diff --git a/GPU/GPUTracking/qa/GPUQA.cxx b/GPU/GPUTracking/qa/GPUQA.cxx index 5fd1c259393bb..ce4a4a81db02c 100644 --- a/GPU/GPUTracking/qa/GPUQA.cxx +++ b/GPU/GPUTracking/qa/GPUQA.cxx @@ -146,9 +146,9 @@ static const constexpr float LOG_PT_MIN = -1.; static constexpr float Y_MAX = 40; static constexpr float Z_MAX = 100; -static constexpr float PT_MIN = GPUCA_MIN_TRACK_PTB5_DEFAULT; +static constexpr float PT_MIN = 0.01; // TODO: Take from Param static constexpr float PT_MIN_PRIM = 0.1; -static constexpr float PT_MIN_CLUST = GPUCA_MIN_TRACK_PTB5_DEFAULT; +static constexpr float PT_MIN_CLUST = 0.01; static constexpr float PT_MAX = 20; static constexpr float ETA_MAX = 1.5; static constexpr float ETA_MAX2 = 0.9; @@ -1495,7 +1495,7 @@ void GPUQA::RunQA(bool matchOnly, const std::vector* tracksEx int32_t hitId = mTracking->mIOPtrs.mergedTrackHits[track.FirstClusterRef() + k].num; float totalWeight = 0.; for (int32_t j = 0; j < GetMCLabelNID(hitId); j++) { - if (GetMCLabelID(hitId, j) >= 0 && GetMCTrackObj(mMCParam, GetMCLabel(hitId, j)).pt > GPUCA_MIN_TRACK_PTB5_DEFAULT) { + if (GetMCLabelID(hitId, j) >= 0 && GetMCTrackObj(mMCParam, GetMCLabel(hitId, j)).pt > 1.f / mTracking->GetParam().rec.maxTrackQPtB5) { totalWeight += GetMCLabelWeight(hitId, j); } } @@ -1505,7 +1505,7 @@ void GPUQA::RunQA(bool matchOnly, const std::vector* tracksEx float weight = 1.f / (totalWeight * (mClusterParam[hitId].attached + mClusterParam[hitId].fakeAttached)); for (int32_t j = 0; j < GetMCLabelNID(hitId); j++) { mcLabelI_t label = GetMCLabel(hitId, j); - if (!label.isFake() && GetMCTrackObj(mMCParam, label).pt > GPUCA_MIN_TRACK_PTB5_DEFAULT) { + if (!label.isFake() && GetMCTrackObj(mMCParam, label).pt > 1.f / mTracking->GetParam().rec.maxTrackQPtB5) { float pt = GetMCTrackObj(mMCParam, label).pt; if (pt < PT_MIN_CLUST) { pt = PT_MIN_CLUST; @@ -1594,7 +1594,7 @@ void GPUQA::RunQA(bool matchOnly, const std::vector* tracksEx float totalWeight = 0.; for (int32_t j = 0; j < GetMCLabelNID(i); j++) { mcLabelI_t labelT = GetMCLabel(i, j); - if (!labelT.isFake() && GetMCTrackObj(mMCParam, labelT).pt > GPUCA_MIN_TRACK_PTB5_DEFAULT) { + if (!labelT.isFake() && GetMCTrackObj(mMCParam, labelT).pt > 1.f / mTracking->GetParam().rec.maxTrackQPtB5) { totalWeight += GetMCLabelWeight(i, j); } } @@ -1602,7 +1602,7 @@ void GPUQA::RunQA(bool matchOnly, const std::vector* tracksEx if (totalWeight > 0) { for (int32_t j = 0; j < GetMCLabelNID(i); j++) { mcLabelI_t labelT = GetMCLabel(i, j); - if (!labelT.isFake() && GetMCTrackObj(mMCParam, labelT).pt > GPUCA_MIN_TRACK_PTB5_DEFAULT) { + if (!labelT.isFake() && GetMCTrackObj(mMCParam, labelT).pt > 1.f / mTracking->GetParam().rec.maxTrackQPtB5) { float pt = GetMCTrackObj(mMCParam, labelT).pt; if (pt < PT_MIN_CLUST) { pt = PT_MIN_CLUST; @@ -1652,14 +1652,14 @@ void GPUQA::RunQA(bool matchOnly, const std::vector* tracksEx float totalWeight = 0.; for (int32_t j = 0; j < GetMCLabelNID(i); j++) { mcLabelI_t labelT = GetMCLabel(i, j); - if (!labelT.isFake() && GetMCTrackObj(mMCParam, labelT).pt > GPUCA_MIN_TRACK_PTB5_DEFAULT) { + if (!labelT.isFake() && GetMCTrackObj(mMCParam, labelT).pt > 1.f / mTracking->GetParam().rec.maxTrackQPtB5) { totalWeight += GetMCLabelWeight(i, j); } } if (totalWeight > 0) { for (int32_t j = 0; j < GetMCLabelNID(i); j++) { mcLabelI_t label = GetMCLabel(i, j); - if (!label.isFake() && GetMCTrackObj(mMCParam, label).pt > GPUCA_MIN_TRACK_PTB5_DEFAULT) { + if (!label.isFake() && GetMCTrackObj(mMCParam, label).pt > 1.f / mTracking->GetParam().rec.maxTrackQPtB5) { float pt = GetMCTrackObj(mMCParam, label).pt; if (pt < PT_MIN_CLUST) { pt = PT_MIN_CLUST; From a6ec44a46e0871ca509d6a2cc54a5c6044a8ea09 Mon Sep 17 00:00:00 2001 From: David Rohr Date: Mon, 17 Nov 2025 00:02:23 +0100 Subject: [PATCH 3/3] GPU: Add GPUO2ExternalUser.h, to be included by external libraries using GPUTracking classes, instead of including the full GPUO2Interface.h --- .../Workflow/src/BarrelAlignmentSpec.cxx | 2 +- Detectors/Align/include/Align/Controller.h | 2 +- Detectors/Align/src/AlignableDetectorTPC.cxx | 2 +- Detectors/Align/src/Controller.cxx | 2 +- Detectors/GlobalTracking/src/MatchTPCITS.cxx | 2 +- .../study/src/TrackingStudy.cxx | 2 +- .../include/ITStracking/TrackingInterface.h | 2 +- .../calibration/src/CalibPadGainTracks.cxx | 2 +- .../src/TPCTrackingDigitsPreCheck.cxx | 2 +- .../TRDWorkflow/TRDGlobalTrackingSpec.h | 2 +- .../Definitions/GPUDefConstantsAndSettings.h | 2 +- GPU/GPUTracking/Definitions/GPUSettingsList.h | 2 +- GPU/GPUTracking/Interface/CMakeLists.txt | 2 +- GPU/GPUTracking/Interface/GPUO2ExternalUser.h | 26 +++++++++++++++++++ GPU/GPUTracking/Interface/GPUO2Interface.h | 12 +++------ .../GPUO2InterfaceConfigurableParam.h | 8 ++---- .../Interface/GPUO2InterfaceConfiguration.h | 18 +++++-------- .../Interface/GPUO2InterfaceDisplay.h | 9 +------ GPU/GPUTracking/Interface/GPUO2InterfaceQA.h | 9 +------ .../Interface/GPUO2InterfaceRefit.h | 9 +------ GPU/GPUTracking/display/GPUDisplay.h | 1 + GPU/Workflow/src/GPUWorkflowITS.cxx | 1 + 22 files changed, 55 insertions(+), 64 deletions(-) create mode 100644 GPU/GPUTracking/Interface/GPUO2ExternalUser.h diff --git a/Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx b/Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx index 559eabc3f018b..d4ab53c8181ce 100644 --- a/Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx +++ b/Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx @@ -37,7 +37,7 @@ #include "CommonUtils/TreeStreamRedirector.h" #include "TPCCalibration/VDriftHelper.h" #include "TPCCalibration/CorrectionMapsLoader.h" -#include "GPUO2Interface.h" +#include "GPUO2ExternalUser.h" #include "GPUO2InterfaceUtils.h" #include "GPUParam.h" #include "Headers/DataHeader.h" diff --git a/Detectors/Align/include/Align/Controller.h b/Detectors/Align/include/Align/Controller.h index 96ee2e4fcf418..90abf2025d1c3 100644 --- a/Detectors/Align/include/Align/Controller.h +++ b/Detectors/Align/include/Align/Controller.h @@ -54,7 +54,7 @@ #include #include #include "Align/Mille.h" -// #include "GPUO2Interface.h" +// #include "GPUO2ExternalUser.h" // #include "DataFormatsTPC/WorkflowHelper.h" namespace o2 diff --git a/Detectors/Align/src/AlignableDetectorTPC.cxx b/Detectors/Align/src/AlignableDetectorTPC.cxx index b3d2102559974..980ded2d8ff2f 100644 --- a/Detectors/Align/src/AlignableDetectorTPC.cxx +++ b/Detectors/Align/src/AlignableDetectorTPC.cxx @@ -24,7 +24,7 @@ #include "DataFormatsTPC/WorkflowHelper.h" #include #include -#include "GPUO2Interface.h" +#include "GPUO2ExternalUser.h" #include "DataFormatsTPC/WorkflowHelper.h" #include "GPUParam.inc" diff --git a/Detectors/Align/src/Controller.cxx b/Detectors/Align/src/Controller.cxx index a45314b2285c0..5cfbbf9f3a4ae 100644 --- a/Detectors/Align/src/Controller.cxx +++ b/Detectors/Align/src/Controller.cxx @@ -44,7 +44,7 @@ #include #include #include -#include "GPUO2Interface.h" +#include "GPUO2ExternalUser.h" #include "DataFormatsTPC/WorkflowHelper.h" #include #include "CommonUtils/NameConf.h" diff --git a/Detectors/GlobalTracking/src/MatchTPCITS.cxx b/Detectors/GlobalTracking/src/MatchTPCITS.cxx index 7e3f8d9f78fc9..9c1a32a262e51 100644 --- a/Detectors/GlobalTracking/src/MatchTPCITS.cxx +++ b/Detectors/GlobalTracking/src/MatchTPCITS.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "GPUO2Interface.h" // Needed for propper settings in GPUParam.h +#include "GPUO2ExternalUser.h" // Needed for propper settings in GPUParam.h #include "GPUParam.h" #include "GPUParam.inc" #ifdef WITH_OPENMP diff --git a/Detectors/GlobalTrackingWorkflow/study/src/TrackingStudy.cxx b/Detectors/GlobalTrackingWorkflow/study/src/TrackingStudy.cxx index f1a07c10d0318..531ee03290201 100644 --- a/Detectors/GlobalTrackingWorkflow/study/src/TrackingStudy.cxx +++ b/Detectors/GlobalTrackingWorkflow/study/src/TrackingStudy.cxx @@ -44,7 +44,7 @@ #include "TPCCalibration/VDriftHelper.h" #include "TPCCalibration/CorrectionMapsLoader.h" #include "GPUO2InterfaceRefit.h" -#include "GPUO2Interface.h" // Needed for propper settings in GPUParam.h +#include "GPUO2ExternalUser.h" // Needed for propper settings in GPUParam.h #include "GPUParam.h" #include "GPUParam.inc" #include "GPUTPCGeometry.h" diff --git a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackingInterface.h b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackingInterface.h index 491d2df4697ac..d31b1f11a4983 100644 --- a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackingInterface.h +++ b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackingInterface.h @@ -25,7 +25,7 @@ #include "DataFormatsCalibration/MeanVertexObject.h" #include "GPUDataTypes.h" -#include "GPUO2Interface.h" +#include "GPUO2ExternalUser.h" #include "GPUChainITS.h" #include diff --git a/Detectors/TPC/calibration/src/CalibPadGainTracks.cxx b/Detectors/TPC/calibration/src/CalibPadGainTracks.cxx index 93cdb7c47ee37..094de6b830272 100644 --- a/Detectors/TPC/calibration/src/CalibPadGainTracks.cxx +++ b/Detectors/TPC/calibration/src/CalibPadGainTracks.cxx @@ -22,7 +22,7 @@ #include "CorrectionMapsHelper.h" #include "TPCReconstruction/TPCFastTransformHelperO2.h" #include "GPUO2InterfaceRefit.h" -#include "GPUO2Interface.h" +#include "GPUO2ExternalUser.h" #include "DataFormatsTPC/ClusterNative.h" #include "DataFormatsTPC/VDriftCorrFact.h" #include "DetectorsBase/Propagator.h" diff --git a/Detectors/TPC/reconstruction/src/TPCTrackingDigitsPreCheck.cxx b/Detectors/TPC/reconstruction/src/TPCTrackingDigitsPreCheck.cxx index 738e6cff20df4..c6f7000089d72 100644 --- a/Detectors/TPC/reconstruction/src/TPCTrackingDigitsPreCheck.cxx +++ b/Detectors/TPC/reconstruction/src/TPCTrackingDigitsPreCheck.cxx @@ -19,7 +19,7 @@ #include "DataFormatsTPC/Digit.h" #include "DataFormatsTPC/ClusterNative.h" -#include "GPUO2Interface.h" +#include "GPUO2ExternalUser.h" #include "GPUO2InterfaceConfiguration.h" #include "TPCBase/Sector.h" #include "Framework/Logger.h" diff --git a/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingSpec.h b/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingSpec.h index b4bfbddf7a4e6..9f3b9b27d37b5 100644 --- a/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingSpec.h +++ b/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingSpec.h @@ -18,7 +18,7 @@ #include "Framework/Task.h" #include "TStopwatch.h" #include "TRDBase/GeometryFlat.h" -#include "GPUO2Interface.h" +#include "GPUO2ExternalUser.h" #include "GPUTRDTracker.h" #include "ReconstructionDataFormats/GlobalTrackID.h" #include "DataFormatsGlobalTracking/RecoContainer.h" diff --git a/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h b/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h index b8b017f04c612..0644e533e9d64 100644 --- a/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h +++ b/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h @@ -23,7 +23,7 @@ #include "GPUCommonDef.h" #if !defined(GPUCA_STANDALONE) && !defined(GPUCA_O2_LIB) && !defined(GPUCA_O2_INTERFACE) - #error You are using the CA GPU tracking without defining the build type (O2/Standalone). If you are running an O2 ROOT macro, please include GPUO2Interface.h first! + #error You are using the CA GPU tracking without defining the build type (O2/Standalone). If you are running an O2 ROOT macro, please include GPUO2ExternalUser.h first! #endif #if (defined(GPUCA_O2_LIB) && defined(GPUCA_STANDALONE)) diff --git a/GPU/GPUTracking/Definitions/GPUSettingsList.h b/GPU/GPUTracking/Definitions/GPUSettingsList.h index 20bb746117d15..5c4c95b451bed 100644 --- a/GPU/GPUTracking/Definitions/GPUSettingsList.h +++ b/GPU/GPUTracking/Definitions/GPUSettingsList.h @@ -19,7 +19,7 @@ // Create plain-C struct for GPU code. // Create static constexpr with default values for GPU run time compilation -#include "GPUDefConstantsAndSettings.h" +#include "GPUCommonDef.h" #ifndef GPUSETTINGS_H #error Please include GPUSettings.h! #endif diff --git a/GPU/GPUTracking/Interface/CMakeLists.txt b/GPU/GPUTracking/Interface/CMakeLists.txt index e532b24f97908..169b043b992bc 100644 --- a/GPU/GPUTracking/Interface/CMakeLists.txt +++ b/GPU/GPUTracking/Interface/CMakeLists.txt @@ -23,7 +23,7 @@ if(OPENGL_FOUND endif() string(REPLACE ".cxx" ".h" HDRS_TMP "${SRCS}") -set(HDRS ${HDRS_TMP}) +set(HDRS ${HDRS_TMP} GPUO2ExternalUser.h) o2_add_library(${MODULE} SOURCES ${SRCS} diff --git a/GPU/GPUTracking/Interface/GPUO2ExternalUser.h b/GPU/GPUTracking/Interface/GPUO2ExternalUser.h new file mode 100644 index 0000000000000..1e5261e0065a6 --- /dev/null +++ b/GPU/GPUTracking/Interface/GPUO2ExternalUser.h @@ -0,0 +1,26 @@ +// 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 GPUO2ExternalUser.h +/// \author David Rohr + +#ifndef GPUO2EXTERNALUSER_H +#define GPUO2EXTERNALUSER_H + +// Some defines denoting that we are compiling for O2 +#ifndef GPUCA_TPC_GEOMETRY_O2 +#define GPUCA_TPC_GEOMETRY_O2 +#endif +#ifndef GPUCA_O2_INTERFACE +#define GPUCA_O2_INTERFACE +#endif + +#endif diff --git a/GPU/GPUTracking/Interface/GPUO2Interface.h b/GPU/GPUTracking/Interface/GPUO2Interface.h index 0e2020b306984..00c72cc5e3359 100644 --- a/GPU/GPUTracking/Interface/GPUO2Interface.h +++ b/GPU/GPUTracking/Interface/GPUO2Interface.h @@ -15,19 +15,13 @@ #ifndef GPUO2INTERFACE_H #define GPUO2INTERFACE_H -// Some defines denoting that we are compiling for O2 -#ifndef GPUCA_TPC_GEOMETRY_O2 -#define GPUCA_TPC_GEOMETRY_O2 -#endif -#ifndef GPUCA_O2_INTERFACE -#define GPUCA_O2_INTERFACE -#endif +#include "GPUO2ExternalUser.h" +#include "GPUCommonDef.h" +#include "GPUDataTypes.h" #include #include #include -#include "GPUCommonDef.h" -#include "GPUDataTypes.h" namespace o2::base { diff --git a/GPU/GPUTracking/Interface/GPUO2InterfaceConfigurableParam.h b/GPU/GPUTracking/Interface/GPUO2InterfaceConfigurableParam.h index ebb426b7a8cfe..676d2c22f57c7 100644 --- a/GPU/GPUTracking/Interface/GPUO2InterfaceConfigurableParam.h +++ b/GPU/GPUTracking/Interface/GPUO2InterfaceConfigurableParam.h @@ -22,12 +22,8 @@ #ifndef GPUO2INTERFACECONFIGURABLEPARAM_H #define GPUO2INTERFACECONFIGURABLEPARAM_H -// Some defines denoting that we are compiling for O2 -#ifndef GPUCA_TPC_GEOMETRY_O2 -#define GPUCA_TPC_GEOMETRY_O2 -#endif -#ifndef GPUCA_O2_INTERFACE -#define GPUCA_O2_INTERFACE +#if !defined(GPUCA_STANDALONE) && !defined(GPUCA_O2_LIB) +#include "GPUO2ExternalUser.h" #endif #include "CommonUtils/ConfigurableParam.h" diff --git a/GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h b/GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h index af597fc4bf6b9..f378fc2c4fb7b 100644 --- a/GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h +++ b/GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h @@ -15,23 +15,17 @@ #ifndef GPUO2INTERFACECONFIGURATION_H #define GPUO2INTERFACECONFIGURATION_H -#ifndef GPUCA_TPC_GEOMETRY_O2 -#define GPUCA_TPC_GEOMETRY_O2 -#endif -#ifndef GPUCA_O2_INTERFACE -#define GPUCA_O2_INTERFACE -#endif - -#include -#include -#include -#include -#include +#include "GPUO2ExternalUser.h" #include "GPUSettings.h" #include "GPUDataTypes.h" #include "GPUHostDataTypes.h" #include "GPUOutputControl.h" #include "DataFormatsTPC/Constants.h" +#include +#include +#include +#include +#include // TODO: Get rid of gsl class TH1F; class TH1D; diff --git a/GPU/GPUTracking/Interface/GPUO2InterfaceDisplay.h b/GPU/GPUTracking/Interface/GPUO2InterfaceDisplay.h index e6d9cb76aed79..a7e9d309b6d3d 100644 --- a/GPU/GPUTracking/Interface/GPUO2InterfaceDisplay.h +++ b/GPU/GPUTracking/Interface/GPUO2InterfaceDisplay.h @@ -15,14 +15,7 @@ #ifndef GPUO2INTERFACEDisplay_H #define GPUO2INTERFACEDisplay_H -// Some defines denoting that we are compiling for O2 -#ifndef GPUCA_TPC_GEOMETRY_O2 -#define GPUCA_TPC_GEOMETRY_O2 -#endif -#ifndef GPUCA_O2_INTERFACE -#define GPUCA_O2_INTERFACE -#endif - +#include "GPUO2ExternalUser.h" #include #include #include "GPUDataTypes.h" diff --git a/GPU/GPUTracking/Interface/GPUO2InterfaceQA.h b/GPU/GPUTracking/Interface/GPUO2InterfaceQA.h index 18af81b6cedc7..3fc4cda0a1dcc 100644 --- a/GPU/GPUTracking/Interface/GPUO2InterfaceQA.h +++ b/GPU/GPUTracking/Interface/GPUO2InterfaceQA.h @@ -15,14 +15,7 @@ #ifndef GPUO2INTERFACEQA_H #define GPUO2INTERFACEQA_H -// Some defines denoting that we are compiling for O2 -#ifndef GPUCA_TPC_GEOMETRY_O2 -#define GPUCA_TPC_GEOMETRY_O2 -#endif -#ifndef GPUCA_O2_INTERFACE -#define GPUCA_O2_INTERFACE -#endif - +#include "GPUO2ExternalUser.h" #include #include diff --git a/GPU/GPUTracking/Interface/GPUO2InterfaceRefit.h b/GPU/GPUTracking/Interface/GPUO2InterfaceRefit.h index 9f743c89d5743..d4aa6900e308a 100644 --- a/GPU/GPUTracking/Interface/GPUO2InterfaceRefit.h +++ b/GPU/GPUTracking/Interface/GPUO2InterfaceRefit.h @@ -15,14 +15,7 @@ #ifndef GPUO2INTERFACEREFIT_H #define GPUO2INTERFACEREFIT_H -// Some defines denoting that we are compiling for O2 -#ifndef GPUCA_TPC_GEOMETRY_O2 -#define GPUCA_TPC_GEOMETRY_O2 -#endif -#ifndef GPUCA_O2_INTERFACE -#define GPUCA_O2_INTERFACE -#endif - +#include "GPUO2ExternalUser.h" #include #include #include diff --git a/GPU/GPUTracking/display/GPUDisplay.h b/GPU/GPUTracking/display/GPUDisplay.h index 7279f2ee87fdb..837995ef38bb4 100644 --- a/GPU/GPUTracking/display/GPUDisplay.h +++ b/GPU/GPUTracking/display/GPUDisplay.h @@ -19,6 +19,7 @@ #include "backend/GPUDisplayBackend.h" #include "GPUDisplayInterface.h" #include "GPUSettings.h" +#include "GPUDefConstantsAndSettings.h" #include #include diff --git a/GPU/Workflow/src/GPUWorkflowITS.cxx b/GPU/Workflow/src/GPUWorkflowITS.cxx index fe55b83633972..b1c8d619ec736 100644 --- a/GPU/Workflow/src/GPUWorkflowITS.cxx +++ b/GPU/Workflow/src/GPUWorkflowITS.cxx @@ -13,6 +13,7 @@ /// @author David Rohr, Matteo Concas #include "GPUWorkflow/GPUWorkflowSpec.h" +#include "GPUO2Interface.h" #include "Framework/WorkflowSpec.h" // o2::framework::mergeInputs #include "Framework/ControlService.h" #include "Framework/ConfigParamRegistry.h"