From: Bruno Turcksin Date: Mon, 9 Jul 2018 19:04:43 +0000 (+0000) Subject: Static variable cannot be allocated inside a __device__ function X-Git-Tag: v9.1.0-rc1~932^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6905%2Fhead;p=dealii.git Static variable cannot be allocated inside a __device__ function Fix the following error: dynamic initialization is not supported for function-scope static variables within a __device__/__global__ function --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 88919243c8..558e4ae884 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1079,18 +1079,15 @@ namespace internal template - DEAL_II_CUDA_HOST_DEV ArrayElementType & - subscript(ArrayElementType *, - const unsigned int, - std::integral_constant) + ArrayElementType & + subscript(ArrayElementType *, + const unsigned int, + std::integral_constant) { - // We cannot use Assert in a CUDA kernel -#ifndef __CUDA_ARCH__ Assert( false, ExcMessage( "Cannot access elements of an object of type Tensor.")); -#endif static ArrayElementType t; return t; }