Skip to content

Commit ff46de9

Browse files
authored
[ITS vertexer] Fix compilation with ITS debug (#5383)
* [ITS vertexer] Fix compilation with ITS debug * Fix HIP version
1 parent 368937d commit ff46de9

File tree

11 files changed

+27
-27
lines changed

11 files changed

+27
-27
lines changed

DataFormats/common/include/CommonDataFormat/RangeReference.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,18 @@ class RangeRefComp
7575
GPUd() RangeRefComp(int ent, int n) { set(ent, n); }
7676
GPUdDefault() RangeRefComp() = default;
7777
GPUdDefault() RangeRefComp(const RangeRefComp& src) = default;
78-
GPUd() void set(int ent, int n)
78+
GPUhd() void set(int ent, int n)
7979
{
8080
mData = (Base(ent) << NBitsN) + (Base(n) & MaskN);
8181
}
8282
GPUd() static constexpr Base getMaxFirstEntry() { return MaskR >> NBitsN; }
8383
GPUd() static constexpr Base getMaxEntries() { return MaskN; }
84-
GPUd() int getFirstEntry() const { return mData >> NBitsN; }
85-
GPUd() int getEntries() const { return mData & ((0x1 << NBitsN) - 1); }
86-
GPUd() void setFirstEntry(int ent) { mData = (Base(ent) << NBitsN) | (mData & MaskN); }
87-
GPUd() void setEntries(int n) { mData = (mData & MaskR) | (Base(n) & MaskN); }
88-
GPUd() void changeEntriesBy(int inc) { setEntries(getEntries() + inc); }
89-
GPUd() bool operator==(const RangeRefComp& other) const
84+
GPUhd() int getFirstEntry() const { return mData >> NBitsN; }
85+
GPUhd() int getEntries() const { return mData & ((0x1 << NBitsN) - 1); }
86+
GPUhd() void setFirstEntry(int ent) { mData = (Base(ent) << NBitsN) | (mData & MaskN); }
87+
GPUhd() void setEntries(int n) { mData = (mData & MaskR) | (Base(n) & MaskN); }
88+
GPUhd() void changeEntriesBy(int inc) { setEntries(getEntries() + inc); }
89+
GPUhd() bool operator==(const RangeRefComp& other) const
9090
{
9191
return mData == other.mData;
9292
}

Detectors/ITSMFT/ITS/tracking/cuda/include/ITStrackingCUDA/DeviceStoreVertexerGPU.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ inline std::array<std::vector<int>, 2> DeviceStoreVertexerGPU::getHistogramXYFro
226226
{
227227
std::array<std::vector<int>, 2> histoXY;
228228
for (int iHisto{0}; iHisto < 2; ++iHisto) {
229-
histoXY[iHisto].resize(mGPUConf.nBinsXYZ[iHisto] - 1);
229+
histoXY[iHisto].resize(mGPUConf.histConf.nBinsXYZ[iHisto] - 1);
230230
mHistogramXYZ[iHisto].copyIntoSizedVector(histoXY[iHisto]);
231231
}
232232

@@ -236,7 +236,7 @@ inline std::array<std::vector<int>, 2> DeviceStoreVertexerGPU::getHistogramXYFro
236236
inline std::vector<int> DeviceStoreVertexerGPU::getHistogramZFromGPU()
237237
{
238238
std::vector<int> histoZ;
239-
histoZ.resize(mGPUConf.nBinsXYZ[2] - 1);
239+
histoZ.resize(mGPUConf.histConf.nBinsXYZ[2] - 1);
240240
mHistogramXYZ[2].copyIntoSizedVector(histoZ);
241241

242242
return histoZ;

Detectors/ITSMFT/ITS/tracking/cuda/src/VertexerTraitsGPU.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ VertexerTraitsGPU::VertexerTraitsGPU()
9191
setIsGPU(true);
9292
}
9393

94+
VertexerTraitsGPU::~VertexerTraitsGPU() = default;
9495
#endif
9596

96-
VertexerTraitsGPU::~VertexerTraitsGPU() = default;
9797

9898
void VertexerTraitsGPU::initialise(ROframe* event)
9999
{

Detectors/ITSMFT/ITS/tracking/hip/include/ITStrackingHIP/DeviceStoreVertexerHIP.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ inline std::array<std::vector<int>, 2> DeviceStoreVertexerHIP::getHistogramXYFro
223223
{
224224
std::array<std::vector<int>, 2> histoXY;
225225
for (int iHisto{0}; iHisto < 2; ++iHisto) {
226-
histoXY[iHisto].resize(mGPUConf.nBinsXYZ[iHisto] - 1);
226+
histoXY[iHisto].resize(mGPUConf.histConf.nBinsXYZ[iHisto] - 1);
227227
mHistogramXYZ[iHisto].copyIntoSizedVector(histoXY[iHisto]);
228228
}
229229

@@ -233,7 +233,7 @@ inline std::array<std::vector<int>, 2> DeviceStoreVertexerHIP::getHistogramXYFro
233233
inline std::vector<int> DeviceStoreVertexerHIP::getHistogramZFromGPU()
234234
{
235235
std::vector<int> histoZ;
236-
histoZ.resize(mGPUConf.nBinsXYZ[2] - 1);
236+
histoZ.resize(mGPUConf.histConf.nBinsXYZ[2] - 1);
237237
std::cout << "Size of dest vector to be refined" << std::endl;
238238
mHistogramXYZ[2].copyIntoSizedVector(histoZ);
239239

Detectors/ITSMFT/ITS/tracking/hip/src/VertexerTraitsHIP.hip.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ VertexerTraitsHIP::~VertexerTraitsHIP()
8787
delete mDebugger;
8888
}
8989
#else
90+
9091
VertexerTraitsHIP::VertexerTraitsHIP()
9192
{
9293
setIsGPU(true);
9394
}
94-
9595
#endif
9696

9797
void VertexerTraitsHIP::initialise(ROframe* event)

Detectors/ITSMFT/ITS/tracking/include/ITStracking/ClusterLines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct Line final {
3535
GPUhd() Line(const Tracklet&, const Cluster*, const Cluster*);
3636

3737
#ifdef _ALLOW_DEBUG_TREES_ITS_
38-
Line(const Tracklet& tracklet, const Cluster* innerClusters, const Cluster* outerClusters, const int evId);
38+
GPUhd() Line(const Tracklet& tracklet, const Cluster* innerClusters, const Cluster* outerClusters, const int evId);
3939
#endif
4040

4141
inline static float getDistanceFromPoint(const Line& line, const std::array<float, 3>& point);

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Definitions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <array>
2222
#endif
2323

24-
//#define CA_DEBUG
24+
// #define CA_DEBUG
2525

2626
#ifdef CA_DEBUG
2727
#define CA_DEBUGGER(x) x

Detectors/ITSMFT/ITS/tracking/include/ITStracking/StandaloneDebugger.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
#include <iterator>
2020

2121
// Tracker
22+
#if !defined(__CUDACC__) && !defined(__HIPCC__)
23+
#include "ITStracking/ROframe.h"
24+
#endif
25+
2226
#include "DataFormatsITS/TrackITS.h"
2327
#include "ITStracking/PrimaryVertexContext.h"
24-
#include "ITStracking/ROframe.h"
2528

2629
namespace o2
2730
{
@@ -40,6 +43,7 @@ class ClusterLines;
4043

4144
using constants::its::UnusedIndex;
4245

46+
#if !defined(__CUDACC__) && !defined(__HIPCC__)
4347
template <int numClusters = TrackITSExt::MaxClusters>
4448
struct FakeTrackInfo {
4549
public:
@@ -123,6 +127,7 @@ struct FakeTrackInfo {
123127
int nFakeClusters = 0;
124128
ClassDefNV(FakeTrackInfo, 1);
125129
}; // namespace its
130+
#endif
126131

127132
class StandaloneDebugger
128133
{

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Tracklet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct Tracklet final {
3131
#ifdef _ALLOW_DEBUG_TREES_ITS_
3232
unsigned char isEmpty() const;
3333
void dump();
34-
unsigned char operator<(const Tracklet&);
34+
unsigned char operator<(const Tracklet&) const;
3535
#endif
3636

3737
int firstClusterIndex;
@@ -63,7 +63,7 @@ inline unsigned char Tracklet::isEmpty() const
6363
return !firstClusterIndex && !secondClusterIndex && !tanLambda && !phiCoordinate;
6464
}
6565

66-
inline unsigned char Tracklet::operator<(const Tracklet& t)
66+
inline unsigned char Tracklet::operator<(const Tracklet& t) const
6767
{
6868
if (isEmpty() && t.isEmpty()) {
6969
return false;

Detectors/ITSMFT/ITS/tracking/include/ITStracking/VertexerTraits.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
#include "ITStracking/ClusterLines.h"
2525
#include "ITStracking/Definitions.h"
2626
#include "ITStracking/IndexTableUtils.h"
27-
#ifdef _ALLOW_DEBUG_TREES_ITS_
28-
#include "ITStracking/StandaloneDebugger.h"
29-
#endif
3027
#include "ITStracking/Tracklet.h"
3128

3229
#include "GPUCommonMath.h"
@@ -43,7 +40,7 @@ class TreeStreamRedirector;
4340

4441
namespace its
4542
{
46-
43+
class StandaloneDebugger;
4744
class ROframe;
4845

4946
using constants::its::LayersNumberVertexer;

0 commit comments

Comments
 (0)