diff options
Diffstat (limited to 'Modules/FindOpenACC.cmake')
-rw-r--r-- | Modules/FindOpenACC.cmake | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Modules/FindOpenACC.cmake b/Modules/FindOpenACC.cmake index ed52e35..cf58f3b 100644 --- a/Modules/FindOpenACC.cmake +++ b/Modules/FindOpenACC.cmake @@ -12,7 +12,17 @@ Detect OpenACC support by the compiler. This module can be used to detect OpenACC support in a compiler. If the compiler supports OpenACC, the flags required to compile with OpenACC support are returned in variables for the different languages. -Currently, only PGI, GNU and Cray compilers are supported. +Currently, only NVHPC, PGI, GNU and Cray compilers are supported. + +Imported Targets +^^^^^^^^^^^^^^^^ + +.. versionadded:: 3.16 + +The module provides :prop_tgt:`IMPORTED` targets: + +``OpenACC::OpenACC_<lang>`` + Target for using OpenACC from ``<lang>``. Variables ^^^^^^^^^ @@ -25,14 +35,11 @@ project, where ``<lang>`` is one of C, CXX, or Fortran: ``OpenACC_<lang>_FLAGS`` OpenACC compiler flags for ``<lang>``, separated by spaces. ``OpenACC_<lang>_OPTIONS`` + .. versionadded:: 3.16 + OpenACC compiler flags for ``<lang>``, as a list. Suitable for usage with target_compile_options or target_link_options. -Additionally, the module provides :prop_tgt:`IMPORTED` targets: - -``OpenACC::OpenACC_<lang>`` - Target for using OpenACC from ``<lang>``. - The module will also try to provide the OpenACC version variables: ``OpenACC_<lang>_SPEC_DATE`` @@ -132,6 +139,7 @@ endfunction() function(_OPENACC_GET_FLAGS_CANDIDATE LANG FLAG_VAR) + set(ACC_FLAG_NVHPC "-acc") set(ACC_FLAG_PGI "-acc") set(ACC_FLAG_GNU "-fopenacc") set(ACC_FLAG_Cray "-h acc") @@ -148,6 +156,7 @@ endfunction() function(_OPENACC_GET_ACCEL_TARGET_FLAG LANG TARGET FLAG_VAR) # Find target accelerator flags. + set(ACC_TARGET_FLAG_NVHPC "-ta") set(ACC_TARGET_FLAG_PGI "-ta") if(DEFINED ACC_TARGET_FLAG_${CMAKE_${LANG}_COMPILER_ID}) set("${FLAG_VAR}" "${ACC_TARGET_FLAG_${CMAKE_${LANG}_COMPILER_ID}}=${TARGET}" PARENT_SCOPE) @@ -157,6 +166,7 @@ endfunction() function(_OPENACC_GET_VERBOSE_FLAG LANG FLAG_VAR) # Find compiler's verbose flag for OpenACC. + set(ACC_VERBOSE_FLAG_NVHPC "-Minfo=accel") set(ACC_VERBOSE_FLAG_PGI "-Minfo=accel") if(DEFINED ACC_VERBOSE_FLAG_${CMAKE_${LANG}_COMPILER_ID}) set("${FLAG_VAR}" "${ACC_VERBOSE_FLAG_${CMAKE_${LANG}_COMPILER_ID}}" PARENT_SCOPE) |