From e90199e1f42e5bcf006d809a4469fe67c28961d1 Mon Sep 17 00:00:00 2001 From: David Rohr Date: Mon, 11 Nov 2024 14:11:45 +0100 Subject: [PATCH 1/4] Add empty streaming operator, so that std::cout << SMatrixGPU() does not fail --- Common/MathUtils/include/MathUtils/SMatrixGPU.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Common/MathUtils/include/MathUtils/SMatrixGPU.h b/Common/MathUtils/include/MathUtils/SMatrixGPU.h index 60965a4fa2776..425c708e8bf6f 100644 --- a/Common/MathUtils/include/MathUtils/SMatrixGPU.h +++ b/Common/MathUtils/include/MathUtils/SMatrixGPU.h @@ -468,6 +468,9 @@ class SMatrixGPU GPUd() const T& operator()(unsigned int i, unsigned int j) const; GPUd() T& operator()(unsigned int i, unsigned int j); + template + friend X& operator<<(X& x, const SMatrixGPU&) { return x; } + class SMatrixRowGPU { public: @@ -512,6 +515,12 @@ class SMatrixGPU R mRep; }; +template +X& operator<<(X& x, const SMatrixGPU&) +{ + return x; +} + template GPUdi() SMatrixGPU::SMatrixGPU(SMatrixIdentity) { From c1c0a78585bb6b9a20178485345295b4f9352322 Mon Sep 17 00:00:00 2001 From: David Rohr Date: Mon, 11 Nov 2024 14:12:16 +0100 Subject: [PATCH 2/4] GPU: Some protection so we get a compiler warning when headers are included in wrong order --- GPU/Common/GPUCommonRtypes.h | 3 +-- GPU/Common/GPUROOTSMatrixFwd.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/GPU/Common/GPUCommonRtypes.h b/GPU/Common/GPUCommonRtypes.h index 5ae2ddbb83b26..fd7a360bba0d4 100644 --- a/GPU/Common/GPUCommonRtypes.h +++ b/GPU/Common/GPUCommonRtypes.h @@ -20,14 +20,13 @@ #if defined(GPUCA_STANDALONE) || (defined(GPUCA_O2_LIB) && !defined(GPUCA_O2_INTERFACE)) || defined(GPUCA_GPUCODE) // clang-format off #if !defined(ROOT_Rtypes) && !defined(__CLING__) #define GPUCOMMONRTYPES_H_ACTIVE + #define ROOT_Rtypes GPUCommonRtypes_ALREADY_INCLUDED // If you want to use GPUCommonRtypes.h and Rtypes.h in the same file, make sure Rtypes.h is included first! #define ClassDef(name,id) #define ClassDefNV(name, id) #define ClassDefOverride(name, id) #define ClassImp(name) #define templateClassImp(name) #ifndef GPUCA_GPUCODE_DEVICE -// typedef uint64_t ULong64_t; -// typedef uint32_t UInt_t; #include #endif #endif diff --git a/GPU/Common/GPUROOTSMatrixFwd.h b/GPU/Common/GPUROOTSMatrixFwd.h index a3b5abc55d3bc..44b2254949df2 100644 --- a/GPU/Common/GPUROOTSMatrixFwd.h +++ b/GPU/Common/GPUROOTSMatrixFwd.h @@ -52,7 +52,7 @@ template class MatRepStdGPU; } // namespace detail -#if !defined(GPUCA_STANDALONE) && !defined(GPUCA_GPUCODE) +#if !defined(GPUCA_STANDALONE) && !defined(GPUCA_GPUCODE) && !defined(GPUCOMMONRTYPES_H_ACTIVE) template using SVector = ROOT::Math::SVector; template From 21925aa8f37e01f5567b645f881e84234ca29eeb Mon Sep 17 00:00:00 2001 From: David Rohr Date: Mon, 11 Nov 2024 14:12:30 +0100 Subject: [PATCH 3/4] GPU: Fix include order --- GPU/GPUTracking/Refit/GPUTrackingRefitKernel.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.cxx b/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.cxx index 6baea86f05d36..f7e3bca47a0fc 100644 --- a/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.cxx +++ b/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.cxx @@ -12,9 +12,9 @@ /// \file GPUTrackingRefitKernel.cxx /// \author David Rohr +#include "GPUROOTDump.h" #include "GPUTrackingRefitKernel.h" #include "GPUTrackingRefit.h" -#include "GPUROOTDump.h" using namespace GPUCA_NAMESPACE::gpu; From c0182914913230b928c8a024eb439bebb56f0179 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 11 Nov 2024 13:15:18 +0000 Subject: [PATCH 4/4] Please consider the following formatting changes --- Common/MathUtils/include/MathUtils/SMatrixGPU.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Common/MathUtils/include/MathUtils/SMatrixGPU.h b/Common/MathUtils/include/MathUtils/SMatrixGPU.h index 425c708e8bf6f..6557c92643d44 100644 --- a/Common/MathUtils/include/MathUtils/SMatrixGPU.h +++ b/Common/MathUtils/include/MathUtils/SMatrixGPU.h @@ -469,7 +469,10 @@ class SMatrixGPU GPUd() T& operator()(unsigned int i, unsigned int j); template - friend X& operator<<(X& x, const SMatrixGPU&) { return x; } + friend X& operator<<(X& x, const SMatrixGPU&) + { + return x; + } class SMatrixRowGPU {