Skip to content

Commit eea006a

Browse files
committed
Wrap SVE header with __has_include check
1 parent fd4f52c commit eea006a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

kernel/arm64/dot.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929

3030
#include "common.h"
3131

32+
// Some compilers will report feature support for SVE without the appropriate
33+
// header available
3234
#ifdef HAVE_SVE
35+
#if defined __has_include
36+
#if __has_include(<arm_sve.h>) && __ARM_FEATURE_SVE
37+
#define USE_SVE
38+
#endif
39+
#endif
40+
#endif
41+
42+
#ifdef USE_SVE
3343
#include "dot_kernel_sve.c"
3444
#endif
3545
#include "dot_kernel_asimd.c"
@@ -46,7 +56,7 @@ static RETURN_TYPE dot_compute(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, B
4656

4757
if ( n <= 0 ) return dot;
4858

49-
#ifdef HAVE_SVE
59+
#ifdef USE_SVE
5060
if (inc_x == 1 && inc_y == 1) {
5161
return dot_kernel_sve(n, x, y);
5262
}

0 commit comments

Comments
 (0)