1
1
/*********************************************************************/
2
2
/* Copyright 2009, 2010 The University of Texas at Austin. */
3
- /* Copyright 2023 The OpenBLAS Project */
3
+ /* Copyright 2023-2024 The OpenBLAS Project */
4
4
/* All rights reserved. */
5
5
/* */
6
6
/* Redistribution and use in source and binary forms, with or */
@@ -143,12 +143,13 @@ extern gotoblas_t gotoblas_ARMV8SVE;
143
143
#endif
144
144
extern gotoblas_t gotoblas_THUNDERX3T110 ;
145
145
#endif
146
+ #define gotoblas_NEOVERSEV2 gotoblas_NEOVERSEV1
146
147
147
148
extern void openblas_warning (int verbose , const char * msg );
148
149
#define FALLBACK_VERBOSE 1
149
150
#define NEOVERSEN1_FALLBACK "OpenBLAS : Your OS does not support SVE instructions. OpenBLAS is using Neoverse N1 kernels as a fallback, which may give poorer performance.\n"
150
151
151
- #define NUM_CORETYPES 16
152
+ #define NUM_CORETYPES 17
152
153
153
154
/*
154
155
* In case asm/hwcap.h is outdated on the build system, make sure
@@ -178,6 +179,7 @@ static char *corename[] = {
178
179
"emag8180" ,
179
180
"neoversen1" ,
180
181
"neoversev1" ,
182
+ "neoversev2" ,
181
183
"neoversen2" ,
182
184
"thunderx3t110" ,
183
185
"cortexa55" ,
@@ -198,10 +200,11 @@ char *gotoblas_corename(void) {
198
200
if (gotoblas == & gotoblas_EMAG8180 ) return corename [ 9 ];
199
201
if (gotoblas == & gotoblas_NEOVERSEN1 ) return corename [10 ];
200
202
if (gotoblas == & gotoblas_NEOVERSEV1 ) return corename [11 ];
201
- if (gotoblas == & gotoblas_NEOVERSEN2 ) return corename [12 ];
202
- if (gotoblas == & gotoblas_THUNDERX3T110 ) return corename [13 ];
203
- if (gotoblas == & gotoblas_CORTEXA55 ) return corename [14 ];
204
- if (gotoblas == & gotoblas_ARMV8SVE ) return corename [15 ];
203
+ if (gotoblas == & gotoblas_NEOVERSEV2 ) return corename [12 ];
204
+ if (gotoblas == & gotoblas_NEOVERSEN2 ) return corename [13 ];
205
+ if (gotoblas == & gotoblas_THUNDERX3T110 ) return corename [14 ];
206
+ if (gotoblas == & gotoblas_CORTEXA55 ) return corename [15 ];
207
+ if (gotoblas == & gotoblas_ARMV8SVE ) return corename [16 ];
205
208
return corename [NUM_CORETYPES ];
206
209
}
207
210
@@ -233,10 +236,11 @@ static gotoblas_t *force_coretype(char *coretype) {
233
236
case 9 : return (& gotoblas_EMAG8180 );
234
237
case 10 : return (& gotoblas_NEOVERSEN1 );
235
238
case 11 : return (& gotoblas_NEOVERSEV1 );
236
- case 12 : return (& gotoblas_NEOVERSEN2 );
237
- case 13 : return (& gotoblas_THUNDERX3T110 );
238
- case 14 : return (& gotoblas_CORTEXA55 );
239
- case 15 : return (& gotoblas_ARMV8SVE );
239
+ case 12 : return (& gotoblas_NEOVERSEV2 );
240
+ case 13 : return (& gotoblas_NEOVERSEN2 );
241
+ case 14 : return (& gotoblas_THUNDERX3T110 );
242
+ case 15 : return (& gotoblas_CORTEXA55 );
243
+ case 16 : return (& gotoblas_ARMV8SVE );
240
244
}
241
245
snprintf (message , 128 , "Core not found: %s\n" , coretype );
242
246
openblas_warning (1 , message );
@@ -312,6 +316,13 @@ static gotoblas_t *get_coretype(void) {
312
316
return & gotoblas_NEOVERSEN1 ;
313
317
}else
314
318
return & gotoblas_NEOVERSEV1 ;
319
+ case 0xd4f :
320
+ if (!(getauxval (AT_HWCAP ) & HWCAP_SVE )) {
321
+ openblas_warning (FALLBACK_VERBOSE , NEOVERSEN1_FALLBACK );
322
+ return & gotoblas_NEOVERSEN1 ;
323
+ } else {
324
+ return & gotoblas_NEOVERSEV2 ;
325
+ }
315
326
#endif
316
327
case 0xd05 : // Cortex A55
317
328
return & gotoblas_CORTEXA55 ;
0 commit comments