Commit 4b68c2b4 authored by Jonas Hahnfeld's avatar Jonas Hahnfeld
Browse files

Use VECGEOM_CONST for constants of kTolerance

On CUDA, this macro expands to "static __constant__ const" and Clang
(correctly) complains if kTolerance is used to compute the value of
a constexpr.
parent 48e81629
......@@ -56,7 +56,6 @@ template <template <typename, typename> class ImplementationType, typename T, ty
struct Tiny<ImplementationType<T, Q>> {
static constexpr typename ImplementationType<T, Q>::value_type kValue = 1.e-30;
};
#undef VECGEOM_CONST
} // namespace VECGEOM_IMPL_NAMESPACE
} // namespace vecgeom
......
......@@ -135,8 +135,8 @@ public:
vecCore::Mask_v<Real_v> &completelyoutside, vecCore::Mask_v<Real_v> &onsurf) const
{
using Bool_v = vecCore::Mask_v<Real_v>;
constexpr Precision tolerancesq = 10000. * kTolerance * kTolerance;
using Bool_v = vecCore::Mask_v<Real_v>;
VECGEOM_CONST Precision tolerancesq = 10000. * kTolerance * kTolerance;
onsurf = Bool_v(false);
completelyinside = (Abs(point.z()) < Real_v(MakeMinusTolerant<true>(fDz)));
......@@ -417,8 +417,8 @@ public:
Real_v SafetyToOut(Vector3D<Real_v> const &point, Real_v const &safmax) const
{
using Bool_v = vecCore::Mask_v<Real_v>;
constexpr Precision eps = 100. * kTolerance;
using Bool_v = vecCore::Mask_v<Real_v>;
VECGEOM_CONST Precision eps = 100. * kTolerance;
Real_v safety = safmax;
Bool_v done = (Abs(safety) < eps);
......@@ -464,8 +464,8 @@ public:
Real_v SafetyToIn(Vector3D<Real_v> const &point, Real_v const &safmax) const
{
using Bool_v = vecCore::Mask_v<Real_v>;
constexpr Precision eps = 100. * kTolerance;
using Bool_v = vecCore::Mask_v<Real_v>;
VECGEOM_CONST Precision eps = 100. * kTolerance;
Real_v safety = safmax;
Bool_v done = (Abs(safety) < eps);
......
......@@ -249,8 +249,8 @@ void GenTrapImplementation::GenericKernelForContainsAndInside(UnplacedStruct_t c
vecCore::Mask_v<Real_v> &completelyoutside)
{
using Bool_v = vecCore::Mask_v<Real_v>;
constexpr Precision tolerancesq = 10000. * kTolerance * kTolerance;
using Bool_v = vecCore::Mask_v<Real_v>;
VECGEOM_CONST Precision tolerancesq = 10000. * kTolerance * kTolerance;
// Local point has to be translated in the bbox local frame.
Vector3D<Real_v> halfsize(unplaced.fBBdimensions[0], unplaced.fBBdimensions[1], unplaced.fBBdimensions[2]);
BoxImplementation::GenericKernelForContainsAndInside<Real_v, ForInside>(halfsize, point - unplaced.fBBorigin,
......
......@@ -339,8 +339,8 @@ struct TorusImplementation2 {
// check if second call to Abs is compiled away
// and it can anyway not be vectorized
/* rmax */
using Bool_v = vecCore::Mask_v<Real_v>;
constexpr Precision tol = 100. * vecgeom::kTolerance;
using Bool_v = vecCore::Mask_v<Real_v>;
VECGEOM_CONST Precision tol = 100. * vecgeom::kTolerance;
Real_v rxy = Sqrt(point[0] * point[0] + point[1] * point[1]);
Real_v radsq = (rxy - torus.rtor()) * (rxy - torus.rtor()) + point[2] * point[2];
......@@ -396,8 +396,8 @@ struct TorusImplementation2 {
// to the torus is decreasing while moving along the given direction.
// Compute coeficients of the quartic
Real_v s = vecgeom::kInfLength;
constexpr Real_v tol = 100. * vecgeom::kTolerance;
Real_v s = vecgeom::kInfLength;
VECGEOM_CONST Real_v tol = 100. * vecgeom::kTolerance;
Real_v r0sq = pt[0] * pt[0] + pt[1] * pt[1] + pt[2] * pt[2];
Real_v rdotn = pt[0] * dir[0] + pt[1] * dir[1] + pt[2] * dir[2];
Real_v rsumsq = torus.rtor2() + radius * radius;
......
......@@ -407,7 +407,7 @@ struct TrapezoidImplementation {
typename vecCore::Mask_v<Real_v> &valid)
{
constexpr Precision delta = 1000. * kTolerance;
VECGEOM_CONST Precision delta = 1000. * kTolerance;
Vector3D<Real_v> normal(0.);
Real_v safety = -InfinityLength<Real_v>();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment