From a61c2e4a6ca7e7a5b1d07c425ff2248c0f766093 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Mon, 9 Jul 2018 19:04:43 +0000 Subject: [PATCH] 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 --- include/deal.II/base/tensor.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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; } -- 2.39.5