Skip to content

Commit

Permalink
Merge pull request #16245 from masterleinad/remove_workaround_kokkos_…
Browse files Browse the repository at this point in the history
…tensor_h

Remove workarounds for Assert* in tensor.h
  • Loading branch information
marcfehling committed Nov 5, 2023
2 parents 2443a4c + 6dab0bc commit 5f64106
Showing 1 changed file with 0 additions and 24 deletions.
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

0 comments on commit 5f64106

Please sign in to comment.