From: Daniel Arndt Date: Thu, 2 Feb 2023 15:50:39 +0000 (+0000) Subject: Fix nvcc X-Git-Tag: v9.5.0-rc1~584^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4567b5ba7e9c6c483779dcc77e812fd06af55fa5;p=dealii.git Fix nvcc --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 0640562ef4..edc17553f0 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1326,9 +1326,11 @@ constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE Tensor::Tensor( const ArrayView &initializer) { - AssertDimension(initializer.size(), n_independent_components); + // make nvcc happy + const int my_n_independent_components = n_independent_components; + AssertDimension(initializer.size(), my_n_independent_components); - for (unsigned int i = 0; i < n_independent_components; ++i) + for (unsigned int i = 0; i < my_n_independent_components; ++i) (*this)[unrolled_to_component_indices(i)] = initializer[i]; }