set(NEONFLAG "/arch:VFPv4")
endif()
endif()
-elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
# Enable warnings in GCC and Clang
set(WARNFLAGS -Wall)
set(WARNFLAGS_MAINTAINER -Wextra)
message(STATUS "ARM floating point arch not auto-detected")
endif()
endif()
+ elseif(BASEARCH_X86_FOUND AND CMAKE_C_COMPILER_ID MATCHES "NVHPC")
+ # nVidia compiler defaults to native build, so set target to any x86-64 processor
+ add_compile_options(-tp px)
endif()
# Disable LTO unless Native Instructions are enabled
if(FNO_LTO_AVAILABLE)
endif()
# Fall through
endif()
+ if(CMAKE_C_COMPILER_ID MATCHES "NVHPC")
+ check_c_compiler_flag("-tp native" HAVE_TP_NATIVE)
+ if(HAVE_TP_NATIVE)
+ set(NATIVEFLAG "-tp native")
+ endif()
+ endif()
endif()
if(NATIVEFLAG)
# Apply flags to all source files and compilation checks
else()
set(AVX512FLAG "/arch:AVX512")
endif()
- elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
# For CPUs that can benefit from AVX512, it seems GCC generates suboptimal
# instruction scheduling unless you specify a reasonable -mtune= target
set(AVX512FLAG "-mavx512f -mavx512dq -mavx512bw -mavx512vl -mbmi2")
else()
set(AVX512VNNIFLAG "/arch:AVX512")
endif()
- elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
set(AVX512VNNIFLAG "-mavx512f -mavx512dq -mavx512bw -mavx512vl -mavx512vnni -mbmi2")
if(NOT MSVC)
check_c_compiler_flag("-mtune=cascadelake" HAVE_CASCADE_LAKE)
else()
set(AVX2FLAG "/arch:AVX2")
endif()
- elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
set(AVX2FLAG "-mavx2 -mbmi2")
elseif(MSVC)
set(AVX2FLAG "/arch:AVX2")
macro(check_pclmulqdq_intrinsics)
if(NOT NATIVEFLAG)
- if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "IntelLLVM")
+ if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "IntelLLVM" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
set(PCLMULFLAG "-mpclmul")
endif()
endif()
macro(check_vpclmulqdq_intrinsics)
if(NOT NATIVEFLAG)
- if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "IntelLLVM")
+ if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "IntelLLVM" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
set(VPCLMULFLAG "-mvpclmulqdq -mavx512f")
endif()
endif()
if(NOT "${ARCH}" MATCHES "x86_64")
set(SSE2FLAG "/arch:SSE2")
endif()
- elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
set(SSE2FLAG "-msse2")
endif()
endif()
else()
set(SSSE3FLAG "/arch:SSSE3")
endif()
- elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
set(SSSE3FLAG "-mssse3")
endif()
endif()
else()
set(SSE41FLAG "/arch:SSE4.1")
endif()
- elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
set(SSE41FLAG "-msse4.1")
endif()
endif()
else()
set(SSE42FLAG "/arch:SSE4.2")
endif()
- elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
set(SSE42FLAG "-msse4.2")
endif()
endif()