diff --git a/frame/include/bli_kernel_macro_defs.h b/frame/include/bli_kernel_macro_defs.h index c589802b5e..a619151de3 100644 --- a/frame/include/bli_kernel_macro_defs.h +++ b/frame/include/bli_kernel_macro_defs.h @@ -57,6 +57,16 @@ // -- Memory allocation -------------------------------------------------------- +// hbwmalloc.h provides hbw_malloc() and hbw_free() on systems with +// libmemkind. But disable use of libmemkind if BLIS_DISABLE_MEMKIND +// was explicitly defined. +#ifdef BLIS_DISABLE_MEMKIND + #undef BLIS_ENABLE_MEMKIND +#endif +#ifdef BLIS_ENABLE_MEMKIND + #include +#endif + // Memory allocation functions. These macros define the three types of // malloc()-style functions, and their free() counterparts: one for each // type of memory to be allocated. diff --git a/frame/include/bli_system.h b/frame/include/bli_system.h index d41ed96883..19a57cb65f 100644 --- a/frame/include/bli_system.h +++ b/frame/include/bli_system.h @@ -43,7 +43,7 @@ #include #include -// Determine if we are on a 64-bit or 32-bit architecture +// Determine if we are on a 64-bit or 32-bit architecture. #if defined(_M_X64) || defined(__x86_64) || defined(__aarch64__) || \ defined(_ARCH_PPC64) #define BLIS_ARCH_64 @@ -51,7 +51,7 @@ #define BLIS_ARCH_32 #endif -// Determine the target operating system +// Determine the target operating system. #if defined(_WIN32) || defined(__CYGWIN__) #define BLIS_OS_WINDOWS 1 #elif defined(__APPLE__) || defined(__MACH__) @@ -99,15 +99,5 @@ #include #endif -// hbwmalloc.h provides hbw_malloc() and hbw_free() on systems with -// libmemkind. But disable use of libmemkind if BLIS_DISABLE_MEMKIND -// was explicitly defined. -#ifdef BLIS_DISABLE_MEMKIND - #undef BLIS_ENABLE_MEMKIND -#endif -#ifdef BLIS_ENABLE_MEMKIND - #include -#endif - #endif diff --git a/frame/include/blis.h b/frame/include/blis.h index d9ab7756c8..72994d7718 100644 --- a/frame/include/blis.h +++ b/frame/include/blis.h @@ -44,23 +44,19 @@ extern "C" { #endif +// NOTE: PLEASE DON'T CHANGE THE ORDER IN WHICH HEADERS ARE INCLUDED UNLESS +// YOU ARE SURE THAT IT DOESN'T BREAK INTER-HEADER MACRO DEPENDENCIES. -// -- BLIS configuration definition -- +// -- System headers -- +// NOTE: This header must be included before bli_config_macro_defs.h. -// NOTE: We include bli_config.h first because there might be something -// defined there that is needed within one of the system headers. A good -// example: posix_memalign() needs _GNU_SOURCE on GNU systems (I think). -// -// PLEASE DON'T CHANGE THE ORDER IN WHICH HEADERS ARE INCLUDED UNLESS YOU -// KNOW WHAT YOU ARE DOING. +#include "bli_system.h" -#include "bli_config.h" -#include "bli_config_macro_defs.h" +// -- configure definitions -- -// -- System headers -- - -#include "bli_system.h" +#include "bli_config.h" +#include "bli_config_macro_defs.h" // -- Common BLIS definitions --