diff --git a/Common/MathUtils/include/MathUtils/Cartesian.h b/Common/MathUtils/include/MathUtils/Cartesian.h index 9b917707835a6..5702656b86e9f 100644 --- a/Common/MathUtils/include/MathUtils/Cartesian.h +++ b/Common/MathUtils/include/MathUtils/Cartesian.h @@ -285,24 +285,6 @@ GPUdi() SMatrix> Similarity(const SMatrix> fails because the class -/// implements a copy constructor, although it does not much more than the default copy -/// constructor. We need Point3D to fulfill the condition in order to make types -/// inheriting from it or using it as member can be safely detected as messageable. -/// -/// We believe that Point3D is messageable and explicitly specialize the type trait. -/// There is a unit test for checking trivial copy -/// This is a workaround, we will also make suggestions to fix the cause in ROOT itself -/// TODO: delete once it is fixed in ROOT -template -struct is_trivially_copyable> : std::true_type { -}; -} // namespace std #endif // Disable for GPU #endif diff --git a/Common/MathUtils/include/MathUtils/CartesianGPU.h b/Common/MathUtils/include/MathUtils/CartesianGPU.h index 905f2f660f9c0..3a7f48271594f 100644 --- a/Common/MathUtils/include/MathUtils/CartesianGPU.h +++ b/Common/MathUtils/include/MathUtils/CartesianGPU.h @@ -16,6 +16,7 @@ #define ALICEO2_CARTESIANGPU_H #include "GPUCommonDef.h" +#include "GPUCommonTypeTraits.h" namespace o2::math_utils { @@ -43,6 +44,9 @@ struct GPUPoint3D : public GPUPoint2D { GPUd() float R() const { return o2::gpu::CAMath::Sqrt(GPUPoint2D::xx * GPUPoint2D::xx + GPUPoint2D::yy * GPUPoint2D::yy + zz * zz); } GPUd() void SetZ(float v) { zz = v; } T zz; +#if (!defined(GPUCA_GPUCODE_DEVICE) || defined(__CUDACC__) || defined(__HIPCC__)) && !defined(GPUCA_GPUCODE_COMPILEKERNELS) + static_assert(std::is_trivially_copyable_v); +#endif }; } // namespace detail