Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.system
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ CCOMMON_OPT += -DFUNCTION_PROFILE
endif

ifdef HUGETLB_ALLOCATION
CCOMMON_OPT += -DALLOC_HUGETLB
CCOMMON_OPT += -DALLOC_HUGETLB -DALLOC_SHM
endif

ifdef HUGETLBFILE_ALLOCATION
Expand Down
2 changes: 1 addition & 1 deletion cmake/system.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ if (FUNCTION_PROFILE)
endif ()

if (HUGETLB_ALLOCATION)
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_HUGETLB")
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_HUGETLB -DALLOC_SHM")
endif ()

if (DEFINED HUGETLBFILE_ALLOCATION)
Expand Down
20 changes: 10 additions & 10 deletions driver/others/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ static void *alloc_shm(void *address){
return map_address;
}

#if defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS
#if (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS)

static void alloc_hugetlb_free(struct alloc_t *alloc_info){

Expand Down Expand Up @@ -1166,12 +1166,12 @@ void *blas_memory_alloc(int procpos){
alloc_devicedirver,
#endif
/* Hugetlb implicitly assumes ALLOC_SHM */
#if ((defined ALLOC_SHM) && (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
alloc_hugetlb,
#endif
#ifdef ALLOC_SHM
alloc_shm,
#endif
#if ((defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
alloc_hugetlb,
#endif
#ifdef ALLOC_MMAP
alloc_mmap,
#endif
Expand Down Expand Up @@ -2534,7 +2534,7 @@ static void *alloc_shm(void *address){
return map_address;
}

#if defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS
#if (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS)

static void alloc_hugetlb_free(struct release_t *release){

Expand Down Expand Up @@ -2763,12 +2763,12 @@ void *blas_memory_alloc(int procpos){
alloc_devicedirver,
#endif
/* Hugetlb implicitly assumes ALLOC_SHM */
#if ((defined ALLOC_SHM) && (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
alloc_hugetlb,
#endif
#ifdef ALLOC_SHM
alloc_shm,
#endif
#if ((defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
alloc_hugetlb,
#endif
#ifdef ALLOC_MMAP
alloc_mmap,
#endif
Expand Down Expand Up @@ -2945,7 +2945,7 @@ void *blas_memory_alloc(int procpos){
}
#endif

#if (defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS)
#if ((defined ALLOC_SHM) && (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
if ((*func == alloc_hugetlb) && (map_address != (void *)-1)) hugetlb_allocated = 1;
#endif

Expand Down Expand Up @@ -3061,7 +3061,7 @@ void *blas_memory_alloc(int procpos){
}
#endif

#if (defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS)
#if ((defined ALLOC_SHM) && (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
if ((*func == alloc_hugetlb) && (map_address != (void *)-1)) hugetlb_allocated = 1;
#endif

Expand Down