Skip to content

Commit 67e9d9a

Browse files
committed
GPU: Use modern C++17 nested namespace definition where possible (not compiled by CUDA/OpenCL/AliRoot/ROOT5)
1 parent 1b85f97 commit 67e9d9a

11 files changed

Lines changed: 26 additions & 65 deletions

GPU/GPUTracking/Base/hip/GPUReconstructionHIP.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ extern "C" __declspec(dllexport) GPUCA_NAMESPACE::gpu::GPUReconstruction* GPURec
2222
extern "C" GPUCA_NAMESPACE::gpu::GPUReconstruction* GPUReconstruction_Create_HIP(const GPUCA_NAMESPACE::gpu::GPUSettingsProcessing& cfg);
2323
#endif
2424

25-
namespace GPUCA_NAMESPACE
26-
{
27-
namespace gpu
25+
namespace GPUCA_NAMESPACE::gpu
2826
{
2927
struct GPUReconstructionHIPInternals;
3028

@@ -61,7 +59,6 @@ class GPUReconstructionHIPBackend : public GPUReconstructionDeviceBase
6159
};
6260

6361
using GPUReconstructionHIP = GPUReconstructionKernels<GPUReconstructionHIPBackend>;
64-
} // namespace gpu
65-
} // namespace GPUCA_NAMESPACE
62+
} // namespace GPUCA_NAMESPACE::gpu
6663

6764
#endif

GPU/GPUTracking/Base/hip/GPUReconstructionHIPInternals.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
#ifndef GPURECONSTRUCTIONHIPINTERNALS_H
1515
#define GPURECONSTRUCTIONHIPINTERNALS_H
1616

17-
namespace GPUCA_NAMESPACE
18-
{
19-
namespace gpu
17+
namespace GPUCA_NAMESPACE::gpu
2018
{
2119
struct GPUReconstructionHIPInternals {
2220
hipStream_t HIPStreams[GPUCA_MAX_STREAMS]; // Pointer to array of HIP Streams
@@ -43,7 +41,6 @@ static void GPUFailedMsgA(const long long int error, const char* file, int line)
4341
}
4442

4543
static_assert(std::is_convertible<hipEvent_t, void*>::value, "HIP event type incompatible to deviceEvent");
46-
} // namespace gpu
47-
} // namespace GPUCA_NAMESPACE
44+
} // namespace GPUCA_NAMESPACE::gpu
4845

4946
#endif

GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ extern "C" __declspec(dllexport) GPUCA_NAMESPACE::gpu::GPUReconstruction* GPURec
2222
extern "C" GPUCA_NAMESPACE::gpu::GPUReconstruction* GPUReconstruction_Create_OCL(const GPUCA_NAMESPACE::gpu::GPUSettingsProcessing& cfg);
2323
#endif
2424

25-
namespace GPUCA_NAMESPACE
26-
{
27-
namespace gpu
25+
namespace GPUCA_NAMESPACE::gpu
2826
{
2927
struct GPUReconstructionOCLInternals;
3028

@@ -71,7 +69,6 @@ class GPUReconstructionOCLBackend : public GPUReconstructionDeviceBase
7169
};
7270

7371
using GPUReconstructionOCL = GPUReconstructionKernels<GPUReconstructionOCLBackend>;
74-
} // namespace gpu
75-
} // namespace GPUCA_NAMESPACE
72+
} // namespace GPUCA_NAMESPACE::gpu
7673

7774
#endif

GPU/GPUTracking/Base/opencl/GPUReconstructionOCLInternals.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
#include <vector>
2020
#include <string>
2121

22-
namespace GPUCA_NAMESPACE
23-
{
24-
namespace gpu
22+
namespace GPUCA_NAMESPACE::gpu
2523
{
2624
static const char* opencl_error_string(int errorcode)
2725
{
@@ -178,7 +176,6 @@ struct GPUReconstructionOCLInternals {
178176
};
179177

180178
static_assert(std::is_convertible<cl_event, void*>::value, "OpenCL event type incompatible to deviceEvent");
181-
} // namespace gpu
182-
} // namespace GPUCA_NAMESPACE
179+
} // namespace GPUCA_NAMESPACE::gpu
183180

184181
#endif

GPU/GPUTracking/Global/GPUChainITS.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,16 @@
1515
#define GPUCHAINITS_H
1616

1717
#include "GPUChain.h"
18-
namespace o2
19-
{
20-
namespace its
18+
namespace o2::its
2119
{
2220
class Cluster;
2321
class Road;
2422
class Cell;
2523
class TrackingFrameInfo;
2624
class TrackITSExt;
27-
} // namespace its
28-
} // namespace o2
25+
} // namespace o2::its
2926

