Skip to content

Commit

Permalink
kokkos#6805: address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed May 15, 2024
1 parent 7c74565 commit 75bb319
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions core/src/Kokkos_View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1755,9 +1755,9 @@ class View : public ViewTraits<DataType, Properties...> {
#ifdef KOKKOS_ENABLE_IMPL_MDSPAN
template <typename U = typename Impl::MDSpanViewTraits<traits>::mdspan_type>
KOKKOS_INLINE_FUNCTION
#ifndef KOKKOS_ENABLE_CXX17
// explicit(bool) is only supported by C++20 and above -- ensure code
// using this compiles with C++20 as it may break if only tested in C++17
#if defined(__cpp_conditional_explicit) && \
(__cpp_conditional_explicit >= 201806L)
// FIXME C++20 reevaluate after determining minium compiler versions
explicit(traits::is_managed)
#endif
View(const typename Impl::MDSpanViewTraits<traits>::mdspan_type& mds,
Expand All @@ -1774,9 +1774,9 @@ class View : public ViewTraits<DataType, Properties...> {
template <class ElementType, class ExtentsType, class LayoutType,
class AccessorType>
KOKKOS_INLINE_FUNCTION
#ifndef KOKKOS_ENABLE_CXX17
// explicit(bool) is only supported by C++20 and above -- ensure code
// using this compiles with C++20 as it may break if only tested in C++17
#if defined(__cpp_conditional_explicit) && \
(__cpp_conditional_explicit >= 201806L)
// FIXME C++20 reevaluate after determining minium compiler versions
explicit(!std::is_convertible_v<
Kokkos::mdspan<ElementType, ExtentsType, LayoutType,
AccessorType>,
Expand Down
2 changes: 1 addition & 1 deletion core/src/View/MDSpan/Kokkos_MDSpan_Layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ KOKKOS_INLINE_FUNCTION auto mapping_from_view_mapping(const VM &view_mapping) {

// std::span is not available in C++17 (our current requirements),
// so we need to use the std::array constructor for layout mappings.
// When C++20 is available, we can use std::span here instead
// FIXME When C++20 is available, we can use std::span here instead
std::size_t strides[VM::Rank];
view_mapping.stride_fill(&strides[0]);
if constexpr (std::is_same_v<typename mapping_type::layout_type,
Expand Down
4 changes: 2 additions & 2 deletions core/src/impl/Kokkos_ViewMapping.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ 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
// FIXME: The version of clang-format in CI fails from maybe_unused
// clang-format off
template <typename iType>
KOKKOS_INLINE_FUNCTION iType
Expand All @@ -665,7 +665,7 @@ struct ViewOffset<
s[1] = n;
n *= m_dim.N1;
}
if constexpr (1 < dimension_type::rank) {
if constexpr (2 < dimension_type::rank) {
s[2] = n;
n *= m_dim.N2;
}
Expand Down

0 comments on commit 75bb319

Please sign in to comment.