diff --git a/src/batched/KokkosBatched_Util.hpp b/src/batched/KokkosBatched_Util.hpp index 4ef2d2e478..4b873c406a 100644 --- a/src/batched/KokkosBatched_Util.hpp +++ b/src/batched/KokkosBatched_Util.hpp @@ -825,8 +825,10 @@ KOKKOS_INLINE_FUNCTION auto subview_wrapper( template KOKKOS_INLINE_FUNCTION ViewValueType access_view_bounds_check(ViewType v, int m, int n, const BoundsCheck::Yes &) { - return v(KOKKOSKERNELS_MACRO_MIN(m, v.extent_int(0) - 1), - KOKKOSKERNELS_MACRO_MIN(n, v.extent_int(1) - 1)); + if (m < v.extent_int(0) && n < v.extent_int(1)) + return v(m, n); + else + return (ViewValueType)0.0F; } template