15 #include "../config/tconfig.hpp"
18 #include "simd/auto.hpp"
20 #if defined(__aarch64__) && defined(__ARM_FEATURE_SVE)
21 #include "simd/sve.hpp"
22 #elif defined(__VSX__)
23 #include "simd/vsx.hpp"
24 #elif defined (__bgq__)
25 #include "simd/qpx.hpp"
26 #elif defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86)
27 #include "simd/x86.hpp"
28 #elif !defined(_MSC_VER)
29 #warning Unknown SIMD architecture
31 #pragma message("warning: Unknown SIMD architecture")
41 #if !defined(MFEM_USE_SIMD)
42 #define MFEM_SIMD_BYTES 8
43 #define MFEM_ALIGN_BYTES 32
44 #elif defined(__AVX512F__)
45 #define MFEM_SIMD_BYTES 64
46 #define MFEM_ALIGN_BYTES 64
47 #elif defined(__aarch64__) && defined(__ARM_FEATURE_SVE)
48 #define MFEM_SIMD_BYTES 64
49 #define MFEM_ALIGN_BYTES 64
50 #elif defined(__AVX__) || defined(__VECTOR4DOUBLE__)
51 #define MFEM_SIMD_BYTES 32
52 #define MFEM_ALIGN_BYTES 32
53 #elif defined(__SSE2__) || defined(__VSX__)
54 #define MFEM_SIMD_BYTES 16
55 #define MFEM_ALIGN_BYTES 32
57 #define MFEM_SIMD_BYTES 8
58 #define MFEM_ALIGN_BYTES 32
62 #define MFEM_ROUNDUP(val,base) ((((val)+(base)-1)/(base))*(base))
63 #define MFEM_ALIGN_SIZE(size,type) \
64 MFEM_ROUNDUP(size,(MFEM_ALIGN_BYTES)/sizeof(type))
69 template<
typename complex_t,
typename real_t>
79 static const int simd_size = MFEM_SIMD_BYTES/
sizeof(real_t);
81 typedef AutoSIMD<complex_t, simd_size, MFEM_SIMD_BYTES>
vcomplex_t;
82 typedef AutoSIMD<real_t, simd_size, MFEM_SIMD_BYTES>
vreal_t;
83 typedef AutoSIMD<int, simd_size, simd_size*sizeof(int)>
vint_t;
86 template<
typename complex_t,
typename real_t>
98 typedef AutoSIMD<complex_t, simd_size, align_bytes>
vcomplex_t;
99 typedef AutoSIMD<real_t, simd_size, align_bytes>
vreal_t;
100 typedef AutoSIMD<int, simd_size, simd_size*sizeof(int)>
vint_t;
105 #endif // MFEM_SIMD_HPP
static const int simd_size
AutoSIMD< complex_t, simd_size, align_bytes > vcomplex_t
static const int batch_size
static const int align_bytes
AutoSIMD< real_t, simd_size, align_bytes > vreal_t
static const int batch_size
static const int block_size
AutoSIMD< int, simd_size, simd_size *sizeof(int)> vint_t
AutoSIMD< int, simd_size, simd_size *sizeof(int)> vint_t
static const int block_size
static const int simd_size
AutoSIMD< real_t, simd_size, MFEM_SIMD_BYTES > vreal_t
static const int align_bytes
AutoSIMD< complex_t, simd_size, MFEM_SIMD_BYTES > vcomplex_t