From 1fcd062d6c0319e1730f5d3b4e5b644349e1bd7d Mon Sep 17 00:00:00 2001 From: Tom Lin Date: Tue, 14 Jul 2020 13:56:55 +0100 Subject: [PATCH 1/2] Add Cray, PGI, Armclang support for Kokkos/OpenMP Fixed GCC's missing openmp flag in Kokkos --- Kokkos.make | 13 ++++++++++++- OpenMP.make | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Kokkos.make b/Kokkos.make index a09f762..e46236e 100644 --- a/Kokkos.make +++ b/Kokkos.make @@ -36,15 +36,18 @@ ifndef COMPILER define compiler_help Set COMPILER to change flags (defaulting to GNU). Available compilers are: - GNU INTEL + GNU INTEL CRAY PGI ARMCLANG endef $(info $(compiler_help)) COMPILER=GNU endif +COMPILER_ARMCLANG = armclang++ COMPILER_GNU = g++ COMPILER_INTEL = icpc -qopt-streaming-stores=always +COMPILER_CRAY = CC +COMPILER_PGI = pgc++ CXX = $(COMPILER_$(COMPILER)) ifndef TARGET @@ -67,6 +70,14 @@ CXXFLAGS = -O3 LINKFLAGS = # empty for now + +ifeq ($(COMPILER), GNU) +ifeq ($(DEVICE), OpenMP) +CXXFLAGS += -fopenmp +LINKFLAGS += -fopenmp +endif +endif + include $(KOKKOS_PATH)/Makefile.kokkos kokkos-stream: $(OBJ) $(KOKKOS_LINK_DEPENDS) diff --git a/OpenMP.make b/OpenMP.make index d9e331a..5ead9ce 100644 --- a/OpenMP.make +++ b/OpenMP.make @@ -3,7 +3,7 @@ ifndef COMPILER define compiler_help Set COMPILER to change flags (defaulting to GNU). Available compilers are: - CLANG CRAY GNU INTEL XL PGI NEC + CLANG CRAY GNU INTEL XL PGI NEC ARMCLANG endef $(info $(compiler_help)) @@ -21,6 +21,7 @@ $(info $(target_help)) TARGET=CPU endif +COMPILER_ARMCLANG = armclang++ COMPILER_GNU = g++ COMPILER_INTEL = icpc COMPILER_CRAY = CC From a22bb925163e82b897cc2aed9a0e52ef2ff37783 Mon Sep 17 00:00:00 2001 From: Tom Lin Date: Tue, 14 Jul 2020 13:57:40 +0100 Subject: [PATCH 2/2] Add armclang-cpu flags for OpenMP --- OpenMP.make | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenMP.make b/OpenMP.make index 5ead9ce..b4c4b3a 100644 --- a/OpenMP.make +++ b/OpenMP.make @@ -41,6 +41,7 @@ FLAGS_NEC = -O4 -finline -std=c++11 CXXFLAGS = $(FLAGS_$(COMPILER)) # OpenMP flags for CPUs +OMP_ARMCLANG_CPU = -fopenmp OMP_GNU_CPU = -fopenmp OMP_INTEL_CPU = -qopenmp OMP_CRAY_CPU = -fopenmp