From e8765bbc53bef4fb742e1c6022c2873788d3ccf2 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 23 Nov 2019 15:19:33 -0500 Subject: [PATCH] Minor consistency improvements in tensor.h --- include/deal.II/base/tensor.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 -- 2.39.5