Skip to content

Commit

Permalink
Introduce KOKKOS_IMPL_CONDITIONAL_EXPLICIT macro for use in View
Browse files Browse the repository at this point in the history
  • Loading branch information
crtrott authored and nmm0 committed May 15, 2024
1 parent 516c510 commit c46c1bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions core/src/Kokkos_Macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,12 @@ static constexpr bool kokkos_omp_on_host() { return false; }

#define KOKKOS_ATTRIBUTE_NODISCARD [[nodiscard]]

#ifdef KOKKOS_ENABLE_CXX20
# define KOKKOS_IMPL_CONDITIONAL_EXPLICIT(COND) explicit(COND)
#else
# define KOKKOS_IMPL_CONDITIONAL_EXPLICIT(COND)
#endif

#if (defined(KOKKOS_COMPILER_GNU) || defined(KOKKOS_COMPILER_CLANG) || \
defined(KOKKOS_COMPILER_INTEL) || defined(KOKKOS_COMPILER_INTEL_LLVM) || \
defined(KOKKOS_COMPILER_NVHPC)) && \
Expand Down
2 changes: 1 addition & 1 deletion core/src/Kokkos_View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ class View : public ViewTraits<DataType, Properties...> {
// MDSpan converting constructors
#ifdef KOKKOS_ENABLE_IMPL_MDSPAN
template <typename U = typename Impl::MDSpanViewTraits<traits>::mdspan_type>
KOKKOS_INLINE_FUNCTION MDSPAN_CONDITIONAL_EXPLICIT(traits::is_managed) View(
KOKKOS_INLINE_FUNCTION KOKKOS_IMPL_CONDITIONAL_EXPLICIT(traits::is_managed) View(
const typename Impl::MDSpanViewTraits<traits>::mdspan_type& mds,
std::enable_if_t<
!std::is_same_v<Impl::UnsupportedKokkosArrayLayout, U>>* = nullptr)
Expand Down

0 comments on commit c46c1bd

Please sign in to comment.