[139234] trunk/dports/math/OpenBLAS

nicos at macports.org nicos at macports.org
Sat Aug 8 06:33:39 PDT 2015


Revision: 139234
          https://trac.macports.org/changeset/139234
Author:   nicos at macports.org
Date:     2015-08-08 06:33:39 -0700 (Sat, 08 Aug 2015)
Log Message:
-----------
OpenBLAS: add patch to support newer CPUs (upstream git commit 8977b3f2)

Modified Paths:
--------------
    trunk/dports/math/OpenBLAS/Portfile

Added Paths:
-----------
    trunk/dports/math/OpenBLAS/files/patch-broadwell.diff

Modified: trunk/dports/math/OpenBLAS/Portfile
===================================================================
--- trunk/dports/math/OpenBLAS/Portfile	2015-08-08 12:57:30 UTC (rev 139233)
+++ trunk/dports/math/OpenBLAS/Portfile	2015-08-08 13:33:39 UTC (rev 139234)
@@ -6,7 +6,7 @@
 PortGroup           muniversal 1.0
 
 github.setup        xianyi OpenBLAS 0.2.14 v
-revision            1
+revision            2
 
 conflicts           OpenBLAS-devel
 categories          math science
@@ -21,7 +21,8 @@
 archive_sites
 
 patchfiles          patch-libnoarch.diff \
-                    patch-linkLib.diff
+                    patch-linkLib.diff \
+                    patch-broadwell.diff
 
 checksums           rmd160  b8a5bbcdf1816a061e45aa086a9caa8540a45f6d \
                     sha256  aba5088534719cefd77e4155c281c56a3accd3eea218574c2c3d236952bb632b

Added: trunk/dports/math/OpenBLAS/files/patch-broadwell.diff
===================================================================
--- trunk/dports/math/OpenBLAS/files/patch-broadwell.diff	                        (rev 0)
+++ trunk/dports/math/OpenBLAS/files/patch-broadwell.diff	2015-08-08 13:33:39 UTC (rev 139234)
@@ -0,0 +1,152 @@
+diff -ur ../OpenBLAS-0.2.14-orig/cpuid_x86.c ./cpuid_x86.c
+--- ../OpenBLAS-0.2.14-orig/cpuid_x86.c	2015-03-25 05:07:07.000000000 +0900
++++ ./cpuid_x86.c	2015-08-08 22:26:31.000000000 +0900
+@@ -1101,6 +1101,16 @@
+ #endif
+           else
+ 	    return CPUTYPE_NEHALEM;
++	case 13:
++	  //Broadwell
++          if(support_avx())
++#ifndef NO_AVX2
++            return CPUTYPE_HASWELL;
++#else
++	    return CPUTYPE_SANDYBRIDGE;
++#endif
++          else
++	    return CPUTYPE_NEHALEM;
+ 	}
+ 	break;
+       case 4:
+@@ -1115,8 +1125,33 @@
+ #endif
+           else
+ 	    return CPUTYPE_NEHALEM;
++	case 7:
++	case 15:
++	  //Broadwell
++          if(support_avx())
++#ifndef NO_AVX2
++            return CPUTYPE_HASWELL;
++#else
++	    return CPUTYPE_SANDYBRIDGE;
++#endif
++          else
++	    return CPUTYPE_NEHALEM;
+         }
+         break;
++      case 5:
++        switch (model) {
++	case 6:
++	  //Broadwell
++          if(support_avx())
++#ifndef NO_AVX2
++            return CPUTYPE_HASWELL;
++#else
++	    return CPUTYPE_SANDYBRIDGE;
++#endif
++          else
++	    return CPUTYPE_NEHALEM;
++	}
++	break;
+       }
+       break;
+     case 0x7:
+@@ -1528,6 +1563,16 @@
+ #endif
+           else
+ 	    return CORE_NEHALEM;
++	case 13:
++	  //broadwell
++          if(support_avx())
++#ifndef NO_AVX2
++            return CORE_HASWELL;
++#else
++	    return CORE_SANDYBRIDGE;
++#endif
++          else
++	    return CORE_NEHALEM;
+ 	}
+ 	break;
+       case 4:
+@@ -1542,8 +1587,33 @@
+ #endif
+           else
+ 	    return CORE_NEHALEM;
++	case 7:
++	case 15:
++	  //broadwell
++          if(support_avx())
++#ifndef NO_AVX2
++            return CORE_HASWELL;
++#else
++	    return CORE_SANDYBRIDGE;
++#endif
++          else
++	    return CORE_NEHALEM;
+         }
+         break;
++      case 5:
++        switch (model) {
++	case 6:
++	  //broadwell
++          if(support_avx())
++#ifndef NO_AVX2
++            return CORE_HASWELL;
++#else
++	    return CORE_SANDYBRIDGE;
++#endif
++          else
++	    return CORE_NEHALEM;
++	}
++	break;
+       }
+       break;
+ 
+diff -ur ../OpenBLAS-0.2.14-orig/driver/others/dynamic.c ./driver/others/dynamic.c
+--- ../OpenBLAS-0.2.14-orig/driver/others/dynamic.c	2015-03-25 05:07:07.000000000 +0900
++++ ./driver/others/dynamic.c	2015-08-08 22:26:45.000000000 +0900
+@@ -221,6 +221,15 @@
+ 	    return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
+ 	  }
+ 	}
++	//Intel Broadwell
++	if (model == 13) {
++	  if(support_avx())
++	    return &gotoblas_HASWELL;
++	  else{
++	    openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
++	    return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
++	  }
++	}
+ 	return NULL;
+       case 4:
+ 		//Intel Haswell
+@@ -232,6 +241,26 @@
+ 	    return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
+ 	  }
+ 	}
++	//Intel Broadwell
++	if (model == 7 || model == 15) {
++	  if(support_avx())
++	    return &gotoblas_HASWELL;
++	  else{
++	    openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
++	    return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
++	  }
++	}
++	return NULL;
++      case 5:
++	//Intel Broadwell
++	if (model == 6) {
++	  if(support_avx())
++	    return &gotoblas_HASWELL;
++	  else{
++	    openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
++	    return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
++	  }
++	}
+ 	return NULL;
+       }
+       case 0xf:
+Only in .: patch-broadwell.diff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150808/eeab8d0e/attachment-0001.html>


More information about the macports-changes mailing list