Skip to content

Commit

Permalink
Refs #214, #221, #246. Fixed the getrf overflow bug on Windows.
Browse files Browse the repository at this point in the history
I used a smaller threshold since the stack size is 1MB on windows.
  • Loading branch information
xianyi committed Jul 10, 2013
1 parent 6df39ad commit 32d2ca3
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
17 changes: 17 additions & 0 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion driver/level3/level3_gemm3m_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion driver/level3/level3_syrk_threaded.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion driver/level3/level3_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lapack/getrf/getrf_parallel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lapack/potrf/potrf_parallel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 32d2ca3

Please sign in to comment.