endif()
if(Kokkos_ENABLE_CUDA)
+ if (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)
+ # We need to disable SIMD vectorization for CUDA device code with nvcc.
+ # 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
+ set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0)
+ 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
* Return a pointer to the underlying array serving as element storage.
* In case the container is empty a nullptr is returned.
*/
- template <typename Dummy = MemorySpaceType>
- DEAL_II_HOST_DEVICE
- std::enable_if_t<std::is_same_v<Dummy, dealii::MemorySpace::Default>,
- value_type *>
- data() const noexcept;
-
- template <typename Dummy = MemorySpaceType>
- std::enable_if_t<std::is_same_v<Dummy, dealii::MemorySpace::Host>,
- value_type *>
+ DEAL_II_HOST_DEVICE value_type *
data() const noexcept;
/**
template <typename ElementType, typename MemorySpaceType>
-template <typename Dummy>
-inline DEAL_II_HOST_DEVICE std::enable_if_t<
- std::is_same_v<Dummy, dealii::MemorySpace::Default>,
- typename ArrayView<ElementType, MemorySpaceType>::value_type *>
-ArrayView<ElementType, MemorySpaceType>::data() const noexcept
-{
- if (n_elements == 0)
- return nullptr;
- else
- return starting_element;
-}
-
-
-
-template <typename ElementType, typename MemorySpaceType>
-template <typename Dummy>
-inline std::enable_if_t<
- std::is_same_v<Dummy, dealii::MemorySpace::Host>,
- typename ArrayView<ElementType, MemorySpaceType>::value_type *>
-ArrayView<ElementType, MemorySpaceType>::data() const noexcept
+inline DEAL_II_HOST_DEVICE
+ typename ArrayView<ElementType, MemorySpaceType>::value_type *
+ ArrayView<ElementType, MemorySpaceType>::data() const noexcept
{
if (n_elements == 0)
return nullptr;