Skip to content

Commit

Permalink
[DO NOT MERGE] enable bound checking in view accesses unconditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
dalg24 committed Mar 9, 2024
1 parent 20a94e6 commit 6b1c3d0
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions core/src/Kokkos_View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,9 @@ 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 @@ -826,8 +827,6 @@ 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 @@ -836,16 +835,6 @@ 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 6b1c3d0

Please sign in to comment.