File: configure.m4

package info (click to toggle)
openmpi 5.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 202,312 kB
  • sloc: ansic: 612,441; makefile: 42,495; sh: 11,230; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,154; python: 1,856; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (119 lines) | stat: -rw-r--r-- 4,216 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# -*- shell-script -*-
#
# Copyright (c) 2019-2020 The University of Tennessee and The University
#                         of Tennessee Research Foundation.  All rights
#                         reserved.
# Copyright (c) 2024      NVIDIA Corporation.  All rights reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

# MCA_ompi_op_arm_CONFIG([action-if-can-compile],
#		         [action-if-cant-compile])
# ------------------------------------------------
AC_DEFUN([MCA_ompi_op_aarch64_CONFIG],[
    AC_CONFIG_FILES([ompi/mca/op/aarch64/Makefile])
    case "${host}" in
        aarch64*|arm64*)
            op_aarch64_check="yes";;
        *)
            op_aarch64_check="no";;
    esac
    AS_IF([test "$op_aarch64_check" = "yes"],
          [AC_LANG_PUSH([C])

           #
           # Check for NEON support
           #
           AC_CACHE_CHECK([for NEON support], op_cv_neon_support, 
                [
                  AC_LINK_IFELSE(
                      [AC_LANG_PROGRAM([[
#if defined(__aarch64__) && defined(__ARM_NEON)
#include <arm_neon.h>
#else
#error "No support for __aarch64__"
#endif
                                       ]],
                                       [[
#if defined(__aarch64__) && defined(__ARM_NEON)
    int32x4_t vA;
    vA = vmovq_n_s32(0)
#endif
                                       ]])],
                      [op_cv_neon_support=yes],
                      [op_cv_neon_support=no])])

           #
           # Check for NEON FP support
           #
           AC_CACHE_CHECK([for NEON FP support], op_cv_neon_fp_support,
                [AS_IF([test "$op_cv_neon_support" = "yes"],
                        [
                          AC_LINK_IFELSE(
                              [AC_LANG_PROGRAM([[
#if defined(__aarch64__) && defined(__ARM_NEON) && (defined(__ARM_NEON_FP) || defined(__ARM_FP))
#include <arm_neon.h>
#else
#error "No support for __aarch64__ or NEON FP"
#endif
                                             ]],
                                             [[
#if defined(__aarch64__) && defined(__ARM_NEON) && (defined(__ARM_NEON_FP) || defined(__ARM_FP))
    float32x4_t vA;
    vA = vmovq_n_f32(0)
#endif
                                             ]])],
                            [op_cv_neon_fp_support=yes],
                            [op_cv_neon_fp_support=no])])])

           #
           # Check for SVE support
           #
           AC_CACHE_CHECK([for SVE support], op_cv_sve_support,
                 [AS_IF([test "$op_cv_neon_support" = "yes"],
                        [
                          AC_LINK_IFELSE(
                              [AC_LANG_PROGRAM([[
#if defined(__aarch64__) && defined(__ARM_FEATURE_SVE)
#include <arm_sve.h>
#else
#error "No support for __aarch64__ or SVE"
#endif
                                             ]],
                                             [[
#if defined(__aarch64__) && defined(_ARM_FEATURE_SVE)
    svfloat32_t vA;
    vA = svdup_n_f32(0)
#endif
                                             ]])],
                      [op_cv_sve_support=yes],
                      [op_cv_sve_support=no])])])
          ])

    AM_CONDITIONAL([MCA_BUILD_ompi_op_has_neon_support],
                   [test "$op_cv_neon_support" = "yes"])
    AM_CONDITIONAL([MCA_BUILD_ompi_op_has_neon_fp_support],
                   [test "$op_cv_neon_fp_support" = "yes"])
    AM_CONDITIONAL([MCA_BUILD_ompi_op_has_sve_support],
                   [test "$op_cv_sve_support" = "yes"])
    AC_SUBST(MCA_BUILD_ompi_op_has_neon_support)
    AC_SUBST(MCA_BUILD_ompi_op_has_neon_fp_support)
    AC_SUBST(MCA_BUILD_ompi_op_has_sve_support)

    AS_IF([test "$op_cv_neon_support" = "yes"],
          [AC_DEFINE([OMPI_MCA_OP_HAVE_NEON], [1],[NEON supported in the current build])])
    AS_IF([test "$op_cv_neon_fp_support" = "yes"],
          [AC_DEFINE([OMPI_MCA_OP_HAVE_NEON_FP], [1],[NEON FP supported in the current build])])
    AS_IF([test "$op_cv_sve_support" = "yes"],
          [AC_DEFINE([OMPI_MCA_OP_HAVE_SVE], [1],[SVE supported in the current build])])

    # If we have at least support for Neon
    AS_IF([test "$op_cv_neon_support" = "yes"],
          [$1],
          [$2])
])dnl