Skip to content

Commit

Permalink
Move variables back to constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbowen42 committed Nov 2, 2023
1 parent 5931dc5 commit cf090f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/serac/numerics/functional/domain_integral_kernels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,14 @@ void action_of_gradient_kernel(const double* dU, double* dR, derivatives_type* q
using test_element = finite_element<g, test>;
using trial_element = finite_element<g, trial>;

const bool is_QOI = (test::family == Family::QOI);
const int num_qpts = num_quadrature_points(g, Q);
constexpr bool is_QOI = (test::family == Family::QOI);
constexpr int num_qpts = num_quadrature_points(g, Q);

// mfem provides this information in 1D arrays, so we reshape it
// into strided multidimensional arrays before using
auto du = reinterpret_cast<const typename trial_element::dof_type*>(dU);
auto dr = reinterpret_cast<typename test_element::dof_type*>(dR);
const TensorProductQuadratureRule<Q> rule{};
constexpr TensorProductQuadratureRule<Q> rule{};

// for each element in the domain
for (uint32_t e = 0; e < num_elements; e++) {
Expand Down
7 changes: 3 additions & 4 deletions src/serac/physics/heat_transfer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,9 @@ class HeatTransfer<order, dim, Parameters<parameter_space...>, std::integer_sequ
*/
ThermalMaterialIntegrand(MaterialType material) : material_(material) {}

// Due to nvcc's lack of support for generic lambdas (i.e. functions of the form
// auto lambda = [](auto) {}; ), this cannot be allowed. In order for this code
// to be portable to CUDA platforms, the asserts below prevent serac from compiling
// if such a lambda is supplied.
// Due to nvcc's lack of support for extended generic lambdas (i.e. functions of the form
// auto lambda = [] __host__ __device__ (auto) {}; ), MaterialType cannot be an extended
// generic lambda. The static asserts below check this.
private:
class DummyArgumentType {
};
Expand Down

0 comments on commit cf090f5

Please sign in to comment.