Increase default BUFFER_SIZE on ARM, ZARCH and newer x86_64, add GEMM_R for POWER8/9
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Sun, 12 Apr 2020 17:44:48 +0000 (19:44 +0200)
committerGitHub <noreply@github.com>
Sun, 12 Apr 2020 17:44:48 +0000 (19:44 +0200)
As shown in #2538, default buffersizes on some platforms were smaller than required in memory.c
and the requirement could never be fulfilled for a calculated GEMM_R on PPC given the fomula used

common_arm.h
common_arm64.h
common_x86_64.h
common_zarch.h
param.h

index 27fa76b..8411e6d 100644 (file)
@@ -121,7 +121,7 @@ REALNAME:
 #endif
 #define HUGE_PAGESIZE   ( 4 << 20)
 
-#define BUFFER_SIZE     (16 << 20)
+#define BUFFER_SIZE     (32 << 20)
 
 
 #define BASE_ADDRESS (START_ADDRESS - BUFFER_SIZE * MAX_CPU_NUMBER)
index a928dbe..99e0cee 100644 (file)
@@ -141,12 +141,17 @@ REALNAME:
 #endif
 #define HUGE_PAGESIZE   ( 4 << 20)
 
+#ifndef BUFFERSIZE
 #if defined(CORTEXA57)
 #define BUFFER_SIZE     (20 << 20)
+#elif defined(TSV110) || defined(EMAG8180)
+#define BUFFER_SIZE     (32 << 20)
 #else
 #define BUFFER_SIZE     (16 << 20)
 #endif
-
+#else
+#define BUFFER_SIZE    (32 << BUFFERSIZE)
+#endif
 
 #define BASE_ADDRESS (START_ADDRESS - BUFFER_SIZE * MAX_CPU_NUMBER)
 
index fe5539a..958e9ca 100644 (file)
@@ -226,7 +226,13 @@ static __inline int blas_quickdivide(unsigned int x, unsigned int y){
 #define HUGE_PAGESIZE  ( 2 << 20)
 
 #ifndef BUFFERSIZE
+#if defined(SKYLAKEX) 
+#define BUFFER_SIZE    (32 << 21)
+#elif defined(HASWELL) || defined(ZEN)
+#define BUFFER_SIZE    (32 << 22)
+#else
 #define BUFFER_SIZE    (32 << 20)
+#endif
 #else
 #define BUFFER_SIZE    (32 << BUFFERSIZE)
 #endif
index e105574..b5503a7 100644 (file)
@@ -123,11 +123,7 @@ REALNAME:
 #endif
 #define HUGE_PAGESIZE   ( 4 << 20)
 
-#if defined(CORTEXA57)
-#define BUFFER_SIZE     (20 << 20)
-#else
-#define BUFFER_SIZE     (16 << 20)
-#endif
+#define BUFFER_SIZE     (32 << 22)
 
 
 #define BASE_ADDRESS (START_ADDRESS - BUFFER_SIZE * MAX_CPU_NUMBER)
diff --git a/param.h b/param.h
index 4103085..d6cbe54 100644 (file)
--- a/param.h
+++ b/param.h
@@ -2229,15 +2229,26 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define ZGEMM_DEFAULT_UNROLL_M 8
 #define ZGEMM_DEFAULT_UNROLL_N 2
 
-#define SGEMM_DEFAULT_P  1280
-#define DGEMM_DEFAULT_P  640
-#define CGEMM_DEFAULT_P  640
-#define ZGEMM_DEFAULT_P  320
-
-#define SGEMM_DEFAULT_Q  640
-#define DGEMM_DEFAULT_Q  720
-#define CGEMM_DEFAULT_Q  640
-#define ZGEMM_DEFAULT_Q  640
+#define SGEMM_DEFAULT_P  1280UL
+#define DGEMM_DEFAULT_P  640UL
+#define CGEMM_DEFAULT_P  640UL
+#define ZGEMM_DEFAULT_P  320UL
+
+#define SGEMM_DEFAULT_Q  640UL
+#define DGEMM_DEFAULT_Q  720UL
+#define CGEMM_DEFAULT_Q  640UL
+#define ZGEMM_DEFAULT_Q  640UL
+
+#if 0
+#define SGEMM_DEFAULT_R SGEMM_DEFAULT_P
+#define DGEMM_DEFAULT_R DGEMM_DEFAULT_P
+#define CGEMM_DEFAULT_R CGEMM_DEFAULT_P
+#define ZGEMM_DEFAULT_R ZGEMM_DEFAULT_P
+#endif
+#define SGEMM_DEFAULT_R 4096
+#define DGEMM_DEFAULT_R 4096
+#define CGEMM_DEFAULT_R 4096
+#define ZGEMM_DEFAULT_R 512
 
 #define SYMV_P  8