Skip to content

Commit b14f44d

Browse files
authored
Temporarily disable special handling of OPENMP thread memory allocation
for issue #1673
1 parent 61659f8 commit b14f44d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

driver/others/memory.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
140140
#endif
141141

142142
#ifndef BUFFERS_PER_THREAD
143-
#ifdef USE_OPENMP
143+
#ifdef USE_OPENMP_UNUSED
144144
#define BUFFERS_PER_THREAD (MAX_CPU_NUMBER * 2 * MAX_PARALLEL_NUMBER)
145145
#else
146146
#define BUFFERS_PER_THREAD NUM_BUFFERS
@@ -363,7 +363,7 @@ int blas_get_cpu_number(void){
363363
#endif
364364

365365
// blas_goto_num = 0;
366-
#ifndef USE_OPENMP
366+
#ifndef USE_OPENMP_UNUSED
367367
blas_goto_num=openblas_num_threads_env();
368368
if (blas_goto_num < 0) blas_goto_num = 0;
369369

@@ -494,7 +494,7 @@ static const int allocation_block_size = BUFFER_SIZE + sizeof(struct alloc_t);
494494
#endif
495495

496496
/* Holds pointers to allocated memory */
497-
#if defined(SMP) && !defined(USE_OPENMP)
497+
#if defined(SMP) && !defined(USE_OPENMP_UNUSED)
498498
/* This is the number of threads than can be spawned by the server, which is the
499499
server plus the number of threads in the thread pool */
500500
# define MAX_ALLOCATING_THREADS MAX_CPU_NUMBER * 2 * MAX_PARALLEL_NUMBER +1
@@ -532,7 +532,7 @@ static BLASULONG alloc_lock = 0UL;
532532

533533
/* Returns a pointer to the start of the per-thread memory allocation data */
534534
static __inline struct alloc_t ** get_memory_table() {
535-
#if defined(SMP) && !defined(USE_OPENMP)
535+
#if defined(SMP) && !defined(USE_OPENMP_UNUSED)
536536
# if !defined(HAS_COMPILER_TLS)
537537
# if defined(OS_WINDOWS)
538538
int local_memory_table_pos = (int)::TlsGetValue(local_storage_key);
@@ -1057,7 +1057,7 @@ static volatile int memory_initialized = 0;
10571057
/* 2 : Thread */
10581058

10591059
static void blas_memory_init(){
1060-
#if defined(SMP) && !defined(USE_OPENMP)
1060+
#if defined(SMP) && !defined(USE_OPENMP_UNUSED)
10611061
next_memory_table_pos = 0;
10621062
# if !defined(HAS_COMPILER_TLS)
10631063
# if defined(OS_WINDOWS)

0 commit comments

Comments
 (0)