Eigen  3.4.90 (git rev 5a9f66fb35d03a4da9ef8976e67a61b30aa16dcf)
 
Loading...
Searching...
No Matches
ConfigureVectorization.h
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2008-2018 Gael Guennebaud <[email protected]>
5// Copyright (C) 2020, Arm Limited and Contributors
6//
7// This Source Code Form is subject to the terms of the Mozilla
8// Public License v. 2.0. If a copy of the MPL was not distributed
9// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
11#ifndef EIGEN_CONFIGURE_VECTORIZATION_H
12#define EIGEN_CONFIGURE_VECTORIZATION_H
13
14//------------------------------------------------------------------------------------------
15// Static and dynamic alignment control
16//
17// The main purpose of this section is to define EIGEN_MAX_ALIGN_BYTES and EIGEN_MAX_STATIC_ALIGN_BYTES
18// as the maximal boundary in bytes on which dynamically and statically allocated data may be alignment respectively.
19// The values of EIGEN_MAX_ALIGN_BYTES and EIGEN_MAX_STATIC_ALIGN_BYTES can be specified by the user. If not,
20// a default value is automatically computed based on architecture, compiler, and OS.
21//
22// This section also defines macros EIGEN_ALIGN_TO_BOUNDARY(N) and the shortcuts EIGEN_ALIGN{8,16,32,_MAX}
23// to be used to declare statically aligned buffers.
24//------------------------------------------------------------------------------------------
25
26/* EIGEN_ALIGN_TO_BOUNDARY(n) forces data to be n-byte aligned. This is used to satisfy SIMD requirements.
27 * However, we do that EVEN if vectorization (EIGEN_VECTORIZE) is disabled,
28 * so that vectorization doesn't affect binary compatibility.
29 *
30 * If we made alignment depend on whether or not EIGEN_VECTORIZE is defined, it would be impossible to link
31 * vectorized and non-vectorized code.
32 */
33#if (defined EIGEN_CUDACC)
34#define EIGEN_ALIGN_TO_BOUNDARY(n) __align__(n)
35#define EIGEN_ALIGNOF(x) __alignof(x)
36#else
37#define EIGEN_ALIGN_TO_BOUNDARY(n) alignas(n)
38#define EIGEN_ALIGNOF(x) alignof(x)
39#endif
40
41// If the user explicitly disable vectorization, then we also disable alignment
42#if defined(EIGEN_DONT_VECTORIZE)
43#if defined(EIGEN_GPUCC)
44// GPU code is always vectorized and requires memory alignment for
45// statically allocated buffers.
46#define EIGEN_IDEAL_MAX_ALIGN_BYTES 16
47#else
48#define EIGEN_IDEAL_MAX_ALIGN_BYTES 0
49#endif
50#elif defined(__AVX512F__)
51// 64 bytes static alignment is preferred only if really required
52#define EIGEN_IDEAL_MAX_ALIGN_BYTES 64
53#elif defined(__AVX__)
54// 32 bytes static alignment is preferred only if really required
55#define EIGEN_IDEAL_MAX_ALIGN_BYTES 32
56#elif defined __HVX__ && (__HVX_LENGTH__ == 128)
57#define EIGEN_IDEAL_MAX_ALIGN_BYTES 128
58#else
59#define EIGEN_IDEAL_MAX_ALIGN_BYTES 16
60#endif
61
62// EIGEN_MIN_ALIGN_BYTES defines the minimal value for which the notion of explicit alignment makes sense
63#define EIGEN_MIN_ALIGN_BYTES 16
64
65// Defined the boundary (in bytes) on which the data needs to be aligned. Note
66// that unless EIGEN_ALIGN is defined and not equal to 0, the data may not be
67// aligned at all regardless of the value of this #define.
68
69#if (defined(EIGEN_DONT_ALIGN_STATICALLY) || defined(EIGEN_DONT_ALIGN)) && defined(EIGEN_MAX_STATIC_ALIGN_BYTES) && \
70 EIGEN_MAX_STATIC_ALIGN_BYTES > 0
71#error EIGEN_MAX_STATIC_ALIGN_BYTES and EIGEN_DONT_ALIGN[_STATICALLY] are both defined with EIGEN_MAX_STATIC_ALIGN_BYTES!=0. Use EIGEN_MAX_STATIC_ALIGN_BYTES=0 as a synonym of EIGEN_DONT_ALIGN_STATICALLY.
72#endif
73
74// EIGEN_DONT_ALIGN_STATICALLY and EIGEN_DONT_ALIGN are deprecated
75// They imply EIGEN_MAX_STATIC_ALIGN_BYTES=0
76#if defined(EIGEN_DONT_ALIGN_STATICALLY) || defined(EIGEN_DONT_ALIGN)
77#ifdef EIGEN_MAX_STATIC_ALIGN_BYTES
78#undef EIGEN_MAX_STATIC_ALIGN_BYTES
79#endif
80#define EIGEN_MAX_STATIC_ALIGN_BYTES 0
81#endif
82
83#ifndef EIGEN_MAX_STATIC_ALIGN_BYTES
84
85// Try to automatically guess what is the best default value for EIGEN_MAX_STATIC_ALIGN_BYTES
86
87// 16 byte alignment is only useful for vectorization. Since it affects the ABI, we need to enable
88// 16 byte alignment on all platforms where vectorization might be enabled. In theory we could always
89// enable alignment, but it can be a cause of problems on some platforms, so we just disable it in
90// certain common platform (compiler+architecture combinations) to avoid these problems.
91// Only static alignment is really problematic (relies on nonstandard compiler extensions),
92// try to keep heap alignment even when we have to disable static alignment.
93#if EIGEN_COMP_GNUC && \
94 !(EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64 || EIGEN_ARCH_PPC || EIGEN_ARCH_IA64 || EIGEN_ARCH_MIPS)
95#define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 1
96#else
97#define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 0
98#endif
99
100// static alignment is completely disabled with GCC 3, Sun Studio, and QCC/QNX
101#if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT && !EIGEN_COMP_SUNCC && !EIGEN_OS_QNX
102#define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 1
103#else
104#define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 0
105#endif
106
107#if EIGEN_ARCH_WANTS_STACK_ALIGNMENT
108#define EIGEN_MAX_STATIC_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES
109#else
110#define EIGEN_MAX_STATIC_ALIGN_BYTES 0
111#endif
112
113#endif
114
115// If EIGEN_MAX_ALIGN_BYTES is defined, then it is considered as an upper bound for EIGEN_MAX_STATIC_ALIGN_BYTES
116#if defined(EIGEN_MAX_ALIGN_BYTES) && EIGEN_MAX_ALIGN_BYTES < EIGEN_MAX_STATIC_ALIGN_BYTES
117#undef EIGEN_MAX_STATIC_ALIGN_BYTES
118#define EIGEN_MAX_STATIC_ALIGN_BYTES EIGEN_MAX_ALIGN_BYTES
119#endif
120
121#if EIGEN_MAX_STATIC_ALIGN_BYTES == 0 && !defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT)
122#define EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
123#endif
124
125// At this stage, EIGEN_MAX_STATIC_ALIGN_BYTES>0 is the true test whether we want to align arrays on the stack or not.
126// It takes into account both the user choice to explicitly enable/disable alignment (by setting
127// EIGEN_MAX_STATIC_ALIGN_BYTES) and the architecture config (EIGEN_ARCH_WANTS_STACK_ALIGNMENT). Henceforth, only
128// EIGEN_MAX_STATIC_ALIGN_BYTES should be used.
129
130// Shortcuts to EIGEN_ALIGN_TO_BOUNDARY
131#define EIGEN_ALIGN8 EIGEN_ALIGN_TO_BOUNDARY(8)
132#define EIGEN_ALIGN16 EIGEN_ALIGN_TO_BOUNDARY(16)
133#define EIGEN_ALIGN32 EIGEN_ALIGN_TO_BOUNDARY(32)
134#define EIGEN_ALIGN64 EIGEN_ALIGN_TO_BOUNDARY(64)
135#if EIGEN_MAX_STATIC_ALIGN_BYTES > 0
136#define EIGEN_ALIGN_MAX EIGEN_ALIGN_TO_BOUNDARY(EIGEN_MAX_STATIC_ALIGN_BYTES)
137#else
138#define EIGEN_ALIGN_MAX
139#endif
140
141// Dynamic alignment control
142
143#if defined(EIGEN_DONT_ALIGN) && defined(EIGEN_MAX_ALIGN_BYTES) && EIGEN_MAX_ALIGN_BYTES > 0
144#error EIGEN_MAX_ALIGN_BYTES and EIGEN_DONT_ALIGN are both defined with EIGEN_MAX_ALIGN_BYTES!=0. Use EIGEN_MAX_ALIGN_BYTES=0 as a synonym of EIGEN_DONT_ALIGN.
145#endif
146
147#ifdef EIGEN_DONT_ALIGN
148#ifdef EIGEN_MAX_ALIGN_BYTES
149#undef EIGEN_MAX_ALIGN_BYTES
150#endif
151#define EIGEN_MAX_ALIGN_BYTES 0
152#elif !defined(EIGEN_MAX_ALIGN_BYTES)
153#define EIGEN_MAX_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES
154#endif
155
156#if EIGEN_IDEAL_MAX_ALIGN_BYTES > EIGEN_MAX_ALIGN_BYTES
157#define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES
158#else
159#define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_MAX_ALIGN_BYTES
160#endif
161
162#ifndef EIGEN_UNALIGNED_VECTORIZE
163#define EIGEN_UNALIGNED_VECTORIZE 1
164#endif
165
166//----------------------------------------------------------------------
167
168// if alignment is disabled, then disable vectorization. Note: EIGEN_MAX_ALIGN_BYTES is the proper check, it takes into
169// account both the user's will (EIGEN_MAX_ALIGN_BYTES,EIGEN_DONT_ALIGN) and our own platform checks
170#if EIGEN_MAX_ALIGN_BYTES == 0
171#ifndef EIGEN_DONT_VECTORIZE
172#define EIGEN_DONT_VECTORIZE
173#endif
174#endif
175
176// The following (except #include <malloc.h> and _M_IX86_FP ??) can likely be
177// removed as gcc 4.1 and msvc 2008 are not supported anyways.
178#if EIGEN_COMP_MSVC
179#include <malloc.h> // for _aligned_malloc -- need it regardless of whether vectorization is enabled
180// a user reported that in 64-bit mode, MSVC doesn't care to define _M_IX86_FP.
181#if (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || EIGEN_ARCH_x86_64
182#define EIGEN_SSE2_ON_MSVC_2008_OR_LATER
183#endif
184#else
185#if defined(__SSE2__)
186#define EIGEN_SSE2_ON_NON_MSVC
187#endif
188#endif
189
190#if !(defined(EIGEN_DONT_VECTORIZE) || defined(EIGEN_GPUCC))
191
192#if defined(EIGEN_SSE2_ON_NON_MSVC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER)
193
194// Defines symbols for compile-time detection of which instructions are
195// used.
196// EIGEN_VECTORIZE_YY is defined if and only if the instruction set YY is used
197#define EIGEN_VECTORIZE
198#define EIGEN_VECTORIZE_SSE
199#define EIGEN_VECTORIZE_SSE2
200
201// Detect sse3/ssse3/sse4:
202// gcc and icc defines __SSE3__, ...
203// there is no way to know about this on msvc. You can define EIGEN_VECTORIZE_SSE* if you
204// want to force the use of those instructions with msvc.
205#ifdef __SSE3__
206#define EIGEN_VECTORIZE_SSE3
207#endif
208#ifdef __SSSE3__
209#define EIGEN_VECTORIZE_SSSE3
210#endif
211#ifdef __SSE4_1__
212#define EIGEN_VECTORIZE_SSE4_1
213#endif
214#ifdef __SSE4_2__
215#define EIGEN_VECTORIZE_SSE4_2
216#endif
217#ifdef __AVX__
218#ifndef EIGEN_USE_SYCL
219#define EIGEN_VECTORIZE_AVX
220#endif
221#define EIGEN_VECTORIZE_SSE3
222#define EIGEN_VECTORIZE_SSSE3
223#define EIGEN_VECTORIZE_SSE4_1
224#define EIGEN_VECTORIZE_SSE4_2
225#endif
226#ifdef __AVX2__
227#ifndef EIGEN_USE_SYCL
228#define EIGEN_VECTORIZE_AVX2
229#define EIGEN_VECTORIZE_AVX
230#endif
231#define EIGEN_VECTORIZE_SSE3
232#define EIGEN_VECTORIZE_SSSE3
233#define EIGEN_VECTORIZE_SSE4_1
234#define EIGEN_VECTORIZE_SSE4_2
235#endif
236#if defined(__FMA__) || (EIGEN_COMP_MSVC && defined(__AVX2__))
237// MSVC does not expose a switch dedicated for FMA
238// For MSVC, AVX2 => FMA
239#define EIGEN_VECTORIZE_FMA
240#endif
241#if defined(__AVX512F__)
242#ifndef EIGEN_VECTORIZE_FMA
243#if EIGEN_COMP_GNUC
244#error Please add -mfma to your compiler flags: compiling with -mavx512f alone without SSE/AVX FMA is not supported (bug 1638).
245#else
246#error Please enable FMA in your compiler flags (e.g. -mfma): compiling with AVX512 alone without SSE/AVX FMA is not supported (bug 1638).
247#endif
248#endif
249#ifndef EIGEN_USE_SYCL
250#define EIGEN_VECTORIZE_AVX512
251#define EIGEN_VECTORIZE_AVX2
252#define EIGEN_VECTORIZE_AVX
253#endif
254#define EIGEN_VECTORIZE_FMA
255#define EIGEN_VECTORIZE_SSE3
256#define EIGEN_VECTORIZE_SSSE3
257#define EIGEN_VECTORIZE_SSE4_1
258#define EIGEN_VECTORIZE_SSE4_2
259#ifndef EIGEN_USE_SYCL
260#ifdef __AVX512DQ__
261#define EIGEN_VECTORIZE_AVX512DQ
262#endif
263#ifdef __AVX512ER__
264#define EIGEN_VECTORIZE_AVX512ER
265#endif
266#ifdef __AVX512BF16__
267#define EIGEN_VECTORIZE_AVX512BF16
268#endif
269#ifdef __AVX512VL__
270#define EIGEN_VECTORIZE_AVX512VL
271#endif
272#ifdef __AVX512FP16__
273#ifdef __AVX512VL__
274#define EIGEN_VECTORIZE_AVX512FP16
275#else
276#if EIGEN_COMP_GNUC
277#error Please add -mavx512vl to your compiler flags: compiling with -mavx512fp16 alone without AVX512-VL is not supported.
278#else
279#error Please enable AVX512-VL in your compiler flags (e.g. -mavx512vl): compiling with AVX512-FP16 alone without AVX512-VL is not supported.
280#endif
281#endif
282#endif
283#endif
284#endif
285
286// Disable AVX support on broken xcode versions
287#if (EIGEN_COMP_CLANGAPPLE == 11000033) && (__MAC_OS_X_VERSION_MIN_REQUIRED == 101500)
288// A nasty bug in the clang compiler shipped with xcode in a common compilation situation
289// when XCode 11.0 and Mac deployment target macOS 10.15 is https://trac.macports.org/ticket/58776#no1
290#ifdef EIGEN_VECTORIZE_AVX
291#undef EIGEN_VECTORIZE_AVX
292#warning \
293 "Disabling AVX support: clang compiler shipped with XCode 11.[012] generates broken assembly with -macosx-version-min=10.15 and AVX enabled. "
294#ifdef EIGEN_VECTORIZE_AVX2
295#undef EIGEN_VECTORIZE_AVX2
296#endif
297#ifdef EIGEN_VECTORIZE_FMA
298#undef EIGEN_VECTORIZE_FMA
299#endif
300#ifdef EIGEN_VECTORIZE_AVX512
301#undef EIGEN_VECTORIZE_AVX512
302#endif
303#ifdef EIGEN_VECTORIZE_AVX512DQ
304#undef EIGEN_VECTORIZE_AVX512DQ
305#endif
306#ifdef EIGEN_VECTORIZE_AVX512ER
307#undef EIGEN_VECTORIZE_AVX512ER
308#endif
309#endif
310// NOTE: Confirmed test failures in XCode 11.0, and XCode 11.2 with -macosx-version-min=10.15 and AVX
311// NOTE using -macosx-version-min=10.15 with Xcode 11.0 results in runtime segmentation faults in many tests, 11.2
312// produce core dumps in 3 tests NOTE using -macosx-version-min=10.14 produces functioning and passing tests in all
313// cases NOTE __clang_version__ "11.0.0 (clang-1100.0.33.8)" XCode 11.0 <- Produces many segfault and core dumping
314// tests
315// with -macosx-version-min=10.15 and AVX
316// NOTE __clang_version__ "11.0.0 (clang-1100.0.33.12)" XCode 11.2 <- Produces 3 core dumping tests with
317// -macosx-version-min=10.15 and AVX
318#endif
319
320// include files
321
322// This extern "C" works around a MINGW-w64 compilation issue
323// https://sourceforge.net/tracker/index.php?func=detail&aid=3018394&group_id=202880&atid=983354
324// In essence, intrin.h is included by windows.h and also declares intrinsics (just as emmintrin.h etc. below do).
325// However, intrin.h uses an extern "C" declaration, and g++ thus complains of duplicate declarations
326// with conflicting linkage. The linkage for intrinsics doesn't matter, but at that stage the compiler doesn't know;
327// so, to avoid compile errors when windows.h is included after Eigen/Core, ensure intrinsics are extern "C" here too.
328// notice that since these are C headers, the extern "C" is theoretically needed anyways.
329extern "C" {
330// In theory we should only include immintrin.h and not the other *mmintrin.h header files directly.
331// Doing so triggers some issues with ICC. However old gcc versions seems to not have this file, thus:
332#if EIGEN_COMP_ICC >= 1110 || EIGEN_COMP_EMSCRIPTEN
333#include <immintrin.h>
334#else
335#include <mmintrin.h>
336#include <emmintrin.h>
337#include <xmmintrin.h>
338#ifdef EIGEN_VECTORIZE_SSE3
339#include <pmmintrin.h>
340#endif
341#ifdef EIGEN_VECTORIZE_SSSE3
342#include <tmmintrin.h>
343#endif
344#ifdef EIGEN_VECTORIZE_SSE4_1
345#include <smmintrin.h>
346#endif
347#ifdef EIGEN_VECTORIZE_SSE4_2
348#include <nmmintrin.h>
349#endif
350#if defined(EIGEN_VECTORIZE_AVX) || defined(EIGEN_VECTORIZE_AVX512)
351#include <immintrin.h>
352#endif
353#endif
354} // end extern "C"
355
356#elif defined(__VSX__) && !defined(__APPLE__)
357
358#define EIGEN_VECTORIZE
359#define EIGEN_VECTORIZE_VSX 1
360#define EIGEN_VECTORIZE_FMA
361#include <altivec.h>
362// We need to #undef all these ugly tokens defined in <altivec.h>
363// => use __vector instead of vector
364#undef bool
365#undef vector
366#undef pixel
367
368#elif defined __ALTIVEC__
369
370#define EIGEN_VECTORIZE
371#define EIGEN_VECTORIZE_ALTIVEC
372#define EIGEN_VECTORIZE_FMA
373#include <altivec.h>
374// We need to #undef all these ugly tokens defined in <altivec.h>
375// => use __vector instead of vector
376#undef bool
377#undef vector
378#undef pixel
379
380#elif ((defined __ARM_NEON) || (defined __ARM_NEON__)) && !(defined EIGEN_ARM64_USE_SVE)
381
382#define EIGEN_VECTORIZE
383#define EIGEN_VECTORIZE_NEON
384#include <arm_neon.h>
385
386// We currently require SVE to be enabled explicitly via EIGEN_ARM64_USE_SVE and
387// will not select the backend automatically
388#elif (defined __ARM_FEATURE_SVE) && (defined EIGEN_ARM64_USE_SVE)
389
390#define EIGEN_VECTORIZE
391#define EIGEN_VECTORIZE_SVE
392#include <arm_sve.h>
393
394// Since we depend on knowing SVE vector lengths at compile-time, we need
395// to ensure a fixed lengths is set
396#if defined __ARM_FEATURE_SVE_BITS
397#define EIGEN_ARM64_SVE_VL __ARM_FEATURE_SVE_BITS
398#else
399#error "Eigen requires a fixed SVE lector length but EIGEN_ARM64_SVE_VL is not set."
400#endif
401
402#elif (defined __s390x__ && defined __VEC__)
403
404#define EIGEN_VECTORIZE
405#define EIGEN_VECTORIZE_ZVECTOR
406#include <vecintrin.h>
407
408#elif defined __mips_msa
409
410// Limit MSA optimizations to little-endian CPUs for now.
411// TODO: Perhaps, eventually support MSA optimizations on big-endian CPUs?
412#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
413#if defined(__LP64__)
414#define EIGEN_MIPS_64
415#else
416#define EIGEN_MIPS_32
417#endif
418#define EIGEN_VECTORIZE
419#define EIGEN_VECTORIZE_MSA
420#include <msa.h>
421#endif
422
423#elif defined __HVX__ && (__HVX_LENGTH__ == 128)
424
425#define EIGEN_VECTORIZE
426#define EIGEN_VECTORIZE_HVX
427#include <hexagon_types.h>
428
429#endif
430#endif
431
432// Following the Arm ACLE arm_neon.h should also include arm_fp16.h but not all
433// compilers seem to follow this. We therefore include it explicitly.
434// See also: https://bugs.llvm.org/show_bug.cgi?id=47955
435#if defined(EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC)
436#include <arm_fp16.h>
437#endif
438
439// Enable FMA for ARM.
440#if defined(__ARM_FEATURE_FMA)
441#define EIGEN_VECTORIZE_FMA
442#endif
443
444#if defined(__F16C__) && !defined(EIGEN_GPUCC) && (!EIGEN_COMP_CLANG_STRICT || EIGEN_CLANG_STRICT_AT_LEAST(3, 8, 0))
445// We can use the optimized fp16 to float and float to fp16 conversion routines
446#define EIGEN_HAS_FP16_C
447
448#if EIGEN_COMP_GNUC
449// Make sure immintrin.h is included, even if e.g. vectorization is
450// explicitly disabled (see also issue #2395).
451// Note that FP16C intrinsics for gcc and clang are included by immintrin.h,
452// as opposed to emmintrin.h as suggested by Intel:
453// https://software.intel.com/sites/landingpage/IntrinsicsGuide/#othertechs=FP16C&expand=1711
454#include <immintrin.h>
455#endif
456#endif
457
458#if defined EIGEN_CUDACC
459#define EIGEN_VECTORIZE_GPU
460#include <vector_types.h>
461#if EIGEN_CUDA_SDK_VER >= 70500
462#define EIGEN_HAS_CUDA_FP16
463#endif
464#endif
465
466#if defined(EIGEN_HAS_CUDA_FP16)
467#include <cuda_runtime_api.h>
468#include <cuda_fp16.h>
469#endif
470
471#if defined(EIGEN_HIPCC)
472#define EIGEN_VECTORIZE_GPU
473#include <hip/hip_vector_types.h>
474#define EIGEN_HAS_HIP_FP16
475#include <hip/hip_fp16.h>
476#define EIGEN_HAS_HIP_BF16
477#include <hip/hip_bfloat16.h>
478#endif
479
481// IWYU pragma: private
482#include "../InternalHeaderCheck.h"
483
484namespace Eigen {
485
486inline static const char *SimdInstructionSetsInUse(void) {
487#if defined(EIGEN_VECTORIZE_AVX512)
488 return "AVX512, FMA, AVX2, AVX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2";
489#elif defined(EIGEN_VECTORIZE_AVX)
490 return "AVX SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2";
491#elif defined(EIGEN_VECTORIZE_SSE4_2)
492 return "SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2";
493#elif defined(EIGEN_VECTORIZE_SSE4_1)
494 return "SSE, SSE2, SSE3, SSSE3, SSE4.1";
495#elif defined(EIGEN_VECTORIZE_SSSE3)
496 return "SSE, SSE2, SSE3, SSSE3";
497#elif defined(EIGEN_VECTORIZE_SSE3)
498 return "SSE, SSE2, SSE3";
499#elif defined(EIGEN_VECTORIZE_SSE2)
500 return "SSE, SSE2";
501#elif defined(EIGEN_VECTORIZE_ALTIVEC)
502 return "AltiVec";
503#elif defined(EIGEN_VECTORIZE_VSX)
504 return "VSX";
505#elif defined(EIGEN_VECTORIZE_NEON)
506 return "ARM NEON";
507#elif defined(EIGEN_VECTORIZE_SVE)
508 return "ARM SVE";
509#elif defined(EIGEN_VECTORIZE_ZVECTOR)
510 return "S390X ZVECTOR";
511#elif defined(EIGEN_VECTORIZE_MSA)
512 return "MIPS MSA";
513#else
514 return "None";
515#endif
516}
517
518} // end namespace Eigen
519
520#endif // EIGEN_CONFIGURE_VECTORIZATION_H
Namespace containing all symbols from the Eigen library.
Definition Core:137