Skip to content

Commit 40b66ce

Browse files
committed
Drop unneeded workaround
This apparently is fixed with the new ROOT and it actually breaks with the latest system clang on macOS.
1 parent 389aaf1 commit 40b66ce

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

Common/MathUtils/include/MathUtils/Cartesian.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -285,24 +285,6 @@ GPUdi() SMatrix<T, D1, D1, MatRepSym<T, D1>> Similarity(const SMatrix<T, D1, D2,
285285
std::ostream& operator<<(std::ostream& os, const o2::math_utils::Rotation2Df_t& t);
286286
std::ostream& operator<<(std::ostream& os, const o2::math_utils::Rotation2Dd_t& t);
287287

288-
namespace std
289-
{
290-
291-
/// Defining Point3D explicitly as trivially copyable
292-
///
293-
/// std::is_trivially_copyable<ROOT::Math::Cartesian3D<T>> fails because the class
294-
/// implements a copy constructor, although it does not much more than the default copy
295-
/// constructor. We need Point3D to fulfill the condition in order to make types
296-
/// inheriting from it or using it as member can be safely detected as messageable.
297-
///
298-
/// We believe that Point3D is messageable and explicitly specialize the type trait.
299-
/// There is a unit test for checking trivial copy
300-
/// This is a workaround, we will also make suggestions to fix the cause in ROOT itself
301-
/// TODO: delete once it is fixed in ROOT
302-
template <typename T>
303-
struct is_trivially_copyable<o2::math_utils::Point3D<T>> : std::true_type {
304-
};
305-
} // namespace std
306288
#endif // Disable for GPU
307289

308290
#endif

Common/MathUtils/include/MathUtils/CartesianGPU.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define ALICEO2_CARTESIANGPU_H
1717

1818
#include "GPUCommonDef.h"
19+
#include "GPUCommonTypeTraits.h"
1920

2021
namespace o2::math_utils
2122
{
@@ -43,6 +44,9 @@ struct GPUPoint3D : public GPUPoint2D<T, I> {
4344
GPUd() float R() const { return o2::gpu::CAMath::Sqrt(GPUPoint2D<T, I>::xx * GPUPoint2D<T, I>::xx + GPUPoint2D<T, I>::yy * GPUPoint2D<T, I>::yy + zz * zz); }
4445
GPUd() void SetZ(float v) { zz = v; }
4546
T zz;
47+
#if (!defined(GPUCA_GPUCODE_DEVICE) || defined(__CUDACC__) || defined(__HIPCC__)) && !defined(GPUCA_GPUCODE_COMPILEKERNELS)
48+
static_assert(std::is_trivially_copyable_v<GPUPoint3D>);
49+
#endif
4650
};
4751
} // namespace detail
4852

0 commit comments

Comments
 (0)