Skip to content

Commit

Permalink
kokkos#6805: disable clang formatting for usage of maybe_unused as it…
Browse files Browse the repository at this point in the history
… gives incorrect C++
  • Loading branch information
nmm0 committed May 15, 2024
1 parent 2706406 commit 134419a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/src/impl/Kokkos_ViewMapping.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ struct ViewOffset<
// This method differs from stride() in that it does not write the total
// length to the last index of the array. Preconditions: s must be an array of
// dimension_type::rank elements
// The version of clang-format in CI fails from maybe_unused
// clang-format off
template <typename iType>
KOKKOS_INLINE_FUNCTION iType
stride_fill([[maybe_unused]] iType* const s) const {
Expand Down Expand Up @@ -689,6 +691,7 @@ struct ViewOffset<
}
return n;
}
// clang-format on

// Fill the target unbounded array s with the stride and the total spanned
// size. This method differs from stride_fill() in that it writes the total
Expand Down Expand Up @@ -962,6 +965,8 @@ struct ViewOffset<
// This method differs from stride() in that it does not write the total
// length to the last index of the array. Preconditions: s must be an array of
// dimension_type::rank elements
// The version of clang-format in CI fails from maybe_unused
// clang-format off
template <typename iType>
KOKKOS_INLINE_FUNCTION iType
stride_fill([[maybe_unused]] iType* const s) const {
Expand Down Expand Up @@ -1000,6 +1005,7 @@ struct ViewOffset<
}
return n;
}
// clang-format on

// Fill the target unbounded array s with the stride and the total spanned
// size. This method differs from stride_fill() in that it writes the total
Expand Down Expand Up @@ -1335,6 +1341,8 @@ struct ViewOffset<
// This method differs from stride() in that it does not write the total
// length to the last index of the array. Preconditions: s must be an array of
// dimension_type::rank elements
// The version of clang-format in CI fails from maybe_unused
// clang-format off
template <typename iType>
KOKKOS_INLINE_FUNCTION iType
stride_fill([[maybe_unused]] iType* const s) const {
Expand Down Expand Up @@ -1372,6 +1380,7 @@ struct ViewOffset<
}
return n * m_dim.N0;
}
// clang-format on

// Fill the target unbounded array s with the stride and the total spanned
// size. This method differs from stride_fill() in that it writes the total
Expand Down Expand Up @@ -1635,6 +1644,8 @@ struct ViewOffset<
// This method differs from stride() in that it does not write the total
// length to the last index of the array. Preconditions: s must be an array of
// dimension_type::rank elements
// The version of clang-format in CI fails from maybe_unused
// clang-format off
template <typename iType>
KOKKOS_INLINE_FUNCTION iType
stride_fill([[maybe_unused]] iType* const s) const {
Expand Down Expand Up @@ -1671,6 +1682,7 @@ struct ViewOffset<
}
return m_stride * m_dim.N0;
}
// clang-format on

// Fill the target unbounded array s with the stride and the total spanned
// size. This method differs from stride_fill() in that it writes the total
Expand Down Expand Up @@ -2208,6 +2220,8 @@ struct ViewOffset<Dimension, Kokkos::LayoutStride, void> {
// This method differs from stride() in that it does not write the total
// length to the last index of the array. Preconditions: s must be an array of
// dimension_type::rank elements
// The version of clang-format in CI fails from maybe_unused
// clang-format off
template <typename iType>
KOKKOS_INLINE_FUNCTION iType
stride_fill([[maybe_unused]] iType* const s) const {
Expand Down Expand Up @@ -2237,6 +2251,7 @@ struct ViewOffset<Dimension, Kokkos::LayoutStride, void> {
}
return span();
}
// clang-format on

// Fill the target unbounded array s with the stride and the total spanned
// size. This method differs from stride_fill() in that it writes the total
Expand Down

0 comments on commit 134419a

Please sign in to comment.