]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Minor consistency improvements in tensor.h 9086/head
authorDaniel Arndt <arndtd@ornl.gov>
Sat, 23 Nov 2019 20:19:33 +0000 (15:19 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Sat, 23 Nov 2019 20:23:03 +0000 (15:23 -0500)
include/deal.II/base/tensor.h

index 1a2c710c30a9c52fe378067e5ec7b2a26097bdf8..ea4917676cb787aab6a2aca09f1fa8eaefe9af37 100644 (file)
@@ -1142,15 +1142,19 @@ namespace internal
     Type Uninitialized<Type>::value;
 
     template <typename ArrayElementType>
-    DEAL_II_CONSTEXPR inline ArrayElementType &
-    subscript(ArrayElementType *,
-              const unsigned int,
-              std::integral_constant<int, 0>)
+    DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+      DEAL_II_CUDA_HOST_DEV ArrayElementType &
+                            subscript(ArrayElementType *,
+                                      const unsigned int,
+                                      std::integral_constant<int, 0>)
     {
+      // We cannot use Assert in a CUDA kernel
+#ifndef __CUDA_ARCH__
       Assert(
         false,
         ExcMessage(
           "Cannot access elements of an object of type Tensor<rank,0,Number>."));
+#endif
       return Uninitialized<ArrayElementType>::value;
     }
   } // namespace TensorSubscriptor
@@ -1158,7 +1162,7 @@ namespace internal
 
 
 template <int rank_, int dim, typename Number>
-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<rank_, dim, Number>::value_type &Tensor<rank_, dim, Number>::
                                                    operator[](const unsigned int i)
 {
@@ -1375,7 +1379,7 @@ namespace internal
                   std::is_same<Number, Differentiation::SD::Expression>::value,
                 int>::type = 0>
     DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE void
-                      division_operator(dealii::Tensor<rank, dim, Number> (&t)[dim],
+                      division_operator(Tensor<rank, dim, Number> (&t)[dim],
                                         const OtherNumber &factor)
     {
       // recurse over the base objects

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.