Skip to content

Commit

Permalink
kokkos#6805: fix unused parameter on 0 size views
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed May 15, 2024
1 parent 6dda5bc commit 2706406
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions core/src/impl/Kokkos_ViewMapping.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,8 @@ struct ViewOffset<
// length to the last index of the array. Preconditions: s must be an array of
// dimension_type::rank elements
template <typename iType>
KOKKOS_INLINE_FUNCTION iType stride_fill(iType* const s) const {
KOKKOS_INLINE_FUNCTION iType
stride_fill([[maybe_unused]] iType* const s) const {
iType n = 1;
if constexpr (0 < dimension_type::rank) {
s[0] = n;
Expand Down Expand Up @@ -962,7 +963,8 @@ struct ViewOffset<
// length to the last index of the array. Preconditions: s must be an array of
// dimension_type::rank elements
template <typename iType>
KOKKOS_INLINE_FUNCTION iType stride_fill(iType* const s) const {
KOKKOS_INLINE_FUNCTION iType
stride_fill([[maybe_unused]] iType* const s) const {
iType n = 1;
if constexpr (0 < dimension_type::rank) {
s[0] = n;
Expand Down Expand Up @@ -1334,7 +1336,8 @@ struct ViewOffset<
// length to the last index of the array. Preconditions: s must be an array of
// dimension_type::rank elements
template <typename iType>
KOKKOS_INLINE_FUNCTION iType stride_fill(iType* const s) const {
KOKKOS_INLINE_FUNCTION iType
stride_fill([[maybe_unused]] iType* const s) const {
size_type n = 1;
if constexpr (7 < dimension_type::rank) {
s[7] = n;
Expand Down Expand Up @@ -1633,7 +1636,8 @@ struct ViewOffset<
// length to the last index of the array. Preconditions: s must be an array of
// dimension_type::rank elements
template <typename iType>
KOKKOS_INLINE_FUNCTION iType stride_fill(iType* const s) const {
KOKKOS_INLINE_FUNCTION iType
stride_fill([[maybe_unused]] iType* const s) const {
size_type n = 1;
if constexpr (7 < dimension_type::rank) {
s[7] = n;
Expand Down Expand Up @@ -2205,7 +2209,8 @@ struct ViewOffset<Dimension, Kokkos::LayoutStride, void> {
// length to the last index of the array. Preconditions: s must be an array of
// dimension_type::rank elements
template <typename iType>
KOKKOS_INLINE_FUNCTION iType stride_fill(iType* const s) const {
KOKKOS_INLINE_FUNCTION iType
stride_fill([[maybe_unused]] iType* const s) const {
if constexpr (0 < dimension_type::rank) {
s[0] = m_stride.S0;
}
Expand Down

0 comments on commit 2706406

Please sign in to comment.