From 9700f0e5785007ddafb72a5ca83800dee61fd35c Mon Sep 17 00:00:00 2001 From: Jeff Hammond Date: Tue, 2 May 2017 19:25:21 -0700 Subject: [PATCH] allow KNL build without hbwmalloc.h (i.e. emulated) we want to be able to run BLIS KNL binaries on non-KNL machines via SDE. although it is possible to install hbwmalloc implementation on such systems, it is easier not to, since obviously the performance of SDE execution is not representative so there is no reason to emulate HBW allocation. --- config/knl/bli_kernel.h | 11 +++++++++++ config/knl/make_defs.mk | 13 +++++++++++-- configure | 3 +++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/config/knl/bli_kernel.h b/config/knl/bli_kernel.h index e32954973..46b1cb4f4 100644 --- a/config/knl/bli_kernel.h +++ b/config/knl/bli_kernel.h @@ -43,11 +43,22 @@ #define BLIS_SIMD_SIZE 64 #define BLIS_SIMD_NUM_REGISTERS 32 +#ifdef BLIS_NO_HBWMALLOC + +#include + +#define BLIS_MALLOC_POOL malloc +#define BLIS_FREE_POOL free + +#else + #include #define BLIS_MALLOC_POOL hbw_malloc #define BLIS_FREE_POOL hbw_free +#endif + //#define BLIS_MALLOC_INTL hbw_malloc //#define BLIS_FREE_INTL hbw_free diff --git a/config/knl/make_defs.mk b/config/knl/make_defs.mk index 6a750223d..449aeb0bb 100644 --- a/config/knl/make_defs.mk +++ b/config/knl/make_defs.mk @@ -65,6 +65,10 @@ else COPTFLAGS := -O3 endif +ifeq ($(DEBUG_TYPE),sde) +CPPROCFLAGS += -DBLIS_NO_HBWMALLOC +endif + CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) @@ -95,12 +99,17 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared -ifeq ($(CC_VENDOR),icc) + +ifneq ($(DEBUG_TYPE),sde) LDFLAGS := -lmemkind else -LDFLAGS := -lmemkind -lm +LDFLAGS := endif +ifneq ($(CC_VENDOR),icc) +LDFLAGS += -lm +endif + # end of ifndef MAKE_DEFS_MK_INCLUDED conditional block diff --git a/configure b/configure index 2358575f6..de7d1e96e 100755 --- a/configure +++ b/configure @@ -458,6 +458,9 @@ main() if [ -n "${debug_flag}" ]; then if [ "x${debug_type}" = "xopt" ]; then echo "${script_name}: enabling debug symbols with optimizations." + elif [ "x${debug_type}" = "xsde" ]; then + debug_type='sde' + echo "${script_name}: enabling SDE processor emulation." else debug_type='noopt' echo "${script_name}: enabling debug symbols; optimizations disabled."