]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix warnings when using CUDA 10857/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Tue, 25 Aug 2020 14:15:30 +0000 (14:15 +0000)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Tue, 25 Aug 2020 14:15:30 +0000 (14:15 +0000)
include/deal.II/base/tensor.h
include/deal.II/grid/tria_objects.h

index a2059c6016fcb51488f1d668e53161e54ddc7eb3..eb08d927a503f267f3977cb3d314fd3c808af9b2 100644 (file)
@@ -1282,7 +1282,9 @@ constexpr DEAL_II_ALWAYS_INLINE
     DEAL_II_CUDA_HOST_DEV const typename Tensor<rank_, dim, Number>::value_type &
     Tensor<rank_, dim, Number>::operator[](const unsigned int i) const
 {
+#  ifndef DEAL_II_COMPILER_CUDA_AWARE
   AssertIndexRange(i, dim);
+#  endif
 
   return values[i];
 }
@@ -1293,8 +1295,10 @@ DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE const Number &
                                                      Tensor<rank_, dim, Number>::
                                                      operator[](const TableIndices<rank_> &indices) const
 {
+#  ifndef DEAL_II_COMPILER_CUDA_AWARE
   Assert(dim != 0,
          ExcMessage("Cannot access an object of type Tensor<rank_,0,Number>"));
+#  endif
 
   return TensorAccessors::extract<rank_>(*this, indices);
 }
@@ -1305,8 +1309,10 @@ template <int rank_, int dim, typename Number>
 DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number &
   Tensor<rank_, dim, Number>::operator[](const TableIndices<rank_> &indices)
 {
+#  ifndef DEAL_II_COMPILER_CUDA_AWARE
   Assert(dim != 0,
          ExcMessage("Cannot access an object of type Tensor<rank_,0,Number>"));
+#  endif
 
   return TensorAccessors::extract<rank_>(*this, indices);
 }
index 2f009342db558947a4110e951c8d842030234e5d..af9bacb7f0fdbe284922c37b000dfe7e904680e1 100644 (file)
@@ -490,7 +490,7 @@ namespace internal
 
 
     inline TriaObjects::TriaObjects()
-      : structdim(-1)
+      : structdim(static_cast<unsigned int>(-1))
       , next_free_single(numbers::invalid_unsigned_int)
       , next_free_pair(numbers::invalid_unsigned_int)
       , reverse_order_next_free_single(false)

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.