Skip to content

Commit f99b29d

Browse files
Full description of unavailable architecture
1 parent 6f5d0e0 commit f99b29d

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

include/xsimd/config/xsimd_arch.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ namespace xsimd
111111

112112
struct unavailable
113113
{
114+
static constexpr bool supported() noexcept { return false; }
115+
static constexpr bool available() noexcept { return false; }
116+
static constexpr unsigned version() noexcept { return 0; }
117+
static constexpr std::size_t alignment() noexcept { return 0; }
118+
static constexpr bool requires_alignment() noexcept { return false; }
119+
static constexpr char const* name() noexcept { return "<none>"; }
114120
};
115121

116122
namespace detail

include/xsimd/config/xsimd_config.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,8 @@
265265

266266
#endif
267267

268+
#if !XSIMD_WITH_SSE2 && !XSIMD_WITH_SSE3 && !XSIMD_WITH_SSSE3 && !XSIMD_WITH_SSE4_1 && !XSIMD_WITH_SSE4_2 && !XSIMD_WITH_AVX && !XSIMD_WITH_AVX2 && !XSIMD_WITH_FMA3 && !XSIMD_WITH_FMA5 && !XSIMD_WITH_AVX512F && !XSIMD_WITH_AVX512CD && !XSIMD_WITH_AVX512DQ && !XSIMD_WITH_AVX512BW && !XSIMD_WITH_NEON && !XSIMD_WITH_NEON64
269+
#define XSIMD_NO_SUPPORTED_ARCHITECTURE
270+
#endif
271+
268272
#endif

include/xsimd/xsimd.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,19 @@
1818
#define XSIMD_NO_DISCARD
1919
#endif
2020

21+
#include "config/xsimd_config.hpp"
22+
2123
#include "arch/xsimd_scalar.hpp"
2224
#include "memory/xsimd_aligned_allocator.hpp"
25+
26+
#if defined(XSIMD_NO_SUPPORTED_ARCHITECTURE)
27+
// to type definition or anything appart from scalar definition and aligned allocator
28+
#else
2329
#include "types/xsimd_batch.hpp"
2430
#include "types/xsimd_batch_constant.hpp"
2531
#include "types/xsimd_traits.hpp"
2632

2733
// This include must come last
2834
#include "types/xsimd_api.hpp"
2935
#endif
36+
#endif

0 commit comments

Comments
 (0)