Skip to content

Commit 7da60f5

Browse files
committed
Try out std::simd backend of VecCore
1 parent 7b3e8dd commit 7da60f5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

math/mathcore/inc/Math/Types.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@
2424
#pragma GCC diagnostic pop
2525
#endif
2626

27+
#define VECCORE_ENABLE_STD_SIMD
2728
#include <VecCore/VecCore>
29+
#undef VECCORE_ENABLE_STD_SIMD
2830

2931
namespace ROOT {
3032

3133
namespace Internal {
3234
using ScalarBackend = vecCore::backend::Scalar;
33-
#ifdef VECCORE_ENABLE_VC
34-
using VectorBackend = vecCore::backend::VcVector;
35-
#else
36-
using VectorBackend = vecCore::backend::Scalar;
37-
#endif
35+
using VectorBackend = vecCore::backend::SIMDNative;
3836
}
3937
using Float_v = typename Internal::VectorBackend::Float_v;
4038
using Double_v = typename Internal::VectorBackend::Double_v;

math/mathcore/inc/Math/Util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class TimingScope {
7979
inline T EvalLog(T x) {
8080
static const T epsilon = T(2.0 * std::numeric_limits<double>::min());
8181
#ifdef R__HAS_VECCORE
82-
T logval = vecCore::Blend<T>(x <= epsilon, x / epsilon + std::log(epsilon) - T(1.0), std::log(x));
82+
T logval = vecCore::Blend<T>(x <= epsilon, x / epsilon + vecCore::math::Log(epsilon) - T(1.0), vecCore::math::Log(x));
8383
#else
8484
T logval = x <= epsilon ? x / epsilon + std::log(epsilon) - T(1.0) : std::log(x);
8585
#endif

0 commit comments

Comments
 (0)