From: Martin Kronbichler Date: Tue, 28 Mar 2017 14:08:07 +0000 (+0200) Subject: Make the stack size selection a single parameter X-Git-Tag: v8.5.0-rc1~1^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4130%2Fhead;p=dealii.git Make the stack size selection a single parameter --- diff --git a/include/deal.II/matrix_free/evaluation_kernels.h b/include/deal.II/matrix_free/evaluation_kernels.h index 62695fea38..ccfe5bbc4c 100644 --- a/include/deal.II/matrix_free/evaluation_kernels.h +++ b/include/deal.II/matrix_free/evaluation_kernels.h @@ -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 temp_data[(temp_size > 0 && temp_size < 100) ? 2*temp_size : 1]; + const unsigned int max_stack_size = 100; + VectorizedArray temp_data[(temp_size > 0 && temp_size < max_stack_size) ? 2*temp_size : 1]; VectorizedArray *temp1; VectorizedArray *temp2; if (temp_size == 0) @@ -157,7 +158,7 @@ namespace internal temp2 = temp1 + std::max(Utilities::fixed_power(shape_info.fe_degree+1), Utilities::fixed_power(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 temp_data[(temp_size > 0 && temp_size < 100) ? 2*temp_size : 1]; + const unsigned int max_stack_size = 100; + VectorizedArray temp_data[(temp_size > 0 && temp_size < max_stack_size) ? 2*temp_size : 1]; VectorizedArray *temp1; VectorizedArray *temp2; if (temp_size == 0) @@ -376,7 +378,7 @@ namespace internal temp2 = temp1 + std::max(Utilities::fixed_power(shape_info.fe_degree+1), Utilities::fixed_power(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;