Browse Source

Refs #214, #221, #246. Fixed the getrf overflow bug on Windows.

I used a smaller threshold since the stack size is 1MB on windows.
tags/v0.2.7
Zhang Xianyi 12 years ago
parent
commit
32d2ca3035
6 changed files with 22 additions and 5 deletions
  1. +17
    -0
      common.h
  2. +1
    -1
      driver/level3/level3_gemm3m_thread.c
  3. +1
    -1
      driver/level3/level3_syrk_threaded.c
  4. +1
    -1
      driver/level3/level3_thread.c
  5. +1
    -1
      lapack/getrf/getrf_parallel.c
  6. +1
    -1
      lapack/potrf/potrf_parallel.c

+ 17
- 0
common.h View File

@@ -314,6 +314,23 @@ typedef int blasint;
#define YIELDING sched_yield() #define YIELDING sched_yield()
#endif #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 #ifdef QUAD_PRECISION
#include "common_quad.h" #include "common_quad.h"
#endif #endif


+ 1
- 1
driver/level3/level3_gemm3m_thread.c View File

@@ -50,7 +50,7 @@


//The array of job_t may overflow the stack. //The array of job_t may overflow the stack.
//Instead, use malloc to alloc job_t. //Instead, use malloc to alloc job_t.
#if MAX_CPU_NUMBER > 210
#if MAX_CPU_NUMBER > BLAS3_MEM_ALLOC_THRESHOLD
#define USE_ALLOC_HEAP #define USE_ALLOC_HEAP
#endif #endif




+ 1
- 1
driver/level3/level3_syrk_threaded.c View File

@@ -50,7 +50,7 @@


//The array of job_t may overflow the stack. //The array of job_t may overflow the stack.
//Instead, use malloc to alloc job_t. //Instead, use malloc to alloc job_t.
#if MAX_CPU_NUMBER > 210
#if MAX_CPU_NUMBER > BLAS3_MEM_ALLOC_THRESHOLD
#define USE_ALLOC_HEAP #define USE_ALLOC_HEAP
#endif #endif




+ 1
- 1
driver/level3/level3_thread.c View File

@@ -50,7 +50,7 @@


//The array of job_t may overflow the stack. //The array of job_t may overflow the stack.
//Instead, use malloc to alloc job_t. //Instead, use malloc to alloc job_t.
#if MAX_CPU_NUMBER > 210
#if MAX_CPU_NUMBER > BLAS3_MEM_ALLOC_THRESHOLD
#define USE_ALLOC_HEAP #define USE_ALLOC_HEAP
#endif #endif




+ 1
- 1
lapack/getrf/getrf_parallel.c View File

@@ -45,7 +45,7 @@ double sqrt(double);


//In this case, the recursive getrf_parallel may overflow the stack. //In this case, the recursive getrf_parallel may overflow the stack.
//Instead, use malloc to alloc job_t. //Instead, use malloc to alloc job_t.
#if MAX_CPU_NUMBER > 90
#if MAX_CPU_NUMBER > GETRF_MEM_ALLOC_THRESHOLD
#define USE_ALLOC_HEAP #define USE_ALLOC_HEAP
#endif #endif




+ 1
- 1
lapack/potrf/potrf_parallel.c View File

@@ -43,7 +43,7 @@


//The array of job_t may overflow the stack. //The array of job_t may overflow the stack.
//Instead, use malloc to alloc job_t. //Instead, use malloc to alloc job_t.
#if MAX_CPU_NUMBER > 210
#if MAX_CPU_NUMBER > BLAS3_MEM_ALLOC_THRESHOLD
#define USE_ALLOC_HEAP #define USE_ALLOC_HEAP
#endif #endif




Loading…
Cancel
Save