30-
namespace GPUCA_NAMESPACE
31-
{
32-
namespace gpu
27+
namespace GPUCA_NAMESPACE::gpu
3328
{
3429
class GPUChainITS : public GPUChain
3530
{
@@ -58,7 +53,6 @@ class GPUChainITS : public GPUChain
5853

5954
unsigned int mMaxTracks;
6055
};
61-
} // namespace gpu
62-
} // namespace GPUCA_NAMESPACE
56+
} // namespace GPUCA_NAMESPACE::gpu
6357

6458
#endif

GPU/GPUTracking/Interface/GPUO2Interface.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,13 @@
2828
#include <memory>
2929
#include "GPUCommonDef.h"
3030
#include "GPUDataTypes.h"
31-
namespace o2
32-
{
33-
namespace tpc
31+
namespace o2::tpc
3432
{
3533
struct ClusterNativeAccess;
3634
struct ClusterNative;
37-
} // namespace tpc
38-
} // namespace o2
35+
} // namespace o2::tpc
3936

40-
namespace o2
41-
{
42-
namespace gpu
37+
namespace o2::gpu
4338
{
4439
class GPUReconstruction;
4540
class GPUChainTracking;
@@ -73,7 +68,6 @@ class GPUTPCO2Interface
7368
GPUChainTracking* mChain = nullptr;
7469
std::unique_ptr<GPUO2InterfaceConfiguration> mConfig;
7570
};
76-
} // namespace gpu
77-
} // namespace o2
71+
} // namespace o2::gpu
7872

7973
#endif

GPU/GPUTracking/Standalone/display/GPUDisplayBackendGlfw.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919

2020
struct GLFWwindow;
2121

22-
namespace GPUCA_NAMESPACE
23-
{
24-
namespace gpu
22+
namespace GPUCA_NAMESPACE::gpu
2523
{
2624
class GPUDisplayBackendGlfw : public GPUDisplayBackend
2725
{
@@ -59,7 +57,6 @@ class GPUDisplayBackendGlfw : public GPUDisplayBackend
5957
int mWindowWidth = INIT_WIDTH;
6058
int mWindowHeight = INIT_HEIGHT;
6159
};
62-
} // namespace gpu
63-
} // namespace GPUCA_NAMESPACE
60+
} // namespace GPUCA_NAMESPACE::gpu
6461

6562
#endif

GPU/GPUTracking/Standalone/display/GPUDisplayBackendGlut.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
#include "GPUDisplayBackend.h"
1818
#include <pthread.h>
1919

20-
namespace GPUCA_NAMESPACE
21-
{
22-
namespace gpu
20+
namespace GPUCA_NAMESPACE::gpu
2321
{
2422
class GPUDisplayBackendGlut : public GPUDisplayBackend
2523
{
@@ -57,7 +55,6 @@ class GPUDisplayBackendGlut : public GPUDisplayBackend
5755
int mHeight = INIT_HEIGHT;
5856
bool mFullScreen = false;
5957
};
60-
} // namespace gpu
61-
} // namespace GPUCA_NAMESPACE
58+
} // namespace GPUCA_NAMESPACE::gpu
6259

6360
#endif

GPU/GPUTracking/Standalone/display/GPUDisplayBackendNone.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
#include "GPUDisplayBackend.h"
1818

19-
namespace GPUCA_NAMESPACE
20-
{
21-
namespace gpu
19+
namespace GPUCA_NAMESPACE::gpu
2220
{
2321
class GPUDisplayBackendNone : public GPUDisplayBackend
2422
{
@@ -32,7 +30,6 @@ class GPUDisplayBackendNone : public GPUDisplayBackend
3230
void SetVSync(bool enable) override {}
3331
void OpenGLPrint(const char* s, float x, float y, float r, float g, float b, float a, bool fromBotton = true) override {}
3432
};
35-
} // namespace gpu
36-
} // namespace GPUCA_NAMESPACE
33+
} // namespace GPUCA_NAMESPACE::gpu
3734

3835
#endif

GPU/GPUTracking/Standalone/display/GPUDisplayBackendWindows.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
#include "GPUDisplayBackend.h"
1818

19-
namespace GPUCA_NAMESPACE
20-
{
21-
namespace gpu
19+
namespace GPUCA_NAMESPACE::gpu
2220
{
2321
class GPUDisplayBackendWindows : public GPUDisplayBackend
2422
{
@@ -36,7 +34,6 @@ class GPUDisplayBackendWindows : public GPUDisplayBackend
3634
private:
3735
int OpenGLMain() override;
3836
};
39-
} // namespace gpu
40-
} // namespace GPUCA_NAMESPACE
37+
} // namespace GPUCA_NAMESPACE::gpu
4138

4239
#endif

0 commit comments

Comments
 (0)