Skip to content

Commit 903b142

Browse files
authored
Merge branch 'xtensor-stack:master' into refactor_examples
2 parents 7e0eb5f + 4decfbd commit 903b142

18 files changed

+37
-5
lines changed

include/xsimd/config/xsimd_config.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#ifndef XSIMD_CONFIG_HPP
22
#define XSIMD_CONFIG_HPP
33

4+
#define XSIMD_VERSION_MAJOR 8
5+
#define XSIMD_VERSION_MINOR 0
6+
#define XSIMD_VERSION_PATCH 0
47

58
/**
69
* high level free functions

include/xsimd/config/xsimd_cpuid.hpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
#include <algorithm>
66
#include <array>
77

8+
#if defined(__linux__) && (defined(__ARM_NEON) || defined(_M_ARM))
9+
#include <sys/auxv.h>
10+
#include <asm/hwcap.h>
11+
#endif
12+
813
#if defined(_MSC_VER)
914
// Contains the definition of __cpuidex
1015
#include <intrin.h>
@@ -46,12 +51,14 @@ namespace xsimd
4651
neon64 = 1;
4752
best = neon64::version();
4853
#elif defined(__ARM_NEON) || defined(_M_ARM)
49-
// TODO: fix undefined error of AT_HWCAP on arm7
50-
//neon = bool(getauxval(AT_HWCAP) & HWCAP_NEON);
51-
//best = neon::version() * neon;
52-
neon = 1;
54+
#if defined(__linux__)
55+
neon = bool(getauxval(AT_HWCAP) & HWCAP_NEON);
56+
#else
57+
// that's very conservative :-/
58+
neon = 0;
59+
#endif
5360
neon64 = 0;
54-
best = neon::version();
61+
best = neon::version() * neon;
5562

5663
#elif defined(__x86_64__) || defined(__i386__) || defined(_M_AMD64) || defined(_M_IX86)
5764
auto get_cpuid = [](int reg[4], int func_id)

include/xsimd/types/xsimd_avx2_register.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace xsimd
1010
static constexpr bool supported() { return XSIMD_WITH_AVX2; }
1111
static constexpr bool available() { return true; }
1212
static constexpr unsigned version() { return generic::version(2, 2, 0); }
13+
static constexpr char const* name() { return "avx2"; }
1314
};
1415

1516
#if XSIMD_WITH_AVX2

include/xsimd/types/xsimd_avx512bw_register.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace xsimd {
99
static constexpr bool supported() { return XSIMD_WITH_AVX512BW; }
1010
static constexpr bool available() { return true; }
1111
static constexpr unsigned version() { return generic::version(3, 4, 0); }
12+
static constexpr char const* name() { return "avx512bw"; }
1213
};
1314

1415
#if XSIMD_WITH_AVX512BW

include/xsimd/types/xsimd_avx512cd_register.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace xsimd {
99
static constexpr bool supported() { return XSIMD_WITH_AVX512BW; }
1010
static constexpr bool available() { return true; }
1111
static constexpr unsigned version() { return generic::version(3, 2, 0); }
12+
static constexpr char const* name() { return "avx512cd"; }
1213
};
1314

1415
#if XSIMD_WITH_AVX512BW

include/xsimd/types/xsimd_avx512dq_register.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace xsimd {
99
static constexpr bool supported() { return XSIMD_WITH_AVX512DQ; }
1010
static constexpr bool available() { return true; }
1111
static constexpr unsigned version() { return generic::version(3, 3, 0); }
12+
static constexpr char const* name() { return "avx512dq"; }
1213
};
1314

1415
#if XSIMD_WITH_AVX512DQ

include/xsimd/types/xsimd_avx512f_register.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace xsimd {
1111
static constexpr unsigned version() { return generic::version(3, 1, 0); }
1212
static constexpr std::size_t alignment() { return 64; }
1313
static constexpr bool requires_alignment() { return true; }
14+
static constexpr char const* name() { return "avx512f"; }
1415
};
1516

1617
#if XSIMD_WITH_AVX512F

include/xsimd/types/xsimd_avx_register.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace xsimd {
1111
static constexpr unsigned version() { return generic::version(2, 1, 0); }
1212
static constexpr std::size_t alignment() { return 32; }
1313
static constexpr bool requires_alignment() { return true; }
14+
static constexpr char const* name() { return "avx"; }
1415
};
1516
}
1617

include/xsimd/types/xsimd_fma3_register.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace xsimd {
1010
static constexpr bool supported() { return XSIMD_WITH_FMA3; }
1111
static constexpr bool available() { return true; }
1212
static constexpr unsigned version() { return generic::version(1, 5, 0); }
13+
static constexpr char const* name() { return "sse4.2+fma"; }
1314
};
1415

1516
#if XSIMD_WITH_FMA3

include/xsimd/types/xsimd_fma5_register.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace xsimd {
1010
static constexpr bool supported() { return XSIMD_WITH_FMA5; }
1111
static constexpr bool available() { return true; }
1212
static constexpr unsigned version() { return generic::version(2, 3, 0); }
13+
static constexpr char const* name() { return "avx2+fma"; }
1314
};
1415

1516
#if XSIMD_WITH_FMA5

0 commit comments

Comments
 (0)