Skip to content
Snippets Groups Projects
Commit b4c5b75f authored by Benjamin Cumming's avatar Benjamin Cumming
Browse files

use KNL-specific compiler flags for KNL target

added flags for GNU and Intel compilers to the cmake build rules
that generate KNL-specific instructions when the TARGET_KNL cmake
flag is set.
parent ec4229a3
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,12 @@ if(SYSTEM_CRAY)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -dynamic")
endif()
# Cray systems
set(TARGET_KNL OFF CACHE BOOL "target Intel KNL architecture")
if(TARGET_KNL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXXOPT_KNL}")
endif()
# targets for extermal dependencies
include(ExternalProject)
externalproject_add(modparser
......
......@@ -13,10 +13,21 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
set(CXXOPT_WALL "${CXXOPT_WALL} -Wno-missing-braces")
endif()
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
# compiler flags for generating KNL-specific AVX512 instructions
# supported in gcc 4.9.x and later
#set(CXXOPT_KNL "-mavx512f")
set(CXXOPT_KNL "-march=knl")
endif()
if(${CMAKE_CXX_COMPILER_ID} MATCHES "Intel")
# Disable warning for unused template parameter
# this is raised by a templated function in the json library
set(CXXOPT_WALL "${CXXOPT_WALL} -wd488")
# compiler flags for generating KNL-specific AVX512 instructions
set(CXXOPT_KNL "-xMIC-AVX512")
endif()
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment