Skip to content

Commit 9ed26e3

Browse files
committed
[Math] Completely remove VecCore dependency
1 parent 903955c commit 9ed26e3

File tree

3 files changed

+17
-22
lines changed

3 files changed

+17
-22
lines changed

hist/hist/src/TFormula.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ std::string doubleToString(double val)
5656
// the native SIMD width used in compiled ROOT.
5757
std::string vectorizedArgType()
5858
{
59-
#ifdef ROOT_VECTORIZED_TMATH
59+
#ifdef R__HAS_VECCORE
6060
auto n = ROOT::Double_v::size();
6161
return "std::experimental::resize_simd_t<" + std::to_string(n) + ", ROOT::Double_v>";
6262
#else

math/mathcore/inc/Math/Types.h

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include "RConfigure.h"
55

6+
#include "RtypesCore.h"
7+
68
#ifdef R__HAS_VECCORE
79

810
// We always try to use std::simd as the VecCore backend.
@@ -17,37 +19,30 @@
1719

1820
#define ROOT_VECTORIZED_TMATH
1921

20-
#define VECCORE_ENABLE_STD_SIMD
21-
#include <VecCore/VecCore>
22-
#undef VECCORE_ENABLE_STD_SIMD
22+
#include <experimental/simd>
2323

2424
namespace ROOT {
2525

2626
namespace Internal {
2727

28-
using ScalarBackend = vecCore::backend::Scalar;
29-
#ifdef ROOT_VECTORIZED_TMATH
30-
using VectorBackend = vecCore::backend::SIMDNative;
31-
#else
32-
using VectorBackend = vecCore::backend::Scalar;
33-
#endif
28+
template <typename T>
29+
using SIMDTag = std::experimental::simd_abi::native<T>;
3430

3531
} // namespace Internal
3632

37-
using Float_v = typename Internal::VectorBackend::Float_v;
38-
using Double_v = typename Internal::VectorBackend::Double_v;
39-
using Int_v = typename Internal::VectorBackend::Int_v;
40-
using Int32_v = typename Internal::VectorBackend::Int32_v;
41-
using UInt_v = typename Internal::VectorBackend::UInt_v;
42-
using UInt32_v = typename Internal::VectorBackend::UInt32_v;
43-
}
33+
using Float_v = std::experimental::simd<Float_t, Internal::SIMDTag<Float_t>>;
34+
using Double_v = std::experimental::simd<Double_t, Internal::SIMDTag<Double_t>>;
35+
using Int_v = std::experimental::simd<Int_t, Internal::SIMDTag<Int_t>>;
36+
using Int32_v = std::experimental::simd<Int_t, Internal::SIMDTag<Int_t>>;
37+
using UInt_v = std::experimental::simd<UInt_t, Internal::SIMDTag<UInt_t>>;
38+
using UInt32_v = std::experimental::simd<UInt_t, Internal::SIMDTag<UInt_t>>;
39+
40+
} // namespace ROOT
4441

4542
#else // R__HAS_VECCORE
4643

4744
// We do not have explicit vectorisation support enabled. Fall back to regular ROOT types.
4845

49-
#include "RtypesCore.h"
50-
5146
namespace ROOT {
5247
using Float_v = Float_t;
5348
using Double_v = Double_t;

math/mathcore/test/testVectorizedTMath.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class VectorizedTMathTest : public ::testing::Test {
3131
VectorizedTMathTest() {}
3232

3333
size_t kVS = ROOT::Double_v::size();
34-
Double_t input_array1[N] __attribute__((aligned(VECCORE_SIMD_ALIGN)));
35-
Double_t input_array2[N] __attribute__((aligned(VECCORE_SIMD_ALIGN)));
34+
Double_t input_array1[N];
35+
Double_t input_array2[N];
3636

37-
Double_t output_array[N] __attribute__((aligned(VECCORE_SIMD_ALIGN)));
37+
Double_t output_array[N];
3838
};
3939

4040
#define TEST_VECTORIZED_TMATH_FUNCTION(tmathfunc, a, b) \

0 commit comments

Comments
 (0)