Skip to content

Commit b863bf8

Browse files
committed
Add a check for 512 bits generated code.
Improve the tester. Signed-off-by: George Bosilca <[email protected]>
1 parent ff930e6 commit b863bf8

File tree

3 files changed

+1205
-1098
lines changed

3 files changed

+1205
-1098
lines changed

ompi/mca/op/avx/configure.m4

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,26 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
6363
CFLAGS="$op_avx_cflags_save"
6464
])
6565
#
66+
# Some combination of gcc and older as would not correctly build the code generated by
67+
# _mm256_loadu_si256. Screen them out.
68+
#
69+
AS_IF([test $op_avx512_support -eq 1],
70+
[AC_MSG_CHECKING([if _mm512_loadu_si512 generates code that can be compiled])
71+
op_avx_cflags_save="$CFLAGS"
72+
CFLAGS="$CFLAGS_WITHOUT_OPTFLAGS -O0 $MCA_BUILD_OP_AVX512_FLAGS"
73+
AC_LINK_IFELSE(
74+
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
75+
[[
76+
int A[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
77+
__m512i vA = _mm512_loadu_si512((__m512i*)&(A[1]))
78+
]])],
79+
[AC_MSG_RESULT([yes])],
80+
[op_avx512_support=0
81+
MCA_BUILD_OP_AVX512_FLAGS=""
82+
AC_MSG_RESULT([no])])
83+
CFLAGS="$op_avx_cflags_save"
84+
])
85+
#
6686
# Check support for AVX2
6787
#
6888
AC_MSG_CHECKING([for AVX2 support (no additional flags)])

test/datatype/check_op.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
set -u
4+
35
echo "ompi version with AVX512 -- Usage: arg1: count of elements, args2: 'i'|'u'|'f'|'d' : datatype: signed, unsigned, float, double. args3 size of type. args4 operation"
46
echo "mpirun -mca op_sve_hardware_available 0 -mca op_avx_hardware_available 0 -np 1 Reduce_local_float 1048576 i 8 max"
57

0 commit comments

Comments
 (0)