From 6a72a77d332662e058f8a318c8d5aa4af6f1518d Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Mon, 15 Jan 2018 19:23:03 -0500 Subject: [PATCH] Fix warnings: do not use Assert in CUDA kernel --- include/deal.II/base/tensor.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 443f60bbe1..18a7821e46 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -675,7 +675,10 @@ template inline DEAL_II_CUDA_HOST_DEV Tensor<0,dim,Number>::operator Number &() { + // We cannot use Assert inside a CUDA kernel +#ifndef DEAL_II_WITH_CUDA Assert(dim != 0, ExcMessage("Cannot access an object of type Tensor<0,0,Number>")); +#endif return value; } @@ -684,7 +687,10 @@ template inline DEAL_II_CUDA_HOST_DEV Tensor<0,dim,Number>::operator const Number &() const { + // We cannot use Assert inside a CUDA kernel +#ifndef DEAL_II_WITH_CUDA Assert(dim != 0, ExcMessage("Cannot access an object of type Tensor<0,0,Number>")); +#endif return value; } @@ -882,7 +888,10 @@ namespace internal const unsigned int i, std::integral_constant) { + // We cannot use Assert in a CUDA kernel +#ifndef DEAL_II_WITH_CUDA Assert (i) { + // We cannot use Assert in a CUDA kernel +#ifndef DEAL_II_WITH_CUDA Assert(false, ExcMessage("Cannot access elements of an object of type Tensor.")); +#endif static ArrayElementType t; return t; } -- 2.39.5