Skip to content

Commit 6d6067a

Browse files
Explicitly verify dependency between architectures (like sse3 implies sse2)
Also add CI to make sure the assumption we make are correct on all architectures supported by GCC. Fix #1070
1 parent 4cd58ef commit 6d6067a

25 files changed

+207
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Arch consistency check
2+
on: [push, pull_request]
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout xsimd
11+
uses: actions/checkout@v3
12+
- name: Install dependencies
13+
run: sudo apt install g++
14+
- name: Check architecture consistency
15+
run: cd test && sh ./check_arch.sh

include/xsimd/types/xsimd_avx2_register.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ namespace xsimd
2929
};
3030

3131
#if XSIMD_WITH_AVX2
32+
33+
#if !XSIMD_WITH_AVX
34+
#error "architecture inconsistency: avx2 requires avx"
35+
#endif
36+
3237
namespace types
3338
{
3439
XSIMD_DECLARE_SIMD_REGISTER_ALIAS(avx2, avx);

include/xsimd/types/xsimd_avx512bw_register.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ namespace xsimd
3131

3232
#if XSIMD_WITH_AVX512BW
3333

34+
#if !XSIMD_WITH_AVX512DQ
35+
#error "architecture inconsistency: avx512bw requires avx512dq"
36+
#endif
37+
3438
namespace types
3539
{
3640
template <class T>

include/xsimd/types/xsimd_avx512cd_register.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ namespace xsimd
3131

3232
#if XSIMD_WITH_AVX512CD
3333

34+
#if !XSIMD_WITH_AVX512F
35+
#error "architecture inconsistency: avx512bw requires avx512f"
36+
#endif
37+
3438
namespace types
3539
{
3640
template <class T>

include/xsimd/types/xsimd_avx512dq_register.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ namespace xsimd
3131

3232
#if XSIMD_WITH_AVX512DQ
3333

34+
#if !XSIMD_WITH_AVX512CD
35+
#error "architecture inconsistency: avx512dq requires avx512cd"
36+
#endif
37+
3438
namespace types
3539
{
3640
template <class T>

include/xsimd/types/xsimd_avx512er_register.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ namespace xsimd
3131

3232
#if XSIMD_WITH_AVX512ER
3333

34+
#if !XSIMD_WITH_AVX512CD
35+
#error "architecture inconsistency: avx512er requires avx512cd"
36+
#endif
37+
3438
namespace types
3539
{
3640
template <class T>

include/xsimd/types/xsimd_avx512f_register.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ namespace xsimd
3333

3434
#if XSIMD_WITH_AVX512F
3535

36+
#if !XSIMD_WITH_AVX2
37+
#error "architecture inconsistency: avx512f requires avx2"
38+
#endif
39+
3640
namespace types
3741
{
3842
template <class T>

include/xsimd/types/xsimd_avx512ifma_register.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ namespace xsimd
3131

3232
#if XSIMD_WITH_AVX512IFMA
3333

34+
#if !XSIMD_WITH_AVX512BW
35+
#error "architecture inconsistency: avx512ifma requires avx512bw"
36+
#endif
37+
3438
namespace types
3539
{
3640
template <class T>

include/xsimd/types/xsimd_avx512pf_register.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ namespace xsimd
3131

3232
#if XSIMD_WITH_AVX512PF
3333

34+
#if !XSIMD_WITH_AVX512ER
35+
#error "architecture inconsistency: avx512pf requires avx512er"
36+
#endif
37+
3438
namespace types
3539
{
3640
template <class T>

include/xsimd/types/xsimd_avx512vbmi_register.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ namespace xsimd
3131

3232
#if XSIMD_WITH_AVX512VBMI
3333

34+
#if !XSIMD_WITH_AVX512IFMA
35+
#error "architecture inconsistency: avx512vbmi requires avx512ifma"
36+
#endif
37+
3438
namespace types
3539
{
3640
template <class T>

0 commit comments

Comments
 (0)