Skip to content

Commit

Permalink
kokkos#6805: fix host function call from device and fix more cuda war…
Browse files Browse the repository at this point in the history
…nings in mdspan
  • Loading branch information
nmm0 committed Mar 7, 2024
1 parent caf9242 commit 56ffeb6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion core/src/View/MDSpan/Kokkos_MDSpan_Extents.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ static_assert(false,
#define KOKKOS_EXPERIMENTAL_MDSPAN_EXTENTS_HPP

#include "Kokkos_MDSpan_Header.hpp"
#include <Kokkos_Core_fwd.hpp>

namespace Kokkos::Impl {

Expand Down Expand Up @@ -110,7 +111,7 @@ struct DataTypeFromExtents {
/// Convert from a mdspan extent to a Kokkos extent, inserting 0s for static
/// extents
template <class Extents>
auto dimension_from_extent(const Extents &e, std::size_t r) noexcept {
KOKKOS_INLINE_FUNCTION auto dimension_from_extent(const Extents &e, std::size_t r) noexcept {
return Extents::static_extent(r) == dynamic_extent ? e.extent(r) : 0;
}
} // namespace Kokkos::Experimental::Impl
Expand Down
4 changes: 2 additions & 2 deletions core/src/View/MDSpan/Kokkos_MDSpan_Layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct ViewOffsetFromExtents {

template <class ElementType, class Extents, class LayoutPolicy,
class AccessorPolicy>
auto array_layout_from_mdspan(
KOKKOS_INLINE_FUNCTION auto array_layout_from_mdspan(
const mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy> &mds) {
using layout_type = typename ArrayLayoutFromLayout<LayoutPolicy>::type;
const auto &ext = mds.extents();
Expand All @@ -81,7 +81,7 @@ auto array_layout_from_mdspan(

template <class ElementType, class Extents, class LayoutPolicy,
class AccessorPolicy>
auto view_offset_from_mdspan(
KOKKOS_INLINE_FUNCTION auto view_offset_from_mdspan(
const mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy> &mds) {
using offset_type =
typename ViewOffsetFromExtents<ElementType, Extents, LayoutPolicy>::type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ struct padded_extent {
return {find_next_multiple(pv,
exts.extent(_ExtentToPadIdx))};
} else {
(void)pv; // Some compilers complain about pv not being used here
return {};
}
}
Expand Down

0 comments on commit 56ffeb6

Please sign in to comment.