From: Daniel Arndt Date: Sat, 23 Nov 2019 20:19:33 +0000 (-0500) Subject: Minor consistency improvements in tensor.h X-Git-Tag: v9.2.0-rc1~853^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8765bbc53bef4fb742e1c6022c2873788d3ccf2;p=dealii.git Minor consistency improvements in tensor.h --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 1a2c710c30..ea4917676c 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1142,15 +1142,19 @@ namespace internal Type Uninitialized::value; template - DEAL_II_CONSTEXPR inline ArrayElementType & - subscript(ArrayElementType *, - const unsigned int, - std::integral_constant) + DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE + DEAL_II_CUDA_HOST_DEV ArrayElementType & + subscript(ArrayElementType *, + const unsigned int, + std::integral_constant) { + // We cannot use Assert in a CUDA kernel +#ifndef __CUDA_ARCH__ Assert( false, ExcMessage( "Cannot access elements of an object of type Tensor.")); +#endif return Uninitialized::value; } } // namespace TensorSubscriptor @@ -1158,7 +1162,7 @@ namespace internal template -DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV // +DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV typename Tensor::value_type &Tensor:: operator[](const unsigned int i) { @@ -1375,7 +1379,7 @@ namespace internal std::is_same::value, int>::type = 0> DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE void - division_operator(dealii::Tensor (&t)[dim], + division_operator(Tensor (&t)[dim], const OtherNumber &factor) { // recurse over the base objects