Skip to content

Commit

Permalink
Revert "[DO NOT MERGE] enable bound checking in view accesses uncondi…
Browse files Browse the repository at this point in the history
…tionally"

This reverts commit ff9d411.
  • Loading branch information
dalg24 committed Mar 9, 2024
1 parent 001d90f commit 79aa088
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions core/src/Kokkos_View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,8 @@ class View : public ViewTraits<DataType, Properties...> {
traits::dimension::rank_dynamic>
rank_dynamic = {};
#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
enum {
Rank KOKKOS_DEPRECATED_WITH_COMMENT("Use rank instead.") = map_type::Rank
};
enum {Rank KOKKOS_DEPRECATED_WITH_COMMENT("Use rank instead.") =
map_type::Rank};
#endif

template <typename iType>
Expand Down Expand Up @@ -827,6 +826,8 @@ class View : public ViewTraits<DataType, Properties...> {
std::is_void<typename traits::specialize>::value &&
(is_layout_left || is_layout_right || is_layout_stride);

#if defined(KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK)

#define KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(...) \
Kokkos::Impl::runtime_check_memory_access_violation< \
typename traits::memory_space>( \
Expand All @@ -835,6 +836,16 @@ class View : public ViewTraits<DataType, Properties...> {
Kokkos::Impl::view_verify_operator_bounds<typename traits::memory_space>( \
__VA_ARGS__);

#else

#define KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(...) \
Kokkos::Impl::runtime_check_memory_access_violation< \
typename traits::memory_space>( \
"Kokkos::View ERROR: attempt to access inaccessible memory space", \
__VA_ARGS__);

#endif

template <typename... Is>
static KOKKOS_FUNCTION void check_access_member_function_valid_args(Is...) {
static_assert(rank <= sizeof...(Is));
Expand Down

0 comments on commit 79aa088

Please sign in to comment.