]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make the stack size selection a single parameter 4130/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 28 Mar 2017 14:08:07 +0000 (16:08 +0200)
committerTimo Heister <timo.heister@gmail.com>
Tue, 28 Mar 2017 16:50:39 +0000 (12:50 -0400)
include/deal.II/matrix_free/evaluation_kernels.h

index 62695fea38fe8ecff0cb4ddbe25ff1a8294d1047..ccfe5bbc4c6ebe4837e8668cefa9e41364ef0797 100644 (file)
@@ -148,7 +148,8 @@ namespace internal
     const unsigned int temp_size = Eval::dofs_per_cell == numbers::invalid_unsigned_int ? 0
                                    : (Eval::dofs_per_cell > Eval::n_q_points ?
                                       Eval::dofs_per_cell : Eval::n_q_points);
-    VectorizedArray<Number>  temp_data[(temp_size > 0 && temp_size < 100) ? 2*temp_size : 1];
+    const unsigned int max_stack_size = 100;
+    VectorizedArray<Number>  temp_data[(temp_size > 0 && temp_size < max_stack_size) ? 2*temp_size : 1];
     VectorizedArray<Number> *temp1;
     VectorizedArray<Number> *temp2;
     if (temp_size == 0)
@@ -157,7 +158,7 @@ namespace internal
         temp2 = temp1 + std::max(Utilities::fixed_power<dim>(shape_info.fe_degree+1),
                                  Utilities::fixed_power<dim>(shape_info.n_q_points_1d));
       }
-    else if (temp_size < 100)
+    else if (temp_size < max_stack_size)
       {
         temp1 = &temp_data[0];
         temp2 = temp1 + temp_size;
@@ -367,7 +368,8 @@ namespace internal
     const unsigned int temp_size = Eval::dofs_per_cell == numbers::invalid_unsigned_int ? 0
                                    : (Eval::dofs_per_cell > Eval::n_q_points ?
                                       Eval::dofs_per_cell : Eval::n_q_points);
-    VectorizedArray<Number>  temp_data[(temp_size > 0 && temp_size < 100) ? 2*temp_size : 1];
+    const unsigned int max_stack_size = 100;
+    VectorizedArray<Number>  temp_data[(temp_size > 0 && temp_size < max_stack_size) ? 2*temp_size : 1];
     VectorizedArray<Number> *temp1;
     VectorizedArray<Number> *temp2;
     if (temp_size == 0)
@@ -376,7 +378,7 @@ namespace internal
         temp2 = temp1 + std::max(Utilities::fixed_power<dim>(shape_info.fe_degree+1),
                                  Utilities::fixed_power<dim>(shape_info.n_q_points_1d));
       }
-    else if (temp_size < 100)
+    else if (temp_size < max_stack_size)
       {
         temp1 = &temp_data[0];
         temp2 = temp1 + temp_size;

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.