]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix nvcc
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 2 Feb 2023 15:50:39 +0000 (15:50 +0000)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 2 Feb 2023 16:24:11 +0000 (11:24 -0500)
include/deal.II/base/tensor.h

index 0640562ef4f06dda0551ae94e0897a521babfa69..edc17553f042fb7b8c24777abb549bf02bc5dbca 100644 (file)
@@ -1326,9 +1326,11 @@ constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE
 Tensor<rank_, dim, Number>::Tensor(
   const ArrayView<ElementType, MemorySpace> &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];
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.