Commit 83ea4981 authored by Tin Huynh's avatar Tin Huynh Committed by Brad King
Browse files

NVHPC: Add support for NVIDIA HPC SDK compilers based on PGI

Identify the compilers as `NVHPC` to distinguish it from the older PGI
compilers from which they evolved, and from other `NVIDIA` compilers.

Fixes: #20887
parent 9b96fbc3
nvhpc-compiler
--------------
* The NVIDIA HPC SDK compilers are now supported with compiler id ``NVHPC``.
......@@ -26,6 +26,7 @@ include:
IAR = IAR Systems (iar.com)
Intel = Intel Compiler (intel.com)
MSVC = Microsoft Visual Studio (microsoft.com)
NVHPC = NVIDIA HPC SDK Compiler (nvidia.com)
NVIDIA = NVIDIA CUDA Compiler (nvidia.com)
OpenWatcom = Open Watcom (openwatcom.org)
PGI = The Portland Group (pgroup.com)
......
......@@ -61,6 +61,7 @@ function(compiler_id_detection outvar lang)
XLClang
XL
VisualAge
NVHPC
PGI
Cray
TI
......
......@@ -82,6 +82,23 @@
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
# endif
#elif defined(__NVCOMPILER) || defined(__NVCOMPILER_LLVM__)
PRINT *, 'INFO:compiler[NVHPC]'
# if defined(__NVCOMPILER_MAJOR__)
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
# else
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# endif
# if defined(__NVCOMPILER_MINOR__)
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
# else
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# endif
# if defined(__NVCOMPILER_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
# elif defined(__PGIC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(__PGI)
PRINT *, 'INFO:compiler[PGI]'
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
......
include(Compiler/PGI-C)
include(Compiler/NVHPC)
__compiler_nvhpc(C)
include(Compiler/PGI-CXX)
include(Compiler/NVHPC)
__compiler_nvhpc(CXX)
set(_compiler_id_pp_test "defined(__NVCOMPILER)")
set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__NVCOMPILER_MAJOR__)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__NVCOMPILER_MINOR__)
# if defined(__NVCOMPILER_PATCHLEVEL__)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__NVCOMPILER_PATCHLEVEL__)
# endif")
include(Compiler/PGI-Fortran)
include(Compiler/NVHPC)
__compiler_nvhpc(Fortran)
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# This module is shared by multiple languages; use include blocker.
if(__COMPILER_NVHPC)
return()
endif()
set(__COMPILER_NVHPC 1)
include(Compiler/PGI)
macro(__compiler_nvhpc lang)
# Logic specific to NVHPC.
endmacro()
include(Platform/Linux-NVHPC)
__linux_compiler_nvhpc(C)
include(Platform/Linux-NVHPC)
__linux_compiler_nvhpc(CXX)
include(Platform/Linux-NVHPC)
__linux_compiler_nvhpc(Fortran)
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# This module is shared by multiple languages; use include blocker.
if(__LINUX_COMPILER_NVIDIA)
return()
endif()
set(__LINUX_COMPILER_NVIDIA 1)
include(Platform/Linux-PGI)
macro(__linux_compiler_nvhpc lang)
__linux_compiler_pgi(${lang})
endmacro()
Markdown is supported
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