#define CORE_SANDYBRIDGE 20
#define CORE_BOBCAT 21
#define CORE_BULLDOZER 22
+#define CORE_HASWELL CORE_SANDYBRIDGE
#define HAVE_SSE (1 << 0)
#define HAVE_SSE2 (1 << 1)
#define CPUTYPE_SANDYBRIDGE 44
#define CPUTYPE_BOBCAT 45
#define CPUTYPE_BULLDOZER 46
+// this define is because BLAS doesn't have haswell specific optimizations yet
+#define CPUTYPE_HASWELL CPUTYPE_SANDYBRIDGE
+
#endif
#include "cpuid.h"
#ifdef NO_AVX
+#define CPUTYPE_HASWELL CPUTYPE_NEHALEM
+#define CORE_HASWELL CORE_NEHALEM
#define CPUTYPE_SANDYBRIDGE CPUTYPE_NEHALEM
#define CORE_SANDYBRIDGE CORE_NEHALEM
#define CPUTYPE_BULLDOZER CPUTYPE_BARCELONA
return CPUTYPE_SANDYBRIDGE;
else
return CPUTYPE_NEHALEM;
+ case 12:
+ if(support_avx())
+ return CPUTYPE_HASWELL;
+ else
+ return CPUTYPE_NEHALEM;
}
break;
+ case 4:
+ switch (model) {
+ case 5:
+ if(support_avx())
+ return CPUTYPE_HASWELL;
+ else
+ return CPUTYPE_NEHALEM;
+ }
+ break;
}
break;
case 0x7:
return CORE_SANDYBRIDGE;
else
return CORE_NEHALEM; //OS doesn't support AVX
+ case 12:
+ if(support_avx())
+ return CORE_HASWELL;
+ else
+ return CORE_NEHALEM;
}
break;
+ case 4:
+ switch (model) {
+ case 5:
+ if(support_avx())
+ return CORE_HASWELL;
+ else
+ return CORE_NEHALEM;
+ }
+ break;
}
break;
#define gotoblas_SANDYBRIDGE gotoblas_NEHALEM
#define gotoblas_BULLDOZER gotoblas_BARCELONA
#endif
-
+//Use sandy bridge kernels for haswell.
+#define gotoblas_HASWELL gotoblas_SANDYBRIDGE
#define VENDOR_INTEL 1
#define VENDOR_AMD 2
return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
}
}
+ //Intel Haswell
+ if (model == 12) {
+ if(support_avx())
+ return &gotoblas_HASWELL;
+ else{
+ fprintf(stderr, "OpenBLAS : Your OS does not support AVX instructions. OpenBLAS is using Nehalem kernels as a fallback, which may give poorer performance.\n");
+ return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
+ }
+ }
+ return NULL;
+ case 4:
+ //Intel Haswell
+ if (model == 5) {
+ if(support_avx())
+ return &gotoblas_HASWELL;
+ else{
+ fprintf(stderr, "OpenBLAS : Your OS does not support AVX instructions. OpenBLAS is using Nehalem kernels as a fallback, which may give poorer performance.\n");
+ return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
+ }
+ }
return NULL;
}
case 0xf: