Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove workarounds for Assert* in tensor.h #16245

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 0 additions & 24 deletions include/deal.II/base/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1451,13 +1451,7 @@ constexpr DEAL_II_ALWAYS_INLINE
DEAL_II_HOST_DEVICE const typename Tensor<rank_, dim, Number>::value_type &
Tensor<rank_, dim, Number>::operator[](const unsigned int i) const
{
# if KOKKOS_VERSION < 30700
# ifdef KOKKOS_ACTIVE_MEMORY_SPACE_HOST
AssertIndexRange(i, dim);
# endif
# else
KOKKOS_IF_ON_HOST((AssertIndexRange(i, dim);))
# endif

return values[i];
}
Expand All @@ -1467,17 +1461,8 @@ template <int rank_, int dim, typename Number>
constexpr inline DEAL_II_ALWAYS_INLINE const Number &
Tensor<rank_, dim, Number>::operator[](const TableIndices<rank_> &indices) const
{
# if KOKKOS_VERSION < 30700
# ifdef KOKKOS_ACTIVE_MEMORY_SPACE_HOST
Assert(dim != 0,
ExcMessage("Cannot access an object of type Tensor<rank_,0,Number>"));
# endif
# else
KOKKOS_IF_ON_HOST(
(Assert(dim != 0,
ExcMessage(
"Cannot access an object of type Tensor<rank_,0,Number>"));))
# endif

return TensorAccessors::extract<rank_>(*this, indices);
}
Expand All @@ -1488,17 +1473,8 @@ template <int rank_, int dim, typename Number>
constexpr inline DEAL_II_ALWAYS_INLINE Number &
Tensor<rank_, dim, Number>::operator[](const TableIndices<rank_> &indices)
{
# if KOKKOS_VERSION < 30700
# ifdef KOKKOS_ACTIVE_MEMORY_SPACE_HOST
Assert(dim != 0,
ExcMessage("Cannot access an object of type Tensor<rank_,0,Number>"));
# endif
# else
KOKKOS_IF_ON_HOST(
(Assert(dim != 0,
ExcMessage(
"Cannot access an object of type Tensor<rank_,0,Number>"));))
# endif

return TensorAccessors::extract<rank_>(*this, indices);
}
Expand Down