From: Bruno Turcksin Date: Tue, 16 Jan 2018 00:23:03 +0000 (-0500) Subject: Fix warnings: do not use Assert in CUDA kernel X-Git-Tag: v9.0.0-rc1~560^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a72a77d332662e058f8a318c8d5aa4af6f1518d;p=dealii.git Fix warnings: do not use Assert in CUDA kernel --- 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; }