Mirror Fujitsu flags for CMake
This commit is contained in:
parent
fa6433bab1
commit
cd367c7da3
28
OMP.cmake
28
OMP.cmake
@ -30,6 +30,9 @@
|
||||
# ARMClang = ARM Compiler based on Clang (arm.com)
|
||||
# These are only added in CMake 3.20:
|
||||
# NVHPC = NVIDIA HPC SDK Compiler (nvidia.com)
|
||||
# These are only added in CMake 3.21
|
||||
# Fujitsu = Fujitsu HPC compiler (Trad mode)
|
||||
# FujitsuClang = Fujitsu HPC compiler (Clang mode)
|
||||
|
||||
|
||||
# CMAKE_SYSTEM_PROCESSOR is set via `uname -p`, we have:
|
||||
@ -39,8 +42,9 @@
|
||||
#
|
||||
|
||||
|
||||
#predefined offload flags based on compiler id
|
||||
|
||||
# predefined offload flags based on compiler id and vendor,
|
||||
# the format is (COMPILER and VENDOR must be UPPERCASE):
|
||||
# Compiler: OMP_FLAGS_OFFLOAD_<COMPILER?>_<VNEDOR?>
|
||||
|
||||
set(OMP_FLAGS_OFFLOAD_INTEL
|
||||
-qnextgen -fiopenmp -fopenmp-targets=spir64)
|
||||
@ -56,15 +60,25 @@ set(OMP_FLAGS_OFFLOAD_CLANG_ARCH_FLAG
|
||||
-march=) # prefix only, arch appended by the vendor:arch tuple
|
||||
|
||||
|
||||
# for standard (non-offload) omp, the format is (COMPILER and ARCH must be UPPERCASE):
|
||||
# Compiler: OMP_FLAGS_CPU_<COMPILER?>_<ARCH?>
|
||||
# Linker: OMP_LINK_FLAGS_CPU_<COMPILER?>_<ARCH?>
|
||||
|
||||
set(OMP_FLAGS_CPU_FUJITSU
|
||||
-Kfast -std=c++11 -KA64FX -KSVE -KARMV8_3_A -Kzfill=100 -Kprefetch_sequential=soft -Kprefetch_line=8 -Kprefetch_line_L2=16)
|
||||
set(OMP_LINK_FLAGS_CPU_FUJITSU
|
||||
-Kopenmp)
|
||||
|
||||
set(OMP_FLAGS_CPU_INTEL
|
||||
-qopt-streaming-stores=always)
|
||||
|
||||
set(OMP_FLAGS_CPU_GNU_PPC64LE
|
||||
-mcpu=native)
|
||||
|
||||
set(OMP_FLAGS_CPU_XL
|
||||
-O5 -qarch=auto -qtune=auto)
|
||||
|
||||
# NEC
|
||||
set(OMP_FLAGS_CPU_NEC -O4 -finline)
|
||||
set(OMP_FLAGS_CPU_NEC -O4 -finline) # CMake doesn't detect this so it's meant to be chosen by register_flag_optional(ARCH)
|
||||
|
||||
register_flag_optional(CMAKE_CXX_COMPILER
|
||||
"Any CXX compiler that supports OpenMP as per CMake detection (and offloading if enabled with `OFFLOAD`)"
|
||||
@ -122,6 +136,12 @@ macro(setup)
|
||||
${ARCH}
|
||||
)
|
||||
|
||||
register_append_compiler_and_arch_specific_link_flags(
|
||||
OMP_LINK_FLAGS_CPU
|
||||
${COMPILER}
|
||||
${ARCH}
|
||||
)
|
||||
|
||||
elseif ("${OFFLOAD}" STREQUAL ON)
|
||||
# offload but with custom flags
|
||||
register_definitions(OMP_TARGET_GPU)
|
||||
|
||||
@ -20,7 +20,9 @@
|
||||
#
|
||||
|
||||
macro(wipe_gcc_style_optimisation_flags VAR)
|
||||
if(${VAR})
|
||||
string(REGEX REPLACE "([\\/\\-]O.)" "" ${VAR} ${${VAR}})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(register_link_library)
|
||||
@ -41,7 +43,7 @@ macro(register_append_link_flags)
|
||||
list(APPEND LINK_FLAGS ${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(register_append_compiler_and_arch_specific_cxx_flags PREFIX CXX ARCH)
|
||||
function(bind_cxx_and_arch OUT PREFIX CXX ARCH)
|
||||
string(TOUPPER ${CXX} _CXX)
|
||||
string(TOUPPER ${ARCH} _ARCH)
|
||||
set(_CXX_ARCH_SPECIFIC_FLAGS "${${PREFIX}_${_CXX}_${_ARCH}}")
|
||||
@ -52,6 +54,17 @@ macro(register_append_compiler_and_arch_specific_cxx_flags PREFIX CXX ARCH)
|
||||
if (_CXX_ARCH_SPECIFIC_FLAGS)
|
||||
register_append_cxx_flags(ANY ${_CXX_ARCH_SPECIFIC_FLAGS})
|
||||
endif ()
|
||||
set(${OUT} "${_CXX_ARCH_SPECIFIC_FLAGS}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
macro(register_append_compiler_and_arch_specific_cxx_flags PREFIX CXX ARCH)
|
||||
bind_cxx_and_arch(OUT ${PREFIX} ${CXX} ${ARCH})
|
||||
register_append_cxx_flags(ANY ${OUT})
|
||||
endmacro()
|
||||
|
||||
macro(register_append_compiler_and_arch_specific_link_flags PREFIX CXX ARCH)
|
||||
bind_cxx_and_arch(OUT ${PREFIX} ${CXX} ${ARCH})
|
||||
register_append_link_flags(${OUT})
|
||||
endmacro()
|
||||
|
||||
macro(register_definitions)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user