diff --git a/Makefile.power b/Makefile.power index ff7d8edb1..48bcb77f8 100644 --- a/Makefile.power +++ b/Makefile.power @@ -1,7 +1,26 @@ + +ifdef USE_THREAD +ifeq ($(USE_THREAD), 0) +USE_OPENMP = 0 +else +USE_OPENMP = 1 +endif +else +USE_OPENMP = 1 +endif + + + ifeq ($(CORE), POWER8) +ifeq ($(USE_OPENMP), 1) +COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DALLOC_SHM -DUSE_OPENMP -fno-fast-math -fopenmp +FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp +else COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DALLOC_SHM -fno-fast-math FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math endif +endif + FLAMEPATH = $(HOME)/flame/lib diff --git a/Makefile.rule b/Makefile.rule index 4b9d36bf6..2d27237de 100644 --- a/Makefile.rule +++ b/Makefile.rule @@ -52,7 +52,7 @@ VERSION = 0.2.19.dev # USE_THREAD = 0 # If you're going to use this library with OpenMP, please comment it in. -# always use this flag for POWER8 +# This flag is always set for POWER8. Don't modify the flag # USE_OPENMP = 1 # You can define maximum number of threads. Basically it should be diff --git a/benchmark/Makefile b/benchmark/Makefile index 0a1359254..38ccb8f44 100644 --- a/benchmark/Makefile +++ b/benchmark/Makefile @@ -2231,10 +2231,10 @@ zgemm3m.$(SUFFIX) : gemm3m.c $(CC) $(CFLAGS) -c -DCOMPLEX -DDOUBLE -o $(@F) $^ smallscaling: smallscaling.c ../$(LIBNAME) - $(CC) $(CFLAGS) -o $(@F) $^ $(EXTRALIB) -fopenmp -lm + $(CC) $(CFLAGS) -o $(@F) $^ $(EXTRALIB) -fopenmp -lm -lpthread clean :: - @rm -f *.goto *.mkl *.acml *.atlas *.veclib *.essl + @rm -f *.goto *.mkl *.acml *.atlas *.veclib *.essl smallscaling include $(TOPDIR)/Makefile.tail diff --git a/benchmark/smallscaling.c b/benchmark/smallscaling.c index 9068c61b1..c5dcc5881 100644 --- a/benchmark/smallscaling.c +++ b/benchmark/smallscaling.c @@ -5,6 +5,7 @@ #include #include #include +#include #define MIN_SIZE 5 #define MAX_SIZE 60 #define NB_SIZE 10