From: Bruno Turcksin Date: Tue, 25 Aug 2020 14:15:30 +0000 (+0000) Subject: Fix warnings when using CUDA X-Git-Tag: v9.3.0-rc1~1163^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a8062b1c93f47a58702c7d0d4c3a2d0ecb83f6a;p=dealii.git Fix warnings when using CUDA --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index a2059c6016..eb08d927a5 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1282,7 +1282,9 @@ constexpr DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV const typename Tensor::value_type & Tensor::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:: operator[](const TableIndices &indices) const { +# ifndef DEAL_II_COMPILER_CUDA_AWARE Assert(dim != 0, ExcMessage("Cannot access an object of type Tensor")); +# endif return TensorAccessors::extract(*this, indices); } @@ -1305,8 +1309,10 @@ template DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number & Tensor::operator[](const TableIndices &indices) { +# ifndef DEAL_II_COMPILER_CUDA_AWARE Assert(dim != 0, ExcMessage("Cannot access an object of type Tensor")); +# endif return TensorAccessors::extract(*this, indices); } diff --git a/include/deal.II/grid/tria_objects.h b/include/deal.II/grid/tria_objects.h index 2f009342db..af9bacb7f0 100644 --- a/include/deal.II/grid/tria_objects.h +++ b/include/deal.II/grid/tria_objects.h @@ -490,7 +490,7 @@ namespace internal inline TriaObjects::TriaObjects() - : structdim(-1) + : structdim(static_cast(-1)) , next_free_single(numbers::invalid_unsigned_int) , next_free_pair(numbers::invalid_unsigned_int) , reverse_order_next_free_single(false)