Skip to content

Commit 15df642

Browse files
committed
GPU: Switch to C++11 nested namespace style in more places
1 parent ac0408b commit 15df642

File tree

6 files changed

+16
-48
lines changed

6 files changed

+16
-48
lines changed

GPU/Common/GPUCommonAlgorithm.h

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424

2525
// ----------------------------- SORTING -----------------------------
2626

27-
namespace o2
28-
{
29-
namespace gpu
27+
namespace o2::gpu
3028
{
3129
class GPUCommonAlgorithm
3230
{
@@ -75,13 +73,6 @@ class GPUCommonAlgorithm
7573
template <typename I>
7674
GPUd() static void IterSwap(I a, I b) noexcept;
7775
};
78-
} // namespace gpu
79-
} // namespace o2
80-
81-
namespace o2
82-
{
83-
namespace gpu
84-
{
8576

8677
#ifndef GPUCA_ALGORITHM_STD
8778
template <typename I>
@@ -221,18 +212,15 @@ GPUdi() void GPUCommonAlgorithm::QuickSort(I f, I l) noexcept
221212

222213
typedef GPUCommonAlgorithm CAAlgo;
223214

224-
} // namespace gpu
225-
} // namespace o2
215+
} // namespace o2::gpu
226216

227217
#if (((defined(__CUDACC__) && !defined(__clang__)) || defined(__HIPCC__))) && !defined(GPUCA_GPUCODE_GENRTC) && !defined(GPUCA_GPUCODE_HOSTONLY)
228218

229219
#include "GPUCommonAlgorithmThrust.h"
230220

231221
#else
232222

233-
namespace o2
234-
{
235-
namespace gpu
223+
namespace o2::gpu
236224
{
237225

238226
template <class T>
@@ -251,15 +239,12 @@ GPUdi() void GPUCommonAlgorithm::sortDeviceDynamic(T* begin, T* end, const S& co
251239
GPUCommonAlgorithm::sort(begin, end, comp);
252240
}
253241

254-
} // namespace gpu
255-
} // namespace o2
242+
} // namespace o2::gpu
256243

257244
#endif // THRUST
258245
// sort and sortInBlock below are not taken from Thrust, since our implementations are faster
259246

260-
namespace o2
261-
{
262-
namespace gpu
247+
namespace o2::gpu
263248
{
264249

265250
template <class T>
@@ -332,8 +317,7 @@ GPUdi() void GPUCommonAlgorithm::swap(T& a, T& b)
332317
}
333318
#endif
334319

335-
} // namespace gpu
336-
} // namespace o2
320+
} // namespace o2::gpu
337321

338322
// ----------------------------- WORK GROUP FUNCTIONS -----------------------------
339323

GPU/Common/GPUCommonAlgorithmThrust.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
#define GPUCA_THRUST_NAMESPACE thrust::hip
3131
#endif
3232

33-
namespace o2
34-
{
35-
namespace gpu
33+
namespace o2::gpu
3634
{
3735

3836
// - Our quicksort and bubble sort implementations are faster
@@ -94,8 +92,6 @@ GPUhi() void GPUCommonAlgorithm::sortOnDevice(auto* rec, int32_t stream, T* begi
9492
auto alloc = rec->getThrustVolatileDeviceAllocator();
9593
thrust::sort(GPUCA_THRUST_NAMESPACE::par(alloc).on(rec->mInternals->Streams[stream]), p, p + N, comp);
9694
}
97-
98-
} // namespace gpu
99-
} // namespace o2
95+
} // namespace o2::gpu
10096

10197
#endif

GPU/Common/GPUCommonMath.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
#define GPUCA_CHOICE(c1, c2, c3) (c1) // Select first option for Host
4343
#endif // clang-format on
4444

45-
namespace o2
46-
{
47-
namespace gpu
45+
namespace o2::gpu
4846
{
4947

5048
class GPUCommonMath
@@ -540,7 +538,6 @@ GPUdii() void GPUCommonMath::AtomicMinInternal(GPUglobalref() GPUgeneric() GPUAt
540538

541539
#undef GPUCA_CHOICE
542540

543-
} // namespace gpu
544-
} // namespace o2
541+
} // namespace o2::gpu
545542

546543
#endif // GPUCOMMONMATH_H

GPU/Common/GPUCommonTransform3D.h

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

1818
#include "GPUCommonDef.h"
1919

20-
namespace o2
21-
{
22-
namespace gpu
20+
namespace o2::gpu
2321
{
2422
class Transform3D
2523
{
@@ -79,7 +77,6 @@ class Transform3D
7977
kZZ = 10,
8078
kDZ = 11 };
8179
};
82-
} // namespace gpu
83-
} // namespace o2
80+
} // namespace o2::gpu
8481

8582
#endif

GPU/Common/GPUROOTCartesianFwd.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ class DefaultCoordinateSystemTag;
4646
} // namespace Math
4747
} // namespace ROOT
4848

49-
namespace o2
50-
{
51-
namespace math_utils
49+
namespace o2::math_utils
5250
{
5351

5452
namespace detail
@@ -79,7 +77,6 @@ template <typename T>
7977
using Vector3D = detail::GPUPoint3D<T, 1>;
8078
#endif
8179

82-
} // namespace math_utils
83-
} // namespace o2
80+
} // namespace o2::math_utils
8481

8582
#endif

GPU/Common/GPUROOTSMatrixFwd.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ class MatRepStd;
3535
} // namespace Math
3636
} // namespace ROOT
3737

38-
namespace o2
39-
{
40-
namespace math_utils
38+
namespace o2::math_utils
4139
{
4240

4341
namespace detail
@@ -72,7 +70,6 @@ template <class T, uint32_t D1, uint32_t D2 = D1>
7270
using MatRepStd = detail::MatRepStdGPU<T, D1, D2>;
7371
#endif
7472

75-
} // namespace math_utils
76-
} // namespace o2
73+
} // namespace o2::math_utils
7774

7875
#endif

0 commit comments

Comments
 (0)