Skip to content

Commit

Permalink
Add XL compiler support to OpenMP and RAJA makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdeakin committed Feb 24, 2017
1 parent dfe5503 commit 050a27c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 4 additions & 1 deletion OpenMP.make
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ifndef COMPILER
define compiler_help
Set COMPILER to change flags (defaulting to GNU).
Available compilers are:
CLANG CRAY GNU INTEL
CLANG CRAY GNU INTEL XL

endef
$(info $(compiler_help))
Expand All @@ -25,19 +25,22 @@ COMPILER_GNU = g++
COMPILER_INTEL = icpc
COMPILER_CRAY = CC
COMPILER_CLANG = clang++
COMPILER_XL = xlc++
CXX = $(COMPILER_$(COMPILER))

FLAGS_GNU = -O3 -std=c++11
FLAGS_INTEL = -O3 -std=c++11 -xHOST
FLAGS_CRAY = -O3 -hstd=c++11
FLAGS_CLANG = -O3 -std=c++11
FLAGS_XL = -O5 -qarch=pwr8 -qtune=pwr8 -std=c++11
CXXFLAGS = $(FLAGS_$(COMPILER))

# OpenMP flags for CPUs
OMP_GNU_CPU = -fopenmp
OMP_INTEL_CPU = -qopenmp
OMP_CRAY_CPU = -homp
OMP_CLANG_CPU = -fopenmp=libomp
OMP_XL_CPU = -qsmp=omp -qthreaded

# OpenMP flags for NVIDIA
OMP_CRAY_NVIDIA = -DOMP_TARGET_GPU
Expand Down
13 changes: 8 additions & 5 deletions RAJA.make
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,28 @@ endif

ifeq ($(TARGET), CPU)
COMP=$(CXX)
CXXFLAGS = -O3 -std=c++11 -DRAJA_TARGET_CPU
CXXFLAGS = -DRAJA_TARGET_CPU

ifndef COMPILER
define compiler_help
Set COMPILER to ensure correct OpenMP flags are set.
Available compilers are:
INTEL GNU CRAY
INTEL GNU CRAY XL
endef
$(info $(compiler_help))
endif
ifeq ($(COMPILER), INTEL)
COMP = icpc
CXXFLAGS += -qopenmp
CXXFLAGS += -O3 -std=c++11 -qopenmp
else ifeq ($(COMPILER), GNU)
COMP = g++
CXXFLAGS += -fopenmp
CXXFLAGS += -O3 -std=c++11 -fopenmp
else ifeq ($(COMPILER), CRAY)
COMP = CC
CXXFLAGS +=
CXXFLAGS += -O3 -hstd=c++11
else ifeq ($(COMPILER), XL)
COMP = xlc++
CXXFLAGS += -O5 -std=c++11 -qarch=pwr8 -qtune=pwr8 -qsmp=omp -qthreaded
endif

else ifeq ($(TARGET), GPU)
Expand Down

0 comments on commit 050a27c

Please sign in to comment.