Skip to content

Commit

Permalink
attempt to fix ambiguous call error
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbowen42 committed Sep 17, 2024
1 parent 1e2f7dc commit 7c4067f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/serac/infrastructure/accelerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void zero_out(axom::Array<T, dim, space>& arr)
#ifdef __CUDACC__
/// @overload
template <typename T, int dim>
void zero_out(axom::Array<T, dim, execution_to_memory_v<ExecutionSpace::GPU>>& arr)
void zero_out(axom::Array<T, dim, axom::MemorySpace::Device>& arr)
{
cudaMemset(arr.data(), 0, static_cast<std::size_t>(arr.size()) * sizeof(T));
}
Expand Down
2 changes: 1 addition & 1 deletion src/serac/numerics/functional/finite_element.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ SERAC_HOST_DEVICE void physical_to_parent(tensor<T, q>& qf_output, const tensor<
* };
*
*/
template <mfem::Geometry::Type g, typename family, serac::ExecutionSpace exec>
template <mfem::Geometry::Type g, typename family, serac::ExecutionSpace exec = ExecutionSpace::CPU>
struct finite_element;

#include "detail/segment_H1.inl"
Expand Down
7 changes: 3 additions & 4 deletions src/serac/numerics/functional/functional_qoi.inl
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,16 @@ private:

gradient_L_ = 0.0;

std::map<mfem::Geometry::Type, ExecArray<double, 3, serac::ExecutionSpace::CPU>>
element_gradients[Domain::num_types];
std::map<mfem::Geometry::Type, ExecArray<double, 3, exec>> element_gradients[Domain::num_types];

for (auto& integral : form_.integrals_) {
auto& K_elem = element_gradients[integral.domain_.type_];
auto& trial_restrictions = form_.G_trial_[integral.domain_.type_][which_argument].restrictions;

if (K_elem.empty()) {
for (auto& [geom, trial_restriction] : trial_restrictions) {
K_elem[geom] = ExecArray<double, 3, serac::ExecutionSpace::CPU>(
trial_restriction.num_elements, 1, trial_restriction.nodes_per_elem * trial_restriction.components);
K_elem[geom] = ExecArray<double, 3, exec>(trial_restriction.num_elements, 1,
trial_restriction.nodes_per_elem * trial_restriction.components);

detail::zero_out(K_elem[geom]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/serac/numerics/functional/integral.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ Integral MakeDomainIntegral(const Domain& domain, const lambda_type& qf,

SLIC_ERROR_IF(domain.type_ != Domain::Type::Elements, "Error: trying to evaluate a domain integral over a boundary");

Integral integral(std::move(domain), argument_indices);
Integral integral(domain, argument_indices);

if constexpr (dim == 2) {
generate_kernels<mfem::Geometry::TRIANGLE, Q, exec>(signature, integral, qf, qdata);
Expand Down Expand Up @@ -379,7 +379,7 @@ Integral MakeBoundaryIntegral(const Domain& domain, const lambda_type& qf, std::
SLIC_ERROR_IF(domain.type_ != Domain::Type::BoundaryElements,
"Error: trying to evaluate a boundary integral over a non-boundary domain of integration");

Integral integral(std::move(domain), argument_indices);
Integral integral(domain, argument_indices);

if constexpr (dim == 1) {
generate_bdr_kernels<mfem::Geometry::SEGMENT, Q, exec>(signature, integral, qf);
Expand Down
10 changes: 4 additions & 6 deletions src/serac/numerics/functional/shape_aware_functional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,11 @@ class ShapeAwareFunctional<shape, test(trials...), exec> {
{
if constexpr (std::is_same_v<qpt_data_type, Nothing>) {
functional_->AddDomainIntegral(Dimension<dim>{}, DependsOn<0, (args + 1)...>{},
std::move(ShapeAwareIntegrandWrapper<lambda, dim, args...>(integrand)), domain,
qdata);
ShapeAwareIntegrandWrapper<lambda, dim, args...>(integrand), domain, qdata);
} else {
functional_->AddDomainIntegral(Dimension<dim>{}, DependsOn<0, (args + 1)...>{},
std::move(ShapeAwareIntegrandWrapperWithState<lambda, dim, args...>(integrand)),
domain, qdata);
ShapeAwareIntegrandWrapperWithState<lambda, dim, args...>(integrand), domain,
qdata);
}
}

Expand Down Expand Up @@ -517,8 +516,7 @@ class ShapeAwareFunctional<shape, test(trials...), exec> {
void AddBoundaryIntegral(Dimension<dim>, DependsOn<args...>, const lambda& integrand, domain_type& domain)
{
functional_->AddBoundaryIntegral(Dimension<dim>{}, DependsOn<0, (args + 1)...>{},
std::move(ShapeAwareBoundaryIntegrandWrapper<lambda, dim, args...>(integrand)),
domain);
ShapeAwareBoundaryIntegrandWrapper<lambda, dim, args...>(integrand), domain);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/serac/physics/heat_transfer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ class HeatTransfer<order, dim, Parameters<parameter_space...>, std::integer_sequ
template <typename MaterialType>
void setMaterial(const MaterialType& material)
{
setMaterial(DependsOn<>{}, std::move(material));
setMaterial(DependsOn<>{}, material);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/serac/physics/thermomechanics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ class Thermomechanics : public BasePhysics {
template <typename MaterialType, typename StateType = Empty>
void setMaterial(const MaterialType& material, std::shared_ptr<QuadratureData<StateType>> qdata = EmptyQData)
{
setMaterial(DependsOn<>{}, std::move(material), qdata);
setMaterial(DependsOn<>{}, material, qdata);
}

/**
Expand Down

0 comments on commit 7c4067f

Please sign in to comment.