Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
Types.h
Go to the documentation of this file.
1#ifndef ROOT_Math_VecTypes
2#define ROOT_Math_VecTypes
3
4#include "RConfigure.h"
5
6#include "RtypesCore.h"
7
8#ifdef R__HAS_STD_EXPERIMENTAL_SIMD
9
10#include <experimental/simd>
11
12namespace ROOT {
13
14namespace Internal {
15
16#if defined(R__EXPERIMENTAL_SIMD_PIN_AVX_ABI) && defined(__AVX512F__)
17// libstdc++'s <experimental/simd> _VecBltnBtmsk (AVX-512 mask) ABI fails to
18// compile with non-GCC front ends (Clang, Intel icpx) due to a static_assert
19// requiring `long long` and `long` to be the same type. When AVX-512 is
20// enabled in this TU we'd otherwise hit that path, so pin to the 256-bit AVX
21// ABI instead. The fallback is guarded by __AVX512F__ so that environments
22// without AVX-512 in scope (notably rootcling/cling, which parses headers
23// without -mavx*) still see the regular `native` ABI and pick the
24// always-supported scalar fallback.
25template <typename T>
26using SIMDTag = std::experimental::simd_abi::__avx;
27#else
28template <typename T>
29using SIMDTag = std::experimental::simd_abi::native<T>;
30#endif
31
32} // namespace Internal
33
34// FIXME: Should we introduce Int32_t and UInt32_t in RtypesCore.h?
35using Float_v = std::experimental::simd<Float_t, Internal::SIMDTag<Float_t>>;
36using Double_v = std::experimental::simd<Double_t, Internal::SIMDTag<Double_t>>;
37using Int_v = std::experimental::simd<Int_t, Internal::SIMDTag<Int_t>>;
38using Int32_v = std::experimental::simd<Int_t, Internal::SIMDTag<Int_t>>;
39using UInt_v = std::experimental::simd<UInt_t, Internal::SIMDTag<UInt_t>>;
40using UInt32_v = std::experimental::simd<UInt_t, Internal::SIMDTag<UInt_t>>;
41
42} // namespace ROOT
43
44#endif
45
46#endif // ROOT_Math_VecTypes
Basic types used by ROOT and required by TInterpreter.