Refs #214, #221, #246. Fixed the getrf overflow bug on Windows.
authorZhang Xianyi <traits.zhang@gmail.com>
Wed, 10 Jul 2013 19:20:02 +0000 (03:20 +0800)
committerZhang Xianyi <traits.zhang@gmail.com>
Wed, 10 Jul 2013 19:20:02 +0000 (03:20 +0800)
I used a smaller threshold since the stack size is 1MB on windows.

common.h
driver/level3/level3_gemm3m_thread.c
driver/level3/level3_syrk_threaded.c
driver/level3/level3_thread.c
lapack/getrf/getrf_parallel.c
lapack/potrf/potrf_parallel.c

index d46a523..fa4c1d7 100644 (file)
--- a/common.h
+++ b/common.h
@@ -314,6 +314,23 @@ typedef int blasint;
 #define YIELDING       sched_yield()
 #endif
 
+/***
+To alloc job_t on heap or statck.
+please https://github.com/xianyi/OpenBLAS/issues/246
+***/
+#if defined(OS_WINDOWS)
+#define GETRF_MEM_ALLOC_THRESHOLD 32
+#define BLAS3_MEM_ALLOC_THRESHOLD 32
+#endif
+
+#ifndef GETRF_MEM_ALLOC_THRESHOLD
+#define GETRF_MEM_ALLOC_THRESHOLD 80
+#endif
+
+#ifndef BLAS3_MEM_ALLOC_THRESHOLD
+#define BLAS3_MEM_ALLOC_THRESHOLD 160
+#endif
+
 #ifdef QUAD_PRECISION
 #include "common_quad.h"
 #endif
index 036eebb..bcb0f9d 100644 (file)
@@ -50,7 +50,7 @@
 
 //The array of job_t may overflow the stack.
 //Instead, use malloc to alloc job_t. 
-#if MAX_CPU_NUMBER > 210
+#if MAX_CPU_NUMBER > BLAS3_MEM_ALLOC_THRESHOLD
 #define USE_ALLOC_HEAP
 #endif
 
index 989d156..4a3f7a8 100644 (file)
@@ -50,7 +50,7 @@
 
 //The array of job_t may overflow the stack.
 //Instead, use malloc to alloc job_t. 
-#if MAX_CPU_NUMBER > 210
+#if MAX_CPU_NUMBER > BLAS3_MEM_ALLOC_THRESHOLD
 #define USE_ALLOC_HEAP
 #endif
 
index 364b72e..3242790 100644 (file)
@@ -50,7 +50,7 @@
 
 //The array of job_t may overflow the stack.
 //Instead, use malloc to alloc job_t. 
-#if MAX_CPU_NUMBER > 210
+#if MAX_CPU_NUMBER > BLAS3_MEM_ALLOC_THRESHOLD
 #define USE_ALLOC_HEAP
 #endif
 
index e9ce038..21ea9d5 100644 (file)
@@ -45,7 +45,7 @@ double sqrt(double);
 
 //In this case, the recursive getrf_parallel may overflow the stack.
 //Instead, use malloc to alloc job_t. 
-#if MAX_CPU_NUMBER > 90
+#if MAX_CPU_NUMBER > GETRF_MEM_ALLOC_THRESHOLD
 #define USE_ALLOC_HEAP
 #endif
 
index 4156dc0..eec9b6e 100644 (file)
@@ -43,7 +43,7 @@
 
 //The array of job_t may overflow the stack.
 //Instead, use malloc to alloc job_t. 
-#if MAX_CPU_NUMBER > 210
+#if MAX_CPU_NUMBER > BLAS3_MEM_ALLOC_THRESHOLD
 #define USE_ALLOC_HEAP
 #endif