Skip to content

Commit 26e42f9

Browse files
committed
op/avx: check for _mm512_mullo_epi64() AVX512 intrinsic
PGI (20.4) compiler do not define this intrinsic, so only build AVX512 support if _mm512_mullo_epi64() intrisic is defined. Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
1 parent 1f3e334 commit 26e42f9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ompi/mca/op/avx/configure.m4

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# of Tennessee Research Foundation. All rights
55
# reserved.
66
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
7+
# Copyright (c) 2020 Research Organization for Information Science
8+
# and Technology (RIST). All rights reserved.
79
#
810
# $COPYRIGHT$
911
#
@@ -83,6 +85,25 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
8385
CFLAGS="$op_avx_cflags_save"
8486
])
8587
#
88+
# Some PGI compilers do not define _mm512_mullo_epi64. Screen them out.
89+
#
90+
AS_IF([test $op_avx512_support -eq 1],
91+
[AC_MSG_CHECKING([if _mm512_mullo_epi64 generates code that can be compiled])
92+
op_avx_cflags_save="$CFLAGS"
93+
CFLAGS="$CFLAGS_WITHOUT_OPTFLAGS -O0 $MCA_BUILD_OP_AVX512_FLAGS"
94+
AC_LINK_IFELSE(
95+
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
96+
[[
97+
__m512i vA, vB;
98+
_mm512_mullo_epi64(vA, vB)
99+
]])],
100+
[AC_MSG_RESULT([yes])],
101+
[op_avx512_support=0
102+
MCA_BUILD_OP_AVX512_FLAGS=""
103+
AC_MSG_RESULT([no])])
104+
CFLAGS="$op_avx_cflags_save"
105+
])
106+
#
86107
# Check support for AVX2
87108
#
88109
AC_MSG_CHECKING([for AVX2 support (no additional flags)])

0 commit comments

Comments
 (0)