From 150d63890de83163140175bb2b1aafdf2d46d6e7 Mon Sep 17 00:00:00 2001 From: David Rohr Date: Mon, 17 Nov 2025 00:02:23 +0100 Subject: [PATCH 1/2] 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 + 21 files changed, 54 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..ed276465dfede 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 "GPUO2ExternalUsage.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..b8912630f489a 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 From 5f818596db7788f6098902c6274fba423f77c631 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 17 Nov 2025 00:33:37 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- GPU/GPUTracking/Interface/GPUO2InterfaceConfigurableParam.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/GPUTracking/Interface/GPUO2InterfaceConfigurableParam.h b/GPU/GPUTracking/Interface/GPUO2InterfaceConfigurableParam.h index b8912630f489a..676d2c22f57c7 100644 --- a/GPU/GPUTracking/Interface/GPUO2InterfaceConfigurableParam.h +++ b/GPU/GPUTracking/Interface/GPUO2InterfaceConfigurableParam.h @@ -23,7 +23,7 @@ #define GPUO2INTERFACECONFIGURABLEPARAM_H #if !defined(GPUCA_STANDALONE) && !defined(GPUCA_O2_LIB) - #include "GPUO2ExternalUser.h" +#include "GPUO2ExternalUser.h" #endif #include "CommonUtils/ConfigurableParam.h"