FindOpenMP: Add support for CUDA when compiling with Clang

This commit is contained in:
Brad King 2024-10-07 11:58:57 -04:00
parent cfa888a6e2
commit a4b60d948d
4 changed files with 7 additions and 8 deletions

View File

@ -1,4 +1,6 @@
set(CMake_TEST_CUDA "Clang" CACHE STRING "")
set(CMake_TEST_CUDA_STANDARDS "03;11;14;17;20;23" CACHE STRING "")
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_CUDA "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")

View File

@ -1,5 +1,4 @@
FindOpenMP-CUDA
---------------
* The :module:`FindOpenMP` module gained support for ``CUDA`` when using
a CUDA compiler that supports OpenMP on the host.
* The :module:`FindOpenMP` module gained support for the ``CUDA`` language.

View File

@ -183,12 +183,10 @@ set(OpenMP_C_CXX_TEST_SOURCE
int main(void) {
#ifdef _OPENMP
omp_get_max_threads();
return 0;
#elif defined(__HIP_DEVICE_COMPILE__)
return 0;
#else
breaks_on_purpose
#elif !defined(__CUDA_ARCH__) && !defined(__HIP_DEVICE_COMPILE__)
# error \"_OPENMP not defined!\"
#endif
return 0;
}
")

View File

@ -3,7 +3,7 @@ int main(void)
{
#ifdef _OPENMP
omp_get_num_threads();
#else
#elif !defined(__CUDA_ARCH__) && !defined(__HIP_DEVICE_COMPILE__)
# error "_OPENMP not defined!"
#endif
return 0;