Merge pull request #728 from jeromerobert/fix-no-stack-alloc
Fix make MAX_STACK_ALLOC=0
This commit is contained in:
commit
7d144aaabc
|
@ -163,10 +163,11 @@ COMMON_PROF = -pg
|
||||||
# Build Debug version
|
# Build Debug version
|
||||||
# DEBUG = 1
|
# DEBUG = 1
|
||||||
|
|
||||||
# Improve GEMV and GER for small matrices by stack allocation.
|
# Set maximum stack allocation.
|
||||||
# For details, https://github.com/xianyi/OpenBLAS/pull/482
|
# The default value is 2048. 0 disable stack allocation a may reduce GER and GEMV
|
||||||
|
# performance. For details, https://github.com/xianyi/OpenBLAS/pull/482
|
||||||
#
|
#
|
||||||
MAX_STACK_ALLOC=2048
|
# MAX_STACK_ALLOC = 0
|
||||||
|
|
||||||
# Add a prefix or suffix to all exported symbol names in the shared library.
|
# Add a prefix or suffix to all exported symbol names in the shared library.
|
||||||
# Avoid conflicts with other BLAS libraries, especially when using
|
# Avoid conflicts with other BLAS libraries, especially when using
|
||||||
|
|
|
@ -328,7 +328,8 @@ ifdef SANITY_CHECK
|
||||||
CCOMMON_OPT += -DSANITY_CHECK -DREFNAME=$(*F)f$(BU)
|
CCOMMON_OPT += -DSANITY_CHECK -DREFNAME=$(*F)f$(BU)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef MAX_STACK_ALLOC
|
MAX_STACK_ALLOC ?= 2048
|
||||||
|
ifneq ($(MAX_STACK_ALLOC), 0)
|
||||||
CCOMMON_OPT += -DMAX_STACK_ALLOC=$(MAX_STACK_ALLOC)
|
CCOMMON_OPT += -DMAX_STACK_ALLOC=$(MAX_STACK_ALLOC)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -270,10 +270,11 @@ void CNAME(enum CBLAS_ORDER order,
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// stack overflow check
|
|
||||||
assert(stack_check==3.14159265358979323846);
|
|
||||||
|
|
||||||
#ifdef MAX_STACK_ALLOC
|
#ifdef MAX_STACK_ALLOC
|
||||||
|
// stack overflow check
|
||||||
|
assert(stack_check==3.14159265358979323846);
|
||||||
|
|
||||||
if(!stack_alloc_size){
|
if(!stack_alloc_size){
|
||||||
blas_memory_free(buffer);
|
blas_memory_free(buffer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue