ifeq ($(or $(ZARCH_CC_SUPPORTS_ARCH11), $(ZARCH_CC_SUPPORTS_Z13)), 1)
DYNAMIC_CORE += Z13
+CCOMMON_OPT += -DDYN_Z13
else
$(info OpenBLAS: Not building Z13 kernels because the compiler $(CC) does not support it)
endif
ZARCH_CC_SUPPORTS_Z14=$(shell $(CC) -march=z14 $(ZARCH_TEST_COMPILE) && echo 1)
ifeq ($(or $(ZARCH_CC_SUPPORTS_ARCH12), $(ZARCH_CC_SUPPORTS_Z14)), 1)
DYNAMIC_CORE += Z14
+CCOMMON_OPT += -DDYN_Z14
else
$(info OpenBLAS: Not building Z14 kernels because the compiler $(CC) does not support it)
endif
#include "common.h"
#include <stdbool.h>
-// Gate kernels for z13 and z14 on gcc version
-#if (__GNUC__ == 5 && __GNUC_MINOR__ >= 2) || __GNUC__ >= 6 || \
- /* RHEL 7 since 7.3: */ \
- (__GNUC__ == 4 && __GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ == 5 && \
- __GNUC_RH_RELEASE__ >= 11)
-#define HAVE_Z13_SUPPORT
-#endif
-
-#if __GNUC__ >= 7
-#define HAVE_Z14_SUPPORT
-#endif
-
// Guard the use of getauxval() on glibc version >= 2.16
#ifdef __GLIBC__
#include <features.h>
#endif // __GLIBC
extern gotoblas_t gotoblas_ZARCH_GENERIC;
-#ifdef HAVE_Z13_SUPPORT
+#ifdef DYN_Z13
extern gotoblas_t gotoblas_Z13;
#endif
-#ifdef HAVE_Z14_SUPPORT
+#ifdef DYN_Z14
extern gotoblas_t gotoblas_Z14;
#endif
};
char* gotoblas_corename(void) {
-#ifdef HAVE_Z13_SUPPORT
+#ifdef DYN_Z13
if (gotoblas == &gotoblas_Z13) return corename[1];
#endif
-#ifdef HAVE_Z14_SUPPORT
+#ifdef DYN_Z14
if (gotoblas == &gotoblas_Z14) return corename[2];
#endif
if (gotoblas == &gotoblas_ZARCH_GENERIC) return corename[3];
unsigned long hwcap __attribute__((unused)) = get_hwcap();
+#ifdef DYN_Z14
// z14 and z15 systems: exploit Vector Facility (SIMD) and
// Vector-Enhancements Facility 1 (float SIMD instructions), if present.
-#ifdef HAVE_Z14_SUPPORT
if ((hwcap & HWCAP_S390_VX) && (hwcap & HWCAP_S390_VXE))
return &gotoblas_Z14;
#endif
+#ifdef DYN_Z13
// z13: Vector Facility (SIMD for double)
-#ifdef HAVE_Z13_SUPPORT
if (hwcap & HWCAP_S390_VX)
return &gotoblas_Z13;
#endif
}
}
- switch (found)
- {
-#ifdef HAVE_Z13_SUPPORT
- case 1: return (&gotoblas_Z13);
+ if (found == 1) {
+#ifdef DYN_Z13
+ return &gotoblas_Z13;
+#else
+ openblas_warning(1, "Z13 support not compiled in");
+ return NULL;
#endif
-#ifdef HAVE_Z14_SUPPORT
- case 2: return (&gotoblas_Z14);
+ } else if (found == 2) {
+#ifdef DYN_Z14
+ return &gotoblas_Z14;
+#else
+ openblas_warning(1, "Z14 support not compiled in");
+ return NULL;
#endif
- case 3: return (&gotoblas_ZARCH_GENERIC);
- default: return NULL;
+ } else if (found == 3) {
+ return &gotoblas_ZARCH_GENERIC;
}
+
snprintf(message, 128, "Core not found: %s\n", coretype);
openblas_warning(1, message);
+ return NULL;
}
void gotoblas_dynamic_init(void) {