set(KOKKOS_FOUND ${Kokkos_FOUND})
- if(Kokkos_FOUND)
+ set(_target Kokkos::kokkos)
+ process_feature(KOKKOS
+ TARGETS REQUIRED _target
+ )
+endif()
+
+
+if(Kokkos_FOUND)
+ if(Kokkos_ENABLE_CUDA)
# We need to disable SIMD vectorization for CUDA device code.
# Otherwise, nvcc compilers from version 9 on will emit an error message like:
# "[...] contains a vector, which is not supported in device code". We
# would like to set the variable in check_01_cpu_feature but at that point
# we don't know if CUDA support is enabled in Kokkos
- if(Kokkos_ENABLE_CUDA)
- set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0)
- # Require lambda support and expt-relaxed-constexpr for Cuda
- # so that we can use std::array and other interfaces with
- # __host__ constexpr functions in device code
- KOKKOS_CHECK(OPTIONS CUDA_LAMBDA CUDA_CONSTEXPR)
+ set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0)
- # Disable a bunch of annoying warnings generated by boost, template code,
- # and in other random places:
- #
- # integer conversion resulted in a change of sign:
- enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=68")
- # variable "i" was set but never used:
- enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=550")
- # loop is not reachable:
- enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=128")
- # warning #186-D: pointless comparison of unsigned integer with zero
- enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=186")
- # warning #177-D: variable "n_max_face_orientations" was declared but never referenced
- enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=177")
- # warning #284-D: NULL reference is not allowed
- enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=284")
- endif()
- endif()
+ # Require lambda support and expt-relaxed-constexpr for Cuda
+ # so that we can use std::array and other interfaces with
+ # __host__ constexpr functions in device code
+ KOKKOS_CHECK(OPTIONS CUDA_LAMBDA CUDA_CONSTEXPR)
- set(_target Kokkos::kokkos)
- process_feature(KOKKOS
- TARGETS REQUIRED _target
- )
+ # Disable a bunch of annoying warnings generated by boost, template code,
+ # and in other random places:
+ #
+ # integer conversion resulted in a change of sign:
+ enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=68")
+ # variable "i" was set but never used:
+ enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=550")
+ # loop is not reachable:
+ enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=128")
+ # warning #186-D: pointless comparison of unsigned integer with zero
+ enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=186")
+ # warning #177-D: variable "n_max_face_orientations" was declared but never referenced
+ enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=177")
+ # warning #284-D: NULL reference is not allowed
+ enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=284")
+ endif()
endif()