diff options
author | Tin Huynh <ahuynh@nvidia.com> | 2020-08-26 02:54:13 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-01-27 14:53:02 (GMT) |
commit | 83ea49818f4d7a031d972e26e0cb1d561ed20d76 (patch) | |
tree | 11544d67f57130520afd5d019d71211013a286ec /Modules/Compiler | |
parent | 9b96fbc358aba8110ba09d3ad2262223ec0f0167 (diff) | |
download | CMake-83ea49818f4d7a031d972e26e0cb1d561ed20d76.zip CMake-83ea49818f4d7a031d972e26e0cb1d561ed20d76.tar.gz CMake-83ea49818f4d7a031d972e26e0cb1d561ed20d76.tar.bz2 |
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
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/NVHPC-C.cmake | 3 | ||||
-rw-r--r-- | Modules/Compiler/NVHPC-CXX.cmake | 3 | ||||
-rw-r--r-- | Modules/Compiler/NVHPC-DetermineCompiler.cmake | 9 | ||||
-rw-r--r-- | Modules/Compiler/NVHPC-Fortran.cmake | 3 | ||||
-rw-r--r-- | Modules/Compiler/NVHPC.cmake | 15 |
5 files changed, 33 insertions, 0 deletions
diff --git a/Modules/Compiler/NVHPC-C.cmake b/Modules/Compiler/NVHPC-C.cmake new file mode 100644 index 0000000..d16c72b --- /dev/null +++ b/Modules/Compiler/NVHPC-C.cmake @@ -0,0 +1,3 @@ +include(Compiler/PGI-C) +include(Compiler/NVHPC) +__compiler_nvhpc(C) diff --git a/Modules/Compiler/NVHPC-CXX.cmake b/Modules/Compiler/NVHPC-CXX.cmake new file mode 100644 index 0000000..18ace8b --- /dev/null +++ b/Modules/Compiler/NVHPC-CXX.cmake @@ -0,0 +1,3 @@ +include(Compiler/PGI-CXX) +include(Compiler/NVHPC) +__compiler_nvhpc(CXX) diff --git a/Modules/Compiler/NVHPC-DetermineCompiler.cmake b/Modules/Compiler/NVHPC-DetermineCompiler.cmake new file mode 100644 index 0000000..45b69e1 --- /dev/null +++ b/Modules/Compiler/NVHPC-DetermineCompiler.cmake @@ -0,0 +1,9 @@ + +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") diff --git a/Modules/Compiler/NVHPC-Fortran.cmake b/Modules/Compiler/NVHPC-Fortran.cmake new file mode 100644 index 0000000..59755b3 --- /dev/null +++ b/Modules/Compiler/NVHPC-Fortran.cmake @@ -0,0 +1,3 @@ +include(Compiler/PGI-Fortran) +include(Compiler/NVHPC) +__compiler_nvhpc(Fortran) diff --git a/Modules/Compiler/NVHPC.cmake b/Modules/Compiler/NVHPC.cmake new file mode 100644 index 0000000..7048670 --- /dev/null +++ b/Modules/Compiler/NVHPC.cmake @@ -0,0 +1,15 @@ +# 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() |