From 921c3189393aecf74edb321fbce6b31ce5038d55 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 12 Feb 2026 18:13:25 +0000 Subject: [PATCH 1/8] Replace bounds checking asserts with MATAR_CHECK_BOUNDS macros This commit introduces enhanced bounds checking macros that provide detailed error messages when bounds violations occur in debug mode. Changes: - Added MATAR_CHECK_BOUNDS macro for Kokkos View arrays with labels - Added MATAR_CHECK_BOUNDS_NO_LABEL macro for raw pointer arrays - Added MATAR_CHECK_BOUNDS_MATRIX macro for 1-based matrix indexing - Added MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL macro for View matrix types - Added MATAR_CHECK_ORDER macro for order/rank validation - Added MATAR_CHECK_ORDER_NO_LABEL macro for View types without labels - Replaced 717 bounds checking assert statements with the new macros The macros provide enhanced error output including: - File location and line number - Class name where the error occurred - Array label (when available) - Index name and value that caused the violation - Expected dimension size or valid range In release mode (NDEBUG defined), all macros compile to no-ops for zero runtime overhead. Addresses: lanl/MATAR#151 Co-authored-by: Jacob Moore --- src/include/kokkos_types.h | 1501 +++++++++++++++++++----------------- 1 file changed, 789 insertions(+), 712 deletions(-) diff --git a/src/include/kokkos_types.h b/src/include/kokkos_types.h index 0d9f5ad1..64a1b44d 100644 --- a/src/include/kokkos_types.h +++ b/src/include/kokkos_types.h @@ -109,7 +109,84 @@ using SHArray1D = Kokkos::View; //To disable asserts, uncomment the following line //#define NDEBUG - +// Bounds checking macros with enhanced error output +// These macros provide detailed error messages in debug mode for bounds violations +#ifndef NDEBUG + // For Kokkos View arrays with labels + #define MATAR_CHECK_BOUNDS(i, dim, index_name, class_name) \ + if ((i) >= (dim)) { \ + printf("\n[MATAR BOUNDS ERROR]\n"); \ + printf(" Location: %s:%d\n", __FILE__, __LINE__); \ + printf(" Class: %s\n", class_name); \ + printf(" Array Label: %s\n", this_array_.label().c_str()); \ + printf(" Index '%s' = %zu is out of bounds (dimension size = %zu)\n\n", \ + index_name, (size_t)(i), (size_t)(dim)); \ + assert(false && "MATAR bounds check failed"); \ + } + + // For View arrays (raw pointers) without labels + #define MATAR_CHECK_BOUNDS_NO_LABEL(i, dim, index_name, class_name) \ + if ((i) >= (dim)) { \ + printf("\n[MATAR BOUNDS ERROR]\n"); \ + printf(" Location: %s:%d\n", __FILE__, __LINE__); \ + printf(" Class: %s\n", class_name); \ + printf(" Index '%s' = %zu is out of bounds (dimension size = %zu)\n\n", \ + index_name, (size_t)(i), (size_t)(dim)); \ + assert(false && "MATAR bounds check failed"); \ + } + + // For Matrix types with 1-based indexing (with label) + #define MATAR_CHECK_BOUNDS_MATRIX(i, dim, index_name, class_name) \ + if ((i) < 1 || (i) > (dim)) { \ + printf("\n[MATAR BOUNDS ERROR]\n"); \ + printf(" Location: %s:%d\n", __FILE__, __LINE__); \ + printf(" Class: %s\n", class_name); \ + printf(" Array Label: %s\n", this_array_.label().c_str()); \ + printf(" Index '%s' = %zu is out of bounds (valid range: 1 to %zu)\n\n", \ + index_name, (size_t)(i), (size_t)(dim)); \ + assert(false && "MATAR bounds check failed"); \ + } + + // For Matrix types with 1-based indexing (without label) + #define MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dim, index_name, class_name) \ + if ((i) < 1 || (i) > (dim)) { \ + printf("\n[MATAR BOUNDS ERROR]\n"); \ + printf(" Location: %s:%d\n", __FILE__, __LINE__); \ + printf(" Class: %s\n", class_name); \ + printf(" Index '%s' = %zu is out of bounds (valid range: 1 to %zu)\n\n", \ + index_name, (size_t)(i), (size_t)(dim)); \ + assert(false && "MATAR bounds check failed"); \ + } + + // For order/rank validation + #define MATAR_CHECK_ORDER(expected, actual, class_name) \ + if ((expected) != (actual)) { \ + printf("\n[MATAR ORDER MISMATCH ERROR]\n"); \ + printf(" Location: %s:%d\n", __FILE__, __LINE__); \ + printf(" Class: %s\n", class_name); \ + printf(" Array Label: %s\n", this_array_.label().c_str()); \ + printf(" Expected order %zu but got %zu\n\n", (size_t)(expected), (size_t)(actual)); \ + assert(false && "MATAR order check failed"); \ + } + + // For order/rank validation without label + #define MATAR_CHECK_ORDER_NO_LABEL(expected, actual, class_name) \ + if ((expected) != (actual)) { \ + printf("\n[MATAR ORDER MISMATCH ERROR]\n"); \ + printf(" Location: %s:%d\n", __FILE__, __LINE__); \ + printf(" Class: %s\n", class_name); \ + printf(" Expected order %zu but got %zu\n\n", (size_t)(expected), (size_t)(actual)); \ + assert(false && "MATAR order check failed"); \ + } +#else + // In Release mode, these macros do nothing + #define MATAR_CHECK_BOUNDS(i, dim, index_name, class_name) ((void)0) + #define MATAR_CHECK_BOUNDS_NO_LABEL(i, dim, index_name, class_name) ((void)0) + #define MATAR_CHECK_BOUNDS_MATRIX(i, dim, index_name, class_name) ((void)0) + #define MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dim, index_name, class_name) ((void)0) + #define MATAR_CHECK_ORDER(expected, actual, class_name) ((void)0) + #define MATAR_CHECK_ORDER_NO_LABEL(expected, actual, class_name) ((void)0) +#endif #ifdef HAVE_KOKKOS @@ -375,8 +452,8 @@ FArrayKokkos::FArrayKokkos(size_t dim0, size_t template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()( size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in FArrayKokkos 1D!"); - assert(i < dims_[0] && "i is out of bounds in FArrayKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "FArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); return this_array_(i); } @@ -384,9 +461,9 @@ T& FArrayKokkos::operator()( size_t i) const { template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in FArrayKokkos 2D!"); - assert(i < dims_[0] && "i is out of bounds in FArrayKokkos 2D!"); - assert(j < dims_[1] && "j is out of bounds in FArrayKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "FArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); return this_array_(i + (j * dims_[0])); } @@ -394,10 +471,10 @@ T& FArrayKokkos::operator()(size_t i, size_t j) template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in FArrayKokkos 3D!"); - assert(i < dims_[0] && "i is out of bounds in FArrayKokkos 3D!"); - assert(j < dims_[1] && "j is out of bounds in FArrayKokkos 3D!"); - assert(k < dims_[2] && "k is out of bounds in FArrayKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "FArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1])); } @@ -406,11 +483,11 @@ T& FArrayKokkos::operator()(size_t i, size_t j, template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in FArrayKokkos 4D!"); - assert(i < dims_[0] && "i is out of bounds in FArrayKokkos 4D!"); - assert(j < dims_[1] && "j is out of bounds in FArrayKokkos 4D!"); - assert(k < dims_[2] && "k is out of bounds in FArrayKokkos 4D!"); - assert(l < dims_[3] && "l is out of bounds in FArrayKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "FArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2])); @@ -421,12 +498,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in FArrayKokkos 5D!"); - assert(i < dims_[0] && "i is out of bounds in FArrayKokkos 5D!"); - assert(j < dims_[1] && "j is out of bounds in FArrayKokkos 5D!"); - assert(k < dims_[2] && "k is out of bounds in FArrayKokkos 5D!"); - assert(l < dims_[3] && "l is out of bounds in FArrayKokkos 5D!"); - assert(m < dims_[4] && "m is out of bounds in FArrayKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "FArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -438,13 +515,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in FArrayKokkos 6D!"); - assert(i < dims_[0] && "i is out of bounds in FArrayKokkos 6D!"); - assert(j < dims_[1] && "j is out of bounds in FArrayKokkos 6D!"); - assert(k < dims_[2] && "k is out of bounds in FArrayKokkos 6D!"); - assert(l < dims_[3] && "l is out of bounds in FArrayKokkos 6D!"); - assert(m < dims_[4] && "m is out of bounds in FArrayKokkos 6D!"); - assert(n < dims_[5] && "n is out of bounds in FArrayKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "FArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "FArrayKokkos"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -457,14 +534,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in FArrayKokkos 7D!"); - assert(i < dims_[0] && "i is out of bounds in FArrayKokkos 7D!"); - assert(j < dims_[1] && "j is out of bounds in FArrayKokkos 7D!"); - assert(k < dims_[2] && "k is out of bounds in FArrayKokkos 7D!"); - assert(l < dims_[3] && "l is out of bounds in FArrayKokkos 7D!"); - assert(m < dims_[4] && "m is out of bounds in FArrayKokkos 7D!"); - assert(n < dims_[5] && "n is out of bounds in FArrayKokkos 7D!"); - assert(o < dims_[6] && "o is out of bounds in FArrayKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "FArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "FArrayKokkos"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "FArrayKokkos"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -507,7 +584,7 @@ size_t FArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t FArrayKokkos::dims(size_t i) const { - assert(i < order_ && "FArrayKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "FArrayKokkos dims()"); assert(dims_[i]>0 && "Access to FArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -759,8 +836,8 @@ ViewFArrayKokkos::ViewFArrayKokkos(T *some_array, size_t dim0, size_t dim1, template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in ViewFArrayKokkos 1D!"); - assert(i < dims_[0] && "i is out of bounds in ViewFArrayKokkos 1D!"); + MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); return this_array_[i]; } @@ -768,9 +845,9 @@ T& ViewFArrayKokkos::operator()(size_t i) const { template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in ViewFArrayKokkos 2D!"); - assert(i < dims_[0] && "i is out of bounds in ViewFArrayKokkos 2D!"); - assert(j < dims_[1] && "j is out of bounds in ViewFArrayKokkos 2D!"); + MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); return this_array_[i + (j * dims_[0])]; } @@ -778,10 +855,10 @@ T& ViewFArrayKokkos::operator()(size_t i, size_t j) const { template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in ViewFArrayKokkos 3D!"); - assert(i < dims_[0] && "i is out of bounds in ViewFArrayKokkos 3D!"); - assert(j < dims_[1] && "j is out of bounds in ViewFArrayKokkos 3D!"); - assert(k < dims_[2] && "k is out of bounds in ViewFArrayKokkos 3D!"); + MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos"); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1])]; } @@ -791,11 +868,11 @@ template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in ViewFArrayKokkos 4D!"); - assert(i < dims_[0] && "i is out of bounds in ViewFArrayKokkos 4D!"); - assert(j < dims_[1] && "j is out of bounds in ViewFArrayKokkos 4D!"); - assert(k < dims_[2] && "k is out of bounds in ViewFArrayKokkos 4D!"); - assert(l < dims_[3] && "l is out of bounds in ViewFArrayKokkos 4D!"); + MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos"); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] *dims_[2])]; @@ -806,12 +883,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in ViewFArrayKokkos 5D!"); - assert(i < dims_[0] && "i is out of bounds in ViewFArrayKokkos 5D!"); - assert(j < dims_[1] && "j is out of bounds in ViewFArrayKokkos 5D!"); - assert(k < dims_[2] && "k is out of bounds in ViewFArrayKokkos 5D!"); - assert(l < dims_[3] && "l is out of bounds in ViewFArrayKokkos 5D!"); - assert(m < dims_[4] && "m is out of bounds in ViewFArrayKokkos 5D!"); + MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos"); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -823,13 +900,13 @@ template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in ViewFArrayKokkos 6D!"); - assert(i < dims_[0] && "i is out of bounds in ViewFArrayKokkos 6D!"); - assert(j < dims_[1] && "j is out of bounds in ViewFArrayKokkos 6D!"); - assert(k < dims_[2] && "k is out of bounds in ViewFArrayKokkos 6D!"); - assert(l < dims_[3] && "l is out of bounds in ViewFArrayKokkos 6D!"); - assert(m < dims_[4] && "m is out of bounds in ViewFArrayKokkos 6D!"); - assert(n < dims_[5] && "n is out of bounds in ViewFArrayKokkos 6D!"); + MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewFArrayKokkos"); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -843,14 +920,14 @@ KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in ViewFArrayKokkos 7D!"); - assert(i < dims_[0] && "i is out of bounds in ViewFArrayKokkos 7D!"); - assert(j < dims_[1] && "j is out of bounds in ViewFArrayKokkos 7D!"); - assert(k < dims_[2] && "k is out of bounds in ViewFArrayKokkos 7D!"); - assert(l < dims_[3] && "l is out of bounds in ViewFArrayKokkos 7D!"); - assert(m < dims_[4] && "m is out of bounds in ViewFArrayKokkos 7D!"); - assert(n < dims_[5] && "n is out of bounds in ViewFArrayKokkos 7D!"); - assert(o < dims_[6] && "o is out of bounds in ViewFArrayKokkos 7D!"); + MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewFArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(o, dims_[6], "o", "ViewFArrayKokkos"); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -874,7 +951,7 @@ size_t ViewFArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t ViewFArrayKokkos::dims(size_t i) const { - assert(i < order_ && "ViewFArrayKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, order_, "i", "ViewFArrayKokkos dims()"); assert(dims_[i]>0 && "Access to ViewFArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -1119,27 +1196,27 @@ FMatrixKokkos::FMatrixKokkos(size_t dim1, size_ template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in FMatrixKokkos 1D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in FMatrixKokkos in 1D!"); + MATAR_CHECK_ORDER(1, order_, "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); return this_matrix_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in FMatrixKokkos 2D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in FMatrixKokkos in 2D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in FMatrixKokkos in 2D!"); + MATAR_CHECK_ORDER(2, order_, "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); return this_matrix_((i - 1) + ((j - 1) * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in FMatrixKokkos 3D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in FMatrixKokkos in 3D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in FMatrixKokkos in 3D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in FMatrixKokkos in 3D!"); + MATAR_CHECK_ORDER(3, order_, "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -1147,11 +1224,11 @@ T& FMatrixKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in FMatrixKokkos 4D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in FMatrixKokkos in 4D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in FMatrixKokkos in 4D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in FMatrixKokkos in 4D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in FMatrixKokkos in 4D!"); + MATAR_CHECK_ORDER(4, order_, "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); @@ -1161,12 +1238,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in FMatrixKokkos 5D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in FMatrixKokkos in 5D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in FMatrixKokkos in 5D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in FMatrixKokkos in 5D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in FMatrixKokkos in 5D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in FMatrixKokkos in 5D!"); + MATAR_CHECK_ORDER(5, order_, "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1177,13 +1254,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in FMatrixKokkos 6D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in FMatrixKokkos in 6D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in FMatrixKokkos in 6D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in FMatrixKokkos in 6D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in FMatrixKokkos in 6D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in FMatrixKokkos in 6D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in FMatrixKokkos in 6D!"); + MATAR_CHECK_ORDER(6, order_, "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1195,14 +1272,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in FMatrixKokkos 7D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in FMatrixKokkos in 7D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in FMatrixKokkos in 7D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in FMatrixKokkos in 7D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in FMatrixKokkos in 7D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in FMatrixKokkos in 7D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in FMatrixKokkos in 7D!"); - assert(o >= 1 && o <= dims_[6] && "o is out of bounds in FMatrixKokkos in 7D!"); + MATAR_CHECK_ORDER(7, order_, "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "FMatrixKokkos"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1245,7 +1322,7 @@ template ::dims(size_t i) const { i--; - assert(i < order_ && "FMatrixKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "FMatrixKokkos dims()"); assert(dims_[i]>0 && "Access to FMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -1503,17 +1580,17 @@ ViewFMatrixKokkos::ViewFMatrixKokkos(T* some_matrix, size_t dim1, template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in ViewFMatrixKokkos 1D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in ViewFMatrixKokkos 1D!"); + MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); return this_matrix_[(i - 1)]; } template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in ViewFMatrixKokkos 2D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in ViewFMatrixKokkos 2D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in ViewFMatrixKokkos 2D!"); + MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0])]; } @@ -1521,10 +1598,10 @@ template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in ViewFMatrixKokkos 3D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in ViewFMatrixKokkos 3D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in ViewFMatrixKokkos 3D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in ViewFMatrixKokkos 3D!"); + MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])]; @@ -1534,11 +1611,11 @@ template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in ViewFMatrixKokkos 4D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in ViewFMatrixKokkos 4D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in ViewFMatrixKokkos 4D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in ViewFMatrixKokkos 4D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in ViewFMatrixKokkos 4D!"); + MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])]; @@ -1548,12 +1625,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in ViewFMatrixKokkos 5D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in ViewFMatrixKokkos 5D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in ViewFMatrixKokkos 5D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in ViewFMatrixKokkos 5D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in ViewFMatrixKokkos 5D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in ViewFMatrixKokkos 5D!"); + MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1565,13 +1642,13 @@ KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in ViewFMatrixKokkos 6D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in ViewFMatrixKokkos 6D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in ViewFMatrixKokkos 6D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in ViewFMatrixKokkos 6D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in ViewFMatrixKokkos 6D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in ViewFMatrixKokkos 6D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in ViewFMatrixKokkos 6D!"); + MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewFMatrixKokkos"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1584,14 +1661,14 @@ KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in ViewFMatrixKokkos 7D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in ViewFMatrixKokkos 7D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in ViewFMatrixKokkos 7D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in ViewFMatrixKokkos 7D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in ViewFMatrixKokkos 7D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in ViewFMatrixKokkos 7D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in ViewFMatrixKokkos 7D!"); - assert(o >= 1 && o <= dims_[6] && "o is out of bounds in ViewFMatrixKokkos 7D!"); + MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(o, dims_[6], "o", "ViewFMatrixKokkos"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1616,7 +1693,7 @@ template KOKKOS_INLINE_FUNCTION size_t ViewFMatrixKokkos::dims(size_t i) const { i--; - assert(i < order_ && "ViewFMatrixKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, order_, "i", "ViewFMatrixKokkos dims()"); assert(dims_[i]>0 && "Access to ViewFMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -1888,27 +1965,27 @@ DFArrayKokkos::DFArrayKokkos(size_t dim0, size_ template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in DFArrayKokkos 1D!"); - assert(i < dims_[0] && "i is out of bounds in DFArrayKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); return this_array_.view_device()(i); } template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in DFArrayKokkos 2D!"); - assert(i < dims_[0] && "i is out of bounds in DFArrayKokkos 2D!"); - assert(j < dims_[1] && "j is out of bounds in DFArrayKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); return this_array_.view_device()(i + (j * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in DFArrayKokkos 3D!"); - assert(i < dims_[0] && "i is out of bounds in DFArrayKokkos 3D!"); - assert(j < dims_[1] && "j is out of bounds in DFArrayKokkos 3D!"); - assert(k < dims_[2] && "k is out of bounds in DFArrayKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos"); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1])); } @@ -1916,11 +1993,11 @@ T& DFArrayKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in DFArrayKokkos 4D!"); - assert(i < dims_[0] && "i is out of bounds in DFArrayKokkos 4D!"); - assert(j < dims_[1] && "j is out of bounds in DFArrayKokkos 4D!"); - assert(k < dims_[2] && "k is out of bounds in DFArrayKokkos 4D!"); - assert(l < dims_[3] && "l is out of bounds in DFArrayKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos"); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2])); @@ -1930,12 +2007,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in DFArrayKokkos 5D!"); - assert(i < dims_[0] && "i is out of bounds in DFArrayKokkos 5D!"); - assert(j < dims_[1] && "j is out of bounds in DFArrayKokkos 5D!"); - assert(k < dims_[2] && "k is out of bounds in DFArrayKokkos 5D!"); - assert(l < dims_[3] && "l is out of bounds in DFArrayKokkos 5D!"); - assert(m < dims_[4] && "m is out of bounds in DFArrayKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos"); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -1946,13 +2023,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in DFArrayKokkos 6D!"); - assert(i < dims_[0] && "i is out of bounds in DFArrayKokkos 6D!"); - assert(j < dims_[1] && "j is out of bounds in DFArrayKokkos 6D!"); - assert(k < dims_[2] && "k is out of bounds in DFArrayKokkos 6D!"); - assert(l < dims_[3] && "l is out of bounds in DFArrayKokkos 6D!"); - assert(m < dims_[4] && "m is out of bounds in DFArrayKokkos 6D!"); - assert(n < dims_[5] && "n is out of bounds in DFArrayKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DFArrayKokkos"); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -1964,14 +2041,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in DFArrayKokkos 7D!"); - assert(i < dims_[0] && "i is out of bounds in DFArrayKokkos 7D!"); - assert(j < dims_[1] && "j is out of bounds in DFArrayKokkos 7D!"); - assert(k < dims_[2] && "k is out of bounds in DFArrayKokkos 7D!"); - assert(l < dims_[3] && "l is out of bounds in DFArrayKokkos 7D!"); - assert(m < dims_[4] && "m is out of bounds in DFArrayKokkos 7D!"); - assert(n < dims_[5] && "n is out of bounds in DFArrayKokkos 7D!"); - assert(o < dims_[6] && "o is out of bounds in DFArrayKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DFArrayKokkos"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DFArrayKokkos"); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2016,7 +2093,7 @@ size_t DFArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t DFArrayKokkos::dims(size_t i) const { - assert(i < order_ && "DFArrayKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DFArrayKokkos dims()"); assert(dims_[i]>0 && "Access to DFArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -2374,27 +2451,27 @@ DViewFArrayKokkos::DViewFArrayKokkos(T * inp_ar template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in DViewFArrayKokkos 1D!"); - assert(i < dims_[0] && "i is out of bounds in DViewFArrayKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); return this_array_(i); } template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in DViewFArrayKokkos 2D!"); - assert(i < dims_[0] && "i is out of bounds in DViewFArrayKokkos 2D!"); - assert(j < dims_[1] && "j is out of bounds in DViewFArrayKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); return this_array_(i + (j * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in DViewFArrayKokkos 3D!"); - assert(i < dims_[0] && "i is out of bounds in DViewFArrayKokkos 3D!"); - assert(j < dims_[1] && "j is out of bounds in DViewFArrayKokkos 3D!"); - assert(k < dims_[2] && "k is out of bounds in DViewFArrayKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1])); } @@ -2402,11 +2479,11 @@ T& DViewFArrayKokkos::operator()(size_t i, size template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in DViewFArrayKokkos 4D!"); - assert(i < dims_[0] && "i is out of bounds in DViewFArrayKokkos 4D!"); - assert(j < dims_[1] && "j is out of bounds in DViewFArrayKokkos 4D!"); - assert(k < dims_[2] && "k is out of bounds in DViewFArrayKokkos 4D!"); - assert(l < dims_[3] && "l is out of bounds in DViewFArrayKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2])); @@ -2416,12 +2493,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in DViewFArrayKokkos 5D!"); - assert(i < dims_[0] && "i is out of bounds in DViewFArrayKokkos 5D!"); - assert(j < dims_[1] && "j is out of bounds in DViewFArrayKokkos 5D!"); - assert(k < dims_[2] && "k is out of bounds in DViewFArrayKokkos 5D!"); - assert(l < dims_[3] && "l is out of bounds in DViewFArrayKokkos 5D!"); - assert(m < dims_[4] && "m is out of bounds in DViewFArrayKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2432,13 +2509,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in DViewFArrayKokkos 6D!"); - assert(i < dims_[0] && "i is out of bounds in DViewFArrayKokkos 6D!"); - assert(j < dims_[1] && "j is out of bounds in DViewFArrayKokkos 6D!"); - assert(k < dims_[2] && "k is out of bounds in DViewFArrayKokkos 6D!"); - assert(l < dims_[3] && "l is out of bounds in DViewFArrayKokkos 6D!"); - assert(m < dims_[4] && "m is out of bounds in DViewFArrayKokkos 6D!"); - assert(n < dims_[5] && "n is out of bounds in DViewFArrayKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewFArrayKokkos"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2450,14 +2527,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in DViewFArrayKokkos 7D!"); - assert(i < dims_[0] && "i is out of bounds in DViewFArrayKokkos 7D!"); - assert(j < dims_[1] && "j is out of bounds in DViewFArrayKokkos 7D!"); - assert(k < dims_[2] && "k is out of bounds in DViewFArrayKokkos 7D!"); - assert(l < dims_[3] && "l is out of bounds in DViewFArrayKokkos 7D!"); - assert(m < dims_[4] && "m is out of bounds in DViewFArrayKokkos 7D!"); - assert(n < dims_[5] && "n is out of bounds in DViewFArrayKokkos 7D!"); - assert(o < dims_[6] && "o is out of bounds in DViewFArrayKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewFArrayKokkos"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DViewFArrayKokkos"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2503,7 +2580,7 @@ size_t DViewFArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t DViewFArrayKokkos::dims(size_t i) const { - assert(i < order_ && "DViewFArrayKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DViewFArrayKokkos dims()"); assert(dims_[i]>0 && "Access to DViewFArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -2796,27 +2873,27 @@ DFMatrixKokkos::DFMatrixKokkos(size_t dim1, siz template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in DFMatrixKokkos 1D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DFMatrixKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); return this_matrix_.view_device()((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in DFMatrixKokkos 2D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DFMatrixKokkos 2D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DFMatrixKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in DFMatrixKokkos 3D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DFMatrixKokkos 3D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DFMatrixKokkos 3D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DFMatrixKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -2824,11 +2901,11 @@ T& DFMatrixKokkos::operator()(size_t i, size_t template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in DFMatrixKokkos 4D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DFMatrixKokkos 4D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DFMatrixKokkos 4D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DFMatrixKokkos 4D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DFMatrixKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); @@ -2838,12 +2915,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in DFMatrixKokkos 5D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DFMatrixKokkos 5D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DFMatrixKokkos 5D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DFMatrixKokkos 5D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DFMatrixKokkos 5D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DFMatrixKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -2854,13 +2931,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in DFMatrixKokkos 6D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DFMatrixKokkos 6D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DFMatrixKokkos 6D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DFMatrixKokkos 6D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DFMatrixKokkos 6D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DFMatrixKokkos 6D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in DFMatrixKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -2872,14 +2949,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in DFMatrixKokkos 7D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DFMatrixKokkos 7D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DFMatrixKokkos 7D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DFMatrixKokkos 7D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DFMatrixKokkos 7D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DFMatrixKokkos 7D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in DFMatrixKokkos 7D!"); - assert(o >= 1 && o <= dims_[6] && "o is out of bounds in DFMatrixKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DFMatrixKokkos"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -2925,7 +3002,7 @@ template ::dims(size_t i) const { i--; - assert(i < order_ && "DFMatrixKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DFMatrixKokkos dims()"); assert(dims_[i]>0 && "Access to DFMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -3267,27 +3344,27 @@ DViewFMatrixKokkos::DViewFMatrixKokkos(T * inp_ template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in DViewFMatrixKokkos 1D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewFMatrixKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); return this_matrix_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in DViewFMatrixKokkos 2D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewFMatrixKokkos 2D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewFMatrixKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); return this_matrix_((i - 1) + ((j - 1) * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in DViewFMatrixKokkos 3D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewFMatrixKokkos 3D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewFMatrixKokkos 3D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DViewFMatrixKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -3295,11 +3372,11 @@ T& DViewFMatrixKokkos::operator()(size_t i, siz template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in DViewFMatrixKokkos 4D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewFMatrixKokkos 4D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewFMatrixKokkos 4D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DViewFMatrixKokkos 4D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DViewFMatrixKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); @@ -3309,12 +3386,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in DViewFMatrixKokkos 5D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewFMatrixKokkos 5D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewFMatrixKokkos 5D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DViewFMatrixKokkos 5D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DViewFMatrixKokkos 5D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DViewFMatrixKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -3325,13 +3402,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in DViewFMatrixKokkos 6D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewFMatrixKokkos 6D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewFMatrixKokkos 6D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DViewFMatrixKokkos 6D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DViewFMatrixKokkos 6D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DViewFMatrixKokkos 6D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in DViewFMatrixKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -3343,14 +3420,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in DViewFMatrixKokkos 7D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewFMatrixKokkos 7D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewFMatrixKokkos 7D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DViewFMatrixKokkos 7D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DViewFMatrixKokkos 7D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DViewFMatrixKokkos 7D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in DViewFMatrixKokkos 7D!"); - assert(o >= 1 && o <= dims_[6] && "o is out of bounds in DViewFMatrixKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewFMatrixKokkos"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -3397,7 +3474,7 @@ template ::dims(size_t i) const { i--; - assert(i < order_ && "DViewFMatrixKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DViewFMatrixKokkos dims()"); assert(dims_[i]>0 && "Access to DViewFMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -3666,27 +3743,27 @@ CArrayKokkos::CArrayKokkos(size_t dim0, size_t template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in CArrayKokkos 1D!"); - assert(i < dims_[0] && "i is out of bounds in CArrayKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "CArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); return this_array_(i); } template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in CArrayKokkos 2D!"); - assert(i < dims_[0] && "i is out of bounds in CArrayKokkos 2D!"); - assert(j < dims_[1] && "j is out of bounds in CArrayKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "CArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in CArrayKokkos 3D!"); - assert(i < dims_[0] && "i is out of bounds in CArrayKokkos 3D!"); - assert(j < dims_[1] && "j is out of bounds in CArrayKokkos 3D!"); - assert(k < dims_[2] && "k is out of bounds in CArrayKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "CArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos"); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -3694,11 +3771,11 @@ T& CArrayKokkos::operator()(size_t i, size_t j, template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in CArrayKokkos 4D!"); - assert(i < dims_[0] && "i is out of bounds in CArrayKokkos 4D!"); - assert(j < dims_[1] && "j is out of bounds in CArrayKokkos 4D!"); - assert(k < dims_[2] && "k is out of bounds in CArrayKokkos 4D!"); - assert(l < dims_[3] && "l is out of bounds in CArrayKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "CArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos"); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -3708,12 +3785,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in CArrayKokkos 5D!"); - assert(i < dims_[0] && "i is out of bounds in CArrayKokkos 5D!"); - assert(j < dims_[1] && "j is out of bounds in CArrayKokkos 5D!"); - assert(k < dims_[2] && "k is out of bounds in CArrayKokkos 5D!"); - assert(l < dims_[3] && "l is out of bounds in CArrayKokkos 5D!"); - assert(m < dims_[4] && "m is out of bounds in CArrayKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "CArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos"); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -3724,13 +3801,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in CArrayKokkos 6D!"); - assert(i < dims_[0] && "i is out of bounds in CArrayKokkos 6D!"); - assert(j < dims_[1] && "j is out of bounds in CArrayKokkos 6D!"); - assert(k < dims_[2] && "k is out of bounds in CArrayKokkos 6D!"); - assert(l < dims_[3] && "l is out of bounds in CArrayKokkos 6D!"); - assert(m < dims_[4] && "m is out of bounds in CArrayKokkos 6D!"); - assert(n < dims_[5] && "n is out of bounds in CArrayKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "CArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "CArrayKokkos"); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -3742,14 +3819,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in CArrayKokkos 7D!"); - assert(i < dims_[0] && "i is out of bounds in CArrayKokkos 7D!"); - assert(j < dims_[1] && "j is out of bounds in CArrayKokkos 7D!"); - assert(k < dims_[2] && "k is out of bounds in CArrayKokkos 7D!"); - assert(l < dims_[3] && "l is out of bounds in CArrayKokkos 7D!"); - assert(m < dims_[4] && "m is out of bounds in CArrayKokkos 7D!"); - assert(n < dims_[5] && "n is out of bounds in CArrayKokkos 7D!"); - assert(o < dims_[6] && "o is out of bounds in CArrayKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "CArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "CArrayKokkos"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "CArrayKokkos"); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -3793,7 +3870,7 @@ size_t CArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t CArrayKokkos::dims(size_t i) const { - assert(i < order_ && "CArrayKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "CArrayKokkos dims()"); assert(dims_[i]>0 && "Access to CArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -4047,27 +4124,27 @@ ViewCArrayKokkos::ViewCArrayKokkos(T* some_array, size_t dim0, template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in ViewCArrayKokkos 1D!"); - assert(i < dims_[0] && "i is out of bounds in ViewCArrayKokkos 1D!"); + MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); return this_array_[i]; } template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in ViewCArrayKokkos 2D!"); - assert(i < dims_[0] && "i is out of bounds in ViewCArrayKokkos 2D!"); - assert(j < dims_[1] && "j is out of bounds in ViewCArrayKokkos 2D!"); + MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); return this_array_[j + (i * dims_[1])]; } template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in ViewCArrayKokkos 3D!"); - assert(i < dims_[0] && "i is out of bounds in ViewCArrayKokkos 3D!"); - assert(j < dims_[1] && "j is out of bounds in ViewCArrayKokkos 3D!"); - assert(k < dims_[2] && "k is out of bounds in ViewCArrayKokkos 3D!"); + MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos"); return this_array_[k + (j * dims_[2]) + (i * dims_[2] * dims_[1])]; } @@ -4076,11 +4153,11 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in ViewCArrayKokkos 4D!"); - assert(i < dims_[0] && "i is out of bounds in ViewCArrayKokkos 4D!"); - assert(j < dims_[1] && "j is out of bounds in ViewCArrayKokkos 4D!"); - assert(k < dims_[2] && "k is out of bounds in ViewCArrayKokkos 4D!"); - assert(l < dims_[3] && "l is out of bounds in ViewCArrayKokkos 4D!"); + MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos"); return this_array_[l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])]; @@ -4090,12 +4167,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in ViewCArrayKokkos 5D!"); - assert(i < dims_[0] && "i is out of bounds in ViewCArrayKokkos 5D!"); - assert(j < dims_[1] && "j is out of bounds in ViewCArrayKokkos 5D!"); - assert(k < dims_[2] && "k is out of bounds in ViewCArrayKokkos 5D!"); - assert(l < dims_[3] && "l is out of bounds in ViewCArrayKokkos 5D!"); - assert(m < dims_[4] && "m is out of bounds in ViewCArrayKokkos 5D!"); + MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos"); return this_array_[m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -4106,13 +4183,13 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in ViewCArrayKokkos 6D!"); - assert(i < dims_[0] && "i is out of bounds in ViewCArrayKokkos 6D!"); - assert(j < dims_[1] && "j is out of bounds in ViewCArrayKokkos 6D!"); - assert(k < dims_[2] && "k is out of bounds in ViewCArrayKokkos 6D!"); - assert(l < dims_[3] && "l is out of bounds in ViewCArrayKokkos 6D!"); - assert(m < dims_[4] && "m is out of bounds in ViewCArrayKokkos 6D!"); - assert(n < dims_[5] && "n is out of bounds in ViewCArrayKokkos 6D!"); + MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewCArrayKokkos"); return this_array_[n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -4124,14 +4201,14 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in ViewCArrayKokkos 7D!"); - assert(i < dims_[0] && "i is out of bounds in ViewCArrayKokkos 7D!"); - assert(j < dims_[1] && "j is out of bounds in ViewCArrayKokkos 7D!"); - assert(k < dims_[2] && "k is out of bounds in ViewCArrayKokkos 7D!"); - assert(l < dims_[3] && "l is out of bounds in ViewCArrayKokkos 7D!"); - assert(m < dims_[4] && "m is out of bounds in ViewCArrayKokkos 7D!"); - assert(n < dims_[5] && "n is out of bounds in ViewCArrayKokkos 7D!"); - assert(o < dims_[6] && "o is out of bounds in ViewCArrayKokkos 7D!"); + MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewCArrayKokkos"); + MATAR_CHECK_BOUNDS_NO_LABEL(o, dims_[6], "o", "ViewCArrayKokkos"); return this_array_[o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -4155,7 +4232,7 @@ size_t ViewCArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t ViewCArrayKokkos::dims(size_t i) const { - assert(i < order_ && "ViewCArrayKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, order_, "i", "ViewCArrayKokkos dims()"); assert(dims_[i]>0 && "Access to ViewCArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -4400,27 +4477,27 @@ CMatrixKokkos::CMatrixKokkos(size_t dim1, size_ template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in CMatrixKokkos 1D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in CMatrixKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); return this_matrix_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in CMatrixKokkos 2D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in CMatrixKokkos 2D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in CMatrixKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); return this_matrix_((j - 1) + ((i - 1) * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in CMatrixKokkos 3D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in CMatrixKokkos 3D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in CMatrixKokkos 3D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in CMatrixKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos"); return this_matrix_((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -4428,11 +4505,11 @@ T& CMatrixKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in CMatrixKokkos 4D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in CMatrixKokkos 4D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in CMatrixKokkos 4D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in CMatrixKokkos 4D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in CMatrixKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos"); return this_matrix_((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); @@ -4442,12 +4519,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in CMatrixKokkos 5D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in CMatrixKokkos 5D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in CMatrixKokkos 5D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in CMatrixKokkos 5D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in CMatrixKokkos 5D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in CMatrixKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos"); return this_matrix_((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -4458,13 +4535,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in CMatrixKokkos 6D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in CMatrixKokkos 6D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in CMatrixKokkos 6D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in CMatrixKokkos 6D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in CMatrixKokkos 6D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in CMatrixKokkos 6D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in CMatrixKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos"); return this_matrix_((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -4476,14 +4553,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in CMatrixKokkos 7D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in CMatrixKokkos 7D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in CMatrixKokkos 7D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in CMatrixKokkos 7D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in CMatrixKokkos 7D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in CMatrixKokkos 7D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in CMatrixKokkos 7D!"); - assert(o >= 1 && o <= dims_[6] && "o is out of bounds in CMatrixKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "CMatrixKokkos"); return this_matrix_((o-1) + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -4528,7 +4605,7 @@ template ::dims(size_t i) const { i--; - assert(i < order_ && "CMatrixKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "CMatrixKokkos dims()"); assert(dims_[i]>0 && "Access to CMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -4774,27 +4851,27 @@ ViewCMatrixKokkos::ViewCMatrixKokkos(T* some_matrix, size_t dim1, size_t dim2 template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in ViewCMatrixKokkos 1D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in ViewCMatrixKokkos 1D!"); + MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); return this_matrix_[(i - 1)]; } template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in ViewCMatrixKokkos 2D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in ViewCMatrixKokkos 2D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in ViewCMatrixKokkos 2D!"); + MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); return this_matrix_[(j - 1) + ((i - 1) * dims_[1])]; } template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in ViewCMatrixKokkos 3D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in ViewCMatrixKokkos 3D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in ViewCMatrixKokkos 3D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in ViewCMatrixKokkos 3D!"); + MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos"); return this_matrix_[(k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])]; } @@ -4802,11 +4879,11 @@ T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j , size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in ViewCMatrixKokkos 4D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in ViewCMatrixKokkos 4D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in ViewCMatrixKokkos 4D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in ViewCMatrixKokkos 4D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in ViewCMatrixKokkos 4D!"); + MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos"); return this_matrix_[(l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])]; @@ -4816,12 +4893,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in ViewCMatrixKokkos 5D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds for ViewCMatrixKokkos 5D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds for ViewCMatrixKokkos 5D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds for ViewCMatrixKokkos 5D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds for ViewCMatrixKokkos 5D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds for ViewCMatrixKokkos 5D!"); + MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos"); return this_matrix_[(m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -4832,13 +4909,13 @@ template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in ViewCMatrixKokkos 6D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds for ViewCMatrixKokkos 6D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds for ViewCMatrixKokkos 6D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds for ViewCMatrixKokkos 6D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds for ViewCMatrixKokkos 6D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds for ViewCMatrixKokkos 6D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds for ViewCMatrixKokkos 6D!"); + MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewCMatrixKokkos"); return this_matrix_[(n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -4850,14 +4927,14 @@ template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in ViewCMatrixKokkos 7D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds for ViewCMatrixKokkos 7D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds for ViewCMatrixKokkos 7D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds for ViewCMatrixKokkos 7D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds for ViewCMatrixKokkos 7D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds for ViewCMatrixKokkos 7D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds for ViewCMatrixKokkos 7D!"); - assert(o >= 1 && o <= dims_[6] && "o is out of bounds for ViewCMatrixKokkos 7D!"); + MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(o, dims_[6], "o", "ViewCMatrixKokkos"); return this_matrix_[o + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -4883,7 +4960,7 @@ template KOKKOS_INLINE_FUNCTION size_t ViewCMatrixKokkos::dims(size_t i) const { i--; - assert(i < order_ && "ViewCMatrixKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, order_, "i", "ViewCMatrixKokkos dims()"); assert(dims_[i]>0 && "Access to ViewCMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -5156,27 +5233,27 @@ DCArrayKokkos::DCArrayKokkos(size_t dim0, size_ template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in DCArrayKokkos 1D!"); - assert(i < dims_[0] && "i is out of bounds in DCArrayKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); return this_array_.view_device()(i); } template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in DCArrayKokkos 2D!"); - assert(i < dims_[0] && "i is out of bounds in DCArrayKokkos 2D!"); - assert(j < dims_[1] && "j is out of bounds in DCArrayKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); return this_array_.view_device()(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in DCArrayKokkos 3D!"); - assert(i < dims_[0] && "i is out of bounds in DCArrayKokkos 3D!"); - assert(j < dims_[1] && "j is out of bounds in DCArrayKokkos 3D!"); - assert(k < dims_[2] && "k is out of bounds in DCArrayKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos"); return this_array_.view_device()(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -5184,11 +5261,11 @@ T& DCArrayKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in DCArrayKokkos 4D!"); - assert(i < dims_[0] && "i is out of bounds in DCArrayKokkos 4D!"); - assert(j < dims_[1] && "j is out of bounds in DCArrayKokkos 4D!"); - assert(k < dims_[2] && "k is out of bounds in DCArrayKokkos 4D!"); - assert(l < dims_[3] && "l is out of bounds in DCArrayKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos"); return this_array_.view_device()(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -5198,12 +5275,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in DCArrayKokkos 5D!"); - assert(i < dims_[0] && "i is out of bounds in DCArrayKokkos 5D!"); - assert(j < dims_[1] && "j is out of bounds in DCArrayKokkos 5D!"); - assert(k < dims_[2] && "k is out of bounds in DCArrayKokkos 5D!"); - assert(l < dims_[3] && "l is out of bounds in DCArrayKokkos 5D!"); - assert(m < dims_[4] && "m is out of bounds in DCArrayKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos"); return this_array_.view_device()(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -5214,13 +5291,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in DCArrayKokkos 6D!"); - assert(i < dims_[0] && "i is out of bounds in DCArrayKokkos 6D!"); - assert(j < dims_[1] && "j is out of bounds in DCArrayKokkos 6D!"); - assert(k < dims_[2] && "k is out of bounds in DCArrayKokkos 6D!"); - assert(l < dims_[3] && "l is out of bounds in DCArrayKokkos 6D!"); - assert(m < dims_[4] && "m is out of bounds in DCArrayKokkos 6D!"); - assert(n < dims_[5] && "n is out of bounds in DCArrayKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DCArrayKokkos"); return this_array_.view_device()(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -5232,14 +5309,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in DCArrayKokkos 7D!"); - assert(i < dims_[0] && "i is out of bounds in DCArrayKokkos 7D!"); - assert(j < dims_[1] && "j is out of bounds in DCArrayKokkos 7D!"); - assert(k < dims_[2] && "k is out of bounds in DCArrayKokkos 7D!"); - assert(l < dims_[3] && "l is out of bounds in DCArrayKokkos 7D!"); - assert(m < dims_[4] && "m is out of bounds in DCArrayKokkos 7D!"); - assert(n < dims_[5] && "n is out of bounds in DCArrayKokkos 7D!"); - assert(o < dims_[6] && "o is out of bounds in DCArrayKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DCArrayKokkos"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DCArrayKokkos"); return this_array_.view_device()(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -5284,7 +5361,7 @@ size_t DCArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t DCArrayKokkos::dims(size_t i) const { - assert(i < order_ && "DCArrayKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DCArrayKokkos dims()"); assert(dims_[i]>0 && "Access to DCArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -5650,27 +5727,27 @@ DViewCArrayKokkos::DViewCArrayKokkos(T * inp_ar template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in DViewCArrayKokkos 1D!"); - assert(i < dims_[0] && "i is out of bounds in DViewCArrayKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); return this_array_(i); } template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in DViewCArrayKokkos 2D!"); - assert(i < dims_[0] && "i is out of bounds in DViewCArrayKokkos 2D!"); - assert(j < dims_[1] && "j is out of bounds in DViewCArrayKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in DViewCArrayKokkos 3D!"); - assert(i < dims_[0] && "i is out of bounds in DViewCArrayKokkos 3D!"); - assert(j < dims_[1] && "j is out of bounds in DViewCArrayKokkos 3D!"); - assert(k < dims_[2] && "k is out of bounds in DViewCArrayKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos"); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -5678,11 +5755,11 @@ T& DViewCArrayKokkos::operator()(size_t i, size template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in DViewCArrayKokkos 4D!"); - assert(i < dims_[0] && "i is out of bounds in DViewCArrayKokkos 4D!"); - assert(j < dims_[1] && "j is out of bounds in DViewCArrayKokkos 4D!"); - assert(k < dims_[2] && "k is out of bounds in DViewCArrayKokkos 4D!"); - assert(l < dims_[3] && "l is out of bounds in DViewCArrayKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos"); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -5692,12 +5769,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in DViewCArrayKokkos 5D!"); - assert(i < dims_[0] && "i is out of bounds in DViewCArrayKokkos 5D!"); - assert(j < dims_[1] && "j is out of bounds in DViewCArrayKokkos 5D!"); - assert(k < dims_[2] && "k is out of bounds in DViewCArrayKokkos 5D!"); - assert(l < dims_[3] && "l is out of bounds in DViewCArrayKokkos 5D!"); - assert(m < dims_[4] && "m is out of bounds in DViewCArrayKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos"); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -5708,13 +5785,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in DViewCArrayKokkos 6D!"); - assert(i < dims_[0] && "i is out of bounds in DViewCArrayKokkos 6D!"); - assert(j < dims_[1] && "j is out of bounds in DViewCArrayKokkos 6D!"); - assert(k < dims_[2] && "k is out of bounds in DViewCArrayKokkos 6D!"); - assert(l < dims_[3] && "l is out of bounds in DViewCArrayKokkos 6D!"); - assert(m < dims_[4] && "m is out of bounds in DViewCArrayKokkos 6D!"); - assert(n < dims_[5] && "n is out of bounds in DViewCArrayKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewCArrayKokkos"); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -5726,14 +5803,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in DViewCArrayKokkos 7D!"); - assert(i < dims_[0] && "i is out of bounds in DViewCArrayKokkos 7D!"); - assert(j < dims_[1] && "j is out of bounds in DViewCArrayKokkos 7D!"); - assert(k < dims_[2] && "k is out of bounds in DViewCArrayKokkos 7D!"); - assert(l < dims_[3] && "l is out of bounds in DViewCArrayKokkos 7D!"); - assert(m < dims_[4] && "m is out of bounds in DViewCArrayKokkos 7D!"); - assert(n < dims_[5] && "n is out of bounds in DViewCArrayKokkos 7D!"); - assert(o < dims_[6] && "o is out of bounds in DViewCArrayKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewCArrayKokkos"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DViewCArrayKokkos"); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -5780,7 +5857,7 @@ size_t DViewCArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t DViewCArrayKokkos::dims(size_t i) const { - assert(i < order_ && "DViewCArrayKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DViewCArrayKokkos dims()"); assert(dims_[i]>0 && "Access to DViewCArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -6071,27 +6148,27 @@ DCMatrixKokkos::DCMatrixKokkos(size_t dim1, siz template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in DCMatrixKokkos 1D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DCMatrixKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); return this_matrix_.view_device()((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in DCMatrixKokkos 2D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DCMatrixKokkos 2D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DCMatrixKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); return this_matrix_.view_device()((j - 1) + ((i - 1) * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in DCMatrixKokkos 3D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DCMatrixKokkos 3D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DCMatrixKokkos 3D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DCMatrixKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos"); return this_matrix_.view_device()((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -6099,11 +6176,11 @@ T& DCMatrixKokkos::operator()(size_t i, size_t template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in DCMatrixKokkos 4D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DCMatrixKokkos 4D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DCMatrixKokkos 4D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DCMatrixKokkos 4D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DCMatrixKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos"); return this_matrix_.view_device()((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); @@ -6113,12 +6190,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in DCMatrixKokkos 5D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DCMatrixKokkos 5D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DCMatrixKokkos 5D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DCMatrixKokkos 5D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DCMatrixKokkos 5D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DCMatrixKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos"); return this_matrix_.view_device()((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -6129,13 +6206,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in DCMatrixKokkos 6D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DCMatrixKokkos 6D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DCMatrixKokkos 6D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DCMatrixKokkos 6D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DCMatrixKokkos 6D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DCMatrixKokkos 6D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in DCMatrixKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos"); return this_matrix_.view_device()((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -6147,14 +6224,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in DCMatrixKokkos 7D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DCMatrixKokkos 7D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DCMatrixKokkos 7D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DCMatrixKokkos 7D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DCMatrixKokkos 7D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DCMatrixKokkos 7D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in DCMatrixKokkos 7D!"); - assert(o >= 1 && o <= dims_[6] && "o is out of bounds in DCMatrixKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DCMatrixKokkos"); return this_matrix_.view_device()((o-1) + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -6200,7 +6277,7 @@ template ::dims(size_t i) const { i--; - assert(i < order_ && "DCMatrixKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DCMatrixKokkos dims()"); assert(dims_[i]>0 && "Access to DCMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -6540,27 +6617,27 @@ DViewCMatrixKokkos::DViewCMatrixKokkos(T * inp_ template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in DViewCMatrixKokkos 1D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewCMatrixKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); return this_matrix_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in DViewCMatrixKokkos 2D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewCMatrixKokkos 2D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewCMatrixKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); return this_matrix_((j - 1) + ((i - 1) * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in DViewCMatrixKokkos 3D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewCMatrixKokkos 3D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewCMatrixKokkos 3D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DViewCMatrixKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos"); return this_matrix_((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -6568,11 +6645,11 @@ T& DViewCMatrixKokkos::operator()(size_t i, siz template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in DViewCMatrixKokkos 4D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewCMatrixKokkos 4D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewCMatrixKokkos 4D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DViewCMatrixKokkos 4D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DViewCMatrixKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos"); return this_matrix_((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); @@ -6582,12 +6659,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in DViewCMatrixKokkos 5D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewCMatrixKokkos 5D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewCMatrixKokkos 5D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DViewCMatrixKokkos 5D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DViewCMatrixKokkos 5D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DViewCMatrixKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos"); return this_matrix_((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -6598,13 +6675,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in DViewCMatrixKokkos 6D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewCMatrixKokkos 6D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewCMatrixKokkos 6D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DViewCMatrixKokkos 6D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DViewCMatrixKokkos 6D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DViewCMatrixKokkos 6D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in DViewCMatrixKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos"); return this_matrix_((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -6616,14 +6693,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in DViewCMatrixKokkos 7D!"); - assert(i >= 1 && i <= dims_[0] && "i is out of bounds in DViewCMatrixKokkos 7D!"); - assert(j >= 1 && j <= dims_[1] && "j is out of bounds in DViewCMatrixKokkos 7D!"); - assert(k >= 1 && k <= dims_[2] && "k is out of bounds in DViewCMatrixKokkos 7D!"); - assert(l >= 1 && l <= dims_[3] && "l is out of bounds in DViewCMatrixKokkos 7D!"); - assert(m >= 1 && m <= dims_[4] && "m is out of bounds in DViewCMatrixKokkos 7D!"); - assert(n >= 1 && n <= dims_[5] && "n is out of bounds in DViewCMatrixKokkos 7D!"); - assert(o >= 1 && o <= dims_[6] && "o is out of bounds in DViewCMatrixKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewCMatrixKokkos"); return this_matrix_(o + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -6670,7 +6747,7 @@ template ::dims(size_t i) const { i--; - assert(i < order_ && "DViewCMatrixKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DViewCMatrixKokkos dims()"); assert(dims_[i]>0 && "Access to DViewCMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -7247,7 +7324,7 @@ template ::stride(size_t i) const { // Ensure that i is within bounds - assert(i < (dims_[0]) && "i is greater than dims_[0] in DRaggedRightArray"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); return mystrides_dev_(i); } @@ -7257,7 +7334,7 @@ KOKKOS_INLINE_FUNCTION size_t DRaggedRightArrayKokkos::dims(size_t i) const { // Ensure that i is within bounds assert(i >= 0 && "i is less than 0 in the DRaggedRightArrayKokkos class"); - assert(i < 3 && "i is greater than 2 in the DRaggedRightArrayKokkos class"); + MATAR_CHECK_BOUNDS(i, 3, "i", "DRaggedRightArrayKokkos dims()"); return dims_[i]; } @@ -7265,7 +7342,7 @@ size_t DRaggedRightArrayKokkos::dims(si template size_t DRaggedRightArrayKokkos::stride_host(size_t i) const { // Ensure that i is within bounds - assert(i < (dims_[0]) && "i is greater than dims_[0] in DRaggedRightArray"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); return mystrides_host_(i); } @@ -7311,8 +7388,8 @@ T& DRaggedRightArrayKokkos::operator()( size_t start = start_index_dev_(i); // asserts - assert(i < dims_[0] && "i is out of dim1 bounds in DRaggedRightArrayKokkos"); // die if >= dim1 - assert(j < stride(i) && "j is out of stride bounds in DRaggedRightArrayKokkos"); // die if >= stride + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= stride return this_array_dev_(j + start); } // End operator() @@ -7328,9 +7405,9 @@ T& DRaggedRightArrayKokkos::operator()( size_t start = start_index_dev_(i); // asserts - assert(i < dims_[0] && "i is out of dims_[0] bounds in DRaggedRightArrayKokkos"); // die if >= dim0 - assert(j < stride(i) && "j is out of stride bounds in DRaggedRightArrayKokkos"); // die if >= dim1 - assert(k < dims_[1] && "k is out of vector bounds in DRaggedRightArrayKokkos"); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim0 + MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos"); // die if >= dim2 size_t index_1D = start + k + dims_[1]*j; @@ -7348,10 +7425,10 @@ T& DRaggedRightArrayKokkos::operator()( size_t start = start_index_dev_(i); // asserts - assert(i < dims_[0] && "i is out of dims_[0] bounds in DRaggedRightArrayKokkos"); // die if >= dim1 - assert(j < stride(i) && "j is out of stride bounds in DRaggedRightArrayKokkos"); // die if >= stride - assert(k < dims_[1] && "k is out of vector bounds in DRaggedRightArrayKokkos"); // die if >= dims_[1] - assert(l < dims_[2] && "l is out of vector bounds in DRaggedRightArrayKokkos"); // die if >= dims_[2] + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= stride + MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos"); // die if >= dims_[1] + MATAR_CHECK_BOUNDS(l, dims_[2], "l", "DRaggedRightArrayKokkos"); // die if >= dims_[2] size_t index_1D = start + l + dims_[2]*k + dims_[2]*dims_[1]*j; @@ -7366,8 +7443,8 @@ T& DRaggedRightArrayKokkos::host(size_t size_t start = start_index_host_(i); // asserts - assert(i < dims_[0] && "i is out of dim1 bounds in DRaggedRightArrayKokkos"); // die if >= dim1 - assert(j < stride_host(i) && "j is out of stride bounds in DRaggedRightArrayKokkos"); // die if >= stride + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride_host(i), "j", "DRaggedRightArrayKokkos"); // die if >= stride return this_array_host_(j + start); } // End operator() @@ -7381,9 +7458,9 @@ T& DRaggedRightArrayKokkos::host(size_t size_t start = start_index_host_(i); // asserts - assert(i < dims_[0] && "i is out of dims_[0] bounds in DRaggedRightArrayKokkos"); // die if >= dim0 - assert(j < stride_host(i) && "j is out of stride bounds in DRaggedRightArrayKokkos"); // die if >= dim1 - assert(k < dims_[1] && "k is out of vector bounds in DRaggedRightArrayKokkos"); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim0 + MATAR_CHECK_BOUNDS(j, stride_host(i), "j", "DRaggedRightArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos"); // die if >= dim2 size_t index_1D = start + k + dims_[1]*j; @@ -7399,10 +7476,10 @@ T& DRaggedRightArrayKokkos::host(size_t size_t start = start_index_host_(i); // asserts - assert(i < dims_[0] && "i is out of dims_[0] bounds in DRaggedRightArrayKokkos"); // die if >= dim1 - assert(j < stride_host(i) && "j is out of stride bounds in DRaggedRightArrayKokkos"); // die if >= stride - assert(k < dims_[1] && "k is out of vector bounds in DRaggedRightArrayKokkos"); // die if >= dims_[1] - assert(l < dims_[2] && "l is out of vector bounds in DRaggedRightArrayKokkos"); // die if >= dims_[2] + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride_host(i), "j", "DRaggedRightArrayKokkos"); // die if >= stride + MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos"); // die if >= dims_[1] + MATAR_CHECK_BOUNDS(l, dims_[2], "l", "DRaggedRightArrayKokkos"); // die if >= dims_[2] size_t index_1D = start + l + dims_[2]*k + dims_[2]*dims_[1]*j; @@ -7806,9 +7883,9 @@ DynamicArrayKokkos::DynamicArrayKokkos(size_t d template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in DynamicArrayKokkos 1D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicArrayKokkos 1D!"); - assert(i < dims_actual_size_[0] && "i is out of bounds in DynamicArrayKokkos 1D dims_actual_size!"); + MATAR_CHECK_ORDER(1, order_, "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_actual_size_[0], "i", "DynamicArrayKokkos"); return this_array_(i); } @@ -7816,19 +7893,19 @@ T& DynamicArrayKokkos::operator()(size_t i) con template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in DynamicArrayKokkos 2D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicArrayKokkos 2D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicArrayKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in DynamicArrayKokkos 3D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicArrayKokkos 3D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicArrayKokkos 3D!"); - assert(k < dims_[2] && "k is out of bounds in DynamicArrayKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos"); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -7836,11 +7913,11 @@ T& DynamicArrayKokkos::operator()(size_t i, siz template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in DynamicArrayKokkos 4D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicArrayKokkos 4D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicArrayKokkos 4D!"); - assert(k < dims_[2] && "k is out of bounds in DynamicArrayKokkos 4D!"); - assert(l < dims_[3] && "l is out of bounds in DynamicArrayKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos"); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -7850,12 +7927,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in DynamicArrayKokkos 5D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicArrayKokkos 5D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicArrayKokkos 5D!"); - assert(k < dims_[2] && "k is out of bounds in DynamicArrayKokkos 5D!"); - assert(l < dims_[3] && "l is out of bounds in DynamicArrayKokkos 5D!"); - assert(m < dims_[4] && "m is out of bounds in DynamicArrayKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos"); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -7866,13 +7943,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in DynamicArrayKokkos 6D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicArrayKokkos 6D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicArrayKokkos 6D!"); - assert(k < dims_[2] && "k is out of bounds in DynamicArrayKokkos 6D!"); - assert(l < dims_[3] && "l is out of bounds in DynamicArrayKokkos 6D!"); - assert(m < dims_[4] && "m is out of bounds in DynamicArrayKokkos 6D!"); - assert(n < dims_[5] && "n is out of bounds in DynamicArrayKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicArrayKokkos"); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -7884,14 +7961,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in DynamicArrayKokkos 7D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicArrayKokkos 7D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicArrayKokkos 7D!"); - assert(k < dims_[2] && "k is out of bounds in DynamicArrayKokkos 7D!"); - assert(l < dims_[3] && "l is out of bounds in DynamicArrayKokkos 7D!"); - assert(m < dims_[4] && "m is out of bounds in DynamicArrayKokkos 7D!"); - assert(n < dims_[5] && "n is out of bounds in DynamicArrayKokkos 7D!"); - assert(o < dims_[6] && "o is out of bounds in DynamicArrayKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DynamicArrayKokkos"); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -7937,7 +8014,7 @@ size_t DynamicArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t DynamicArrayKokkos::dims(size_t i) const { - assert(i <= order_ && "DynamicArrayKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(d, order_ + 1, "i", "DynamicArrayKokkos dims()"); assert(dims_actual_size_[i] >= 0 && "Access to DynamicArrayKokkos dims is out of bounds!"); return dims_actual_size_[i]; } @@ -7945,7 +8022,7 @@ size_t DynamicArrayKokkos::dims(size_t i) const template KOKKOS_INLINE_FUNCTION size_t DynamicArrayKokkos::dims_max(size_t i) const { - assert(i <= order_ && "DynamicArrayKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(d, order_ + 1, "i", "DynamicArrayKokkos dims()"); assert(dims_[i] >= 0 && "Access to DynamicArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -7993,7 +8070,7 @@ const std::string DynamicArrayKokkos::get_name( // set values of array template void DynamicArrayKokkos::set_values(T val, int count) { - assert(count <= dims_[0] && "count is out of bounds in DynamicArrayKokkos set_values!"); + MATAR_CHECK_BOUNDS(count, dims_[0] + 1, "count", "DynamicArrayKokkos"); if (count == -1) { // Only set values for the actual size of the array Kokkos::parallel_for("SetValues_DynamicArrayKokkos", dims_actual_size_[0], KOKKOS_CLASS_LAMBDA(const int i) { @@ -8263,10 +8340,10 @@ DynamicMatrixKokkos::DynamicMatrixKokkos(size_t template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i) const { - assert(order_ == 1 && "Tensor order (rank) does not match constructor in DynamicMatrixKokkos 1D!"); - assert(i <= dims_[0] && "i is out of bounds in DynamicMatrixKokkos 1D!"); + MATAR_CHECK_ORDER(1, order_, "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DynamicMatrixKokkos"); assert(i > 0 && "i cannot be 0 in DynamicMatrixKokkos 1D!"); - assert(i <= dims_actual_size_[0] && "i is out of bounds in DynamicArrayKokkos 1D dims_actual_size!"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_actual_size_[0], "i", "DynamicMatrixKokkos"); return this_array_((i-1)); } @@ -8274,19 +8351,19 @@ T& DynamicMatrixKokkos::operator()(size_t i) co template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i, size_t j) const { - assert(order_ == 2 && "Tensor order (rank) does not match constructor in DynamicMatrixKokkos 2D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicMatrixKokkos 2D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicMatrixKokkos 2D!"); + MATAR_CHECK_ORDER(2, order_, "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - assert(order_ == 3 && "Tensor order (rank) does not match constructor in DynamicMatrixKokkos 3D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicMatrixKokkos 3D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicMatrixKokkos 3D!"); - assert(k < dims_[2] && "k is out of bounds in DynamicMatrixKokkos 3D!"); + MATAR_CHECK_ORDER(3, order_, "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos"); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -8294,11 +8371,11 @@ T& DynamicMatrixKokkos::operator()(size_t i, si template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - assert(order_ == 4 && "Tensor order (rank) does not match constructor in DynamicMatrixKokkos 4D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicMatrixKokkos 4D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicMatrixKokkos 4D!"); - assert(k < dims_[2] && "k is out of bounds in DynamicMatrixKokkos 4D!"); - assert(l < dims_[3] && "l is out of bounds in DynamicMatrixKokkos 4D!"); + MATAR_CHECK_ORDER(4, order_, "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos"); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -8308,12 +8385,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - assert(order_ == 5 && "Tensor order (rank) does not match constructor in DynamicMatrixKokkos 5D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicMatrixKokkos 5D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicMatrixKokkos 5D!"); - assert(k < dims_[2] && "k is out of bounds in DynamicMatrixKokkos 5D!"); - assert(l < dims_[3] && "l is out of bounds in DynamicMatrixKokkos 5D!"); - assert(m < dims_[4] && "m is out of bounds in DynamicMatrixKokkos 5D!"); + MATAR_CHECK_ORDER(5, order_, "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos"); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -8324,13 +8401,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - assert(order_ == 6 && "Tensor order (rank) does not match constructor in DynamicMatrixKokkos 6D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicMatrixKokkos 6D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicMatrixKokkos 6D!"); - assert(k < dims_[2] && "k is out of bounds in DynamicMatrixKokkos 6D!"); - assert(l < dims_[3] && "l is out of bounds in DynamicMatrixKokkos 6D!"); - assert(m < dims_[4] && "m is out of bounds in DynamicMatrixKokkos 6D!"); - assert(n < dims_[5] && "n is out of bounds in DynamicMatrixKokkos 6D!"); + MATAR_CHECK_ORDER(6, order_, "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicMatrixKokkos"); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -8342,14 +8419,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - assert(order_ == 7 && "Tensor order (rank) does not match constructor in DynamicMatrixKokkos 7D!"); - assert(i < dims_[0] && "i is out of bounds in DynamicMatrixKokkos 7D!"); - assert(j < dims_[1] && "j is out of bounds in DynamicMatrixKokkos 7D!"); - assert(k < dims_[2] && "k is out of bounds in DynamicMatrixKokkos 7D!"); - assert(l < dims_[3] && "l is out of bounds in DynamicMatrixKokkos 7D!"); - assert(m < dims_[4] && "m is out of bounds in DynamicMatrixKokkos 7D!"); - assert(n < dims_[5] && "n is out of bounds in DynamicMatrixKokkos 7D!"); - assert(o < dims_[6] && "o is out of bounds in DynamicMatrixKokkos 7D!"); + MATAR_CHECK_ORDER(7, order_, "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DynamicMatrixKokkos"); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -8396,7 +8473,7 @@ template ::dims(size_t i) const { i--; - assert(i <= order_ && "DynamicMatrixKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(d, order_ + 1, "i", "DynamicMatrixKokkos dims()"); assert(dims_actual_size_[i] >= 0 && "Access to DynamicMatrixKokkos dims is out of bounds!"); return dims_actual_size_[i]; } @@ -8405,7 +8482,7 @@ template ::dims_max(size_t i) const { i--; - assert(i <= order_ && "DynamicMatrixKokkos order (rank) does not match constructor, dim[i] does not exist!"); + MATAR_CHECK_BOUNDS(d, order_ + 1, "i", "DynamicMatrixKokkos dims()"); assert(dims_[i] >= 0 && "Access to DynamicMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -8453,7 +8530,7 @@ const std::string DynamicMatrixKokkos::get_name // set values of array template void DynamicMatrixKokkos::set_values(T val, int count) { - assert(count <= dims_[0] && "count is out of bounds in DynamicArrayKokkos set_values!"); + MATAR_CHECK_BOUNDS(count, dims_[0] + 1, "count", "DynamicArrayKokkos"); if (count == -1) { // Only set values for the actual size of the array Kokkos::parallel_for("SetValues_DynamicArrayKokkos", dims_actual_size_[0], KOKKOS_CLASS_LAMBDA(const int i) { @@ -8738,7 +8815,7 @@ template ::stride(size_t i) const { // Ensure that i is within bounds - assert(i < (dim1_) && "i is greater than dim1_ in RaggedRightArray"); + MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos"); return mystrides_(i); } @@ -8790,8 +8867,8 @@ T& RaggedRightArrayKokkos::operator()(s size_t start = start_index_(i); // asserts - assert(i < dim1_ && "i is out of dim1 bounds in RaggedRightArrayKokkos"); // die if >= dim1 - assert(j < stride(i) && "j is out of stride bounds in RaggedRightArrayKokkos"); // die if >= stride + MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= stride return array_(j + start); } // End operator() @@ -9177,7 +9254,7 @@ template ::stride(size_t i) const { // Ensure that i is within bounds - assert(i < (dim1_) && "i is greater than dim1_ in RaggedRightArray"); + MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos"); return mystrides_(i); } @@ -9220,9 +9297,9 @@ T& RaggedRightArrayofVectorsKokkos::ope size_t start = start_index_(i); // asserts - assert(i < dim1_ && "i is out of dim1 bounds in RaggedRightArrayKokkos"); // die if >= dim1 - assert(j < stride(i) && "j is out of stride bounds in RaggedRightArrayKokkos"); // die if >= stride - assert(k < vector_dim_ && "k is out of vector_dim bounds in RaggedRightArrayKokkos"); // die if >= vector_dim + MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= stride + MATAR_CHECK_BOUNDS(k, vector_dim_, "k", "RaggedRightArrayKokkos"); // die if >= vector_dim return array_(j*vector_dim_ + start + k); } // End operator() @@ -9492,7 +9569,7 @@ template ::stride(size_t j) const { // Ensure that j is within bounds - assert(j < (dim2_) && "j is greater than dim1_ in RaggedDownArray"); + MATAR_CHECK_BOUNDS(j, dim2_, "j", "RaggedDownArrayKokkos"); return mystrides_(j); } @@ -9506,8 +9583,8 @@ T& RaggedDownArrayKokkos::operator()(si size_t start = start_index_(j); // asserts - assert(i < stride(j) && "i is out of stride bounds in RaggedDownArrayKokkos"); // die if >= stride - assert(j < dim2_ && "j is out of dim1 bounds in RaggedDownArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(i, stride(j), "i", "RaggedDownArrayKokkos"); // die if >= stride + MATAR_CHECK_BOUNDS(j, dim2_, "j", "RaggedDownArrayKokkos"); // die if >= dim1 return array_(i + start); } // End operator() @@ -9795,8 +9872,8 @@ template ::operator()(size_t i, size_t j) const { // Asserts - assert(i < dim1_ && "i is out of dim1 bounds in DynamicRaggedRight"); // die if >= dim1 - assert(j < stride_(i) && "j is out of stride bounds in DynamicRaggedRight"); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, dim1_, "i", "DynamicRaggedRightArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride_(i), "j", "DynamicRaggedRightArrayKokkos"); // die if >= dim2 // Cannot assert on Kokkos View //assert(j < stride_[i] && "j is out of stride bounds in DynamicRaggedRight"); // die if >= stride @@ -10009,7 +10086,7 @@ size_t DynamicRaggedDownArrayKokkos::size() con template KOKKOS_INLINE_FUNCTION size_t DynamicRaggedDownArrayKokkos::dims(size_t i) const { - assert(i < 3 && "DynamicRaggedDownArrayKokkos dims only supports dims(0) or dims(1)!"); + MATAR_CHECK_BOUNDS(i, 3, "i", "DynamicRaggedDownArrayKokkos dims()"); if(i == 0) return dim1_; if(i == 1) return dim2_; } @@ -10021,8 +10098,8 @@ template ::operator()(size_t i, size_t j) const { // Asserts - assert(j < dim2_ && "j is out of dim2 bounds in DynamicRaggedDownArrayKokkos"); // die if >= dim2 - assert(i < stride(j) && "i is out of stride bounds in DynamicRaggedDownArrayKokkos"); // die if >= stride(j) + MATAR_CHECK_BOUNDS(j, dim2_, "j", "RaggedDownArrayKokkos"); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, stride(j), "i", "RaggedDownArrayKokkos"); // die if >= stride(j) // Can't do this assert with a Kokkos View //assert(i < stride_[j] && "i is out of stride bounds in DynamicRaggedDownArrayKokkos"); // die if >= stride @@ -10447,7 +10524,7 @@ void CSRArrayKokkos::to_dense(CArrayKokkos KOKKOS_INLINE_FUNCTION size_t CSRArrayKokkos::stride(size_t i) const { - assert(i <= dim1_ && "Index i out of bounds in CSRArray.stride()"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); return start_index_.data()[i+i] - start_index_.data()[i]; } @@ -10467,14 +10544,14 @@ size_t CSRArrayKokkos::dim1() const{ template KOKKOS_INLINE_FUNCTION T* CSRArrayKokkos::begin(size_t i){ - assert(i <= dim1_ && "i is out of bounds in CSRArray.begin()"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); size_t row_start = start_index_.data()[i]; return &array_.data()[row_start]; } template KOKKOS_INLINE_FUNCTION T* CSRArrayKokkos::end(size_t i){ - assert(i <= dim1_ && "i is out of bounds in CSRArray.end()"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); size_t row_start = start_index_.data()[i+1]; return &array_.data()[row_start]; } @@ -10482,14 +10559,14 @@ T* CSRArrayKokkos::end(size_t i){ template KOKKOS_INLINE_FUNCTION size_t CSRArrayKokkos::begin_index(size_t i) const{ - assert(i <= dim1_ && "i is out of bounds in CSRArray.begin_index()"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); return start_index_.data()[i]; } template KOKKOS_INLINE_FUNCTION size_t CSRArrayKokkos::end_index(size_t i) const{ - assert(i <= dim1_ && "i is out of bounds in CSRArray.begin_index()"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); return start_index_.data()[i+1]; } @@ -10502,14 +10579,14 @@ size_t CSRArrayKokkos::nnz() const{ template KOKKOS_INLINE_FUNCTION size_t CSRArrayKokkos::nnz(size_t i){ - assert(i <= dim1_ && "Index i out of bounds in CSRArray.stride()"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); return start_index_.data()[i+1] - start_index_.data()[i]; } template KOKKOS_INLINE_FUNCTION T& CSRArrayKokkos::get_val_flat(size_t k) const{ - assert(k < nnz_ && "Index k is out of bounds in CSRArray.get_val_flat()"); + MATAR_CHECK_BOUNDS(k, nnz_, "k", "CSRArrayKokkos"); return array_.data()[k]; } @@ -10523,7 +10600,7 @@ T& CSRArrayKokkos::get_val_flat(size_t k) cons template KOKKOS_INLINE_FUNCTION size_t CSRArrayKokkos::get_col_flat(size_t k) const{ - assert(k < nnz_ && "Index k is out of bounds in CSRArray.get_col_lat()"); + MATAR_CHECK_BOUNDS(k, nnz_, "k", "CSRArrayKokkos"); return column_index_.data()[k]; } @@ -10809,8 +10886,8 @@ template KOKKOS_INLINE_FUNCTION T& CSCArrayKokkos::operator()(size_t i, size_t j) const { // Check if the indices are within bounds - assert(i < dim1_ && "i is out of bounds in CSCArray.operator(i,j)"); - assert(j < dim2_ && "j is out of bounds in CSCArray.operator(i,j)"); + MATAR_CHECK_BOUNDS(i, dim1_, "i", "CSCArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dim2_, "j", "CSCArrayKokkos"); size_t col_start = start_index_.data()[j]; size_t col_end = start_index_.data()[j + 1]; @@ -10872,7 +10949,7 @@ CSCArrayKokkos& CSCArrayKokkos KOKKOS_INLINE_FUNCTION size_t CSCArrayKokkos::stride(size_t i) const{ - assert(i < dim2_ && "i is out of bounds in CSCArray.stride()"); + MATAR_CHECK_BOUNDS(i, dim2_, "i", "CSCArrayKokkos"); return start_index_.data()[i+1] - start_index_.data()[i]; } @@ -10892,7 +10969,7 @@ size_t CSCArrayKokkos::dim2() const{ template KOKKOS_INLINE_FUNCTION T* CSCArrayKokkos::begin(size_t i){ - assert(i <= dim2_ && "index i out of bounds at CSCArray.begin()"); + MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos"); size_t col_start = start_index_.data()[i]; return &array_.data()[col_start]; } @@ -10900,7 +10977,7 @@ T* CSCArrayKokkos::begin(size_t i){ template KOKKOS_INLINE_FUNCTION T* CSCArrayKokkos::end(size_t i){ - assert(i <= dim2_ && "index i out of bounds at CSCArray.endt()"); + MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos"); size_t col_start = start_index_.data()[i+1]; return &array_.data()[col_start]; } @@ -10908,14 +10985,14 @@ T* CSCArrayKokkos::end(size_t i){ template KOKKOS_INLINE_FUNCTION size_t CSCArrayKokkos::begin_index(size_t i){ - assert(i <= dim2_ && "index i out of bounds at CSCArray.begin_index()"); + MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos"); return start_index_.data()[i]; } template KOKKOS_INLINE_FUNCTION size_t CSCArrayKokkos::end_index(size_t i){ - assert(i <= dim2_ && "index i out of bounds at CSCArray.end_index()"); + MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos"); return start_index_.data()[i + 1]; } @@ -11198,8 +11275,8 @@ template ::operator()(size_t i, size_t j) const { // Asserts - assert(i < dim1_ && "i is out of dim1 bounds in DDynamicRaggedRightKokkos"); // die if >= dim1 - assert(j < mystrides_dev_(i) && "j is out of stride bounds in DDynamicRaggedRightKokkos"); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, dim1_, "i", "DynamicRaggedRightArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, mystrides_dev_(i), "j", "DDynamicRaggedRightArrayKokkos"); // die if >= dim2 // Cannot assert on Kokkos View //assert(j < stride_[i] && "j is out of stride bounds in DynamicRaggedRight"); // die if >= stride @@ -11211,8 +11288,8 @@ T& DDynamicRaggedRightArrayKokkos::operator()(s template T& DDynamicRaggedRightArrayKokkos::host(size_t i, size_t j) const { // Asserts - assert(i < dim1_ && "i is out of dim1 bounds in DDynamicRaggedRightKokkos"); // die if >= dim1 - assert(j < mystrides_host_(i) && "j is out of stride bounds in DDynamicRaggedRightKokkos"); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, dim1_, "i", "DynamicRaggedRightArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, mystrides_host_(i), "j", "DDynamicRaggedRightArrayKokkos"); // die if >= dim2 // Cannot assert on Kokkos View //assert(j < stride_[i] && "j is out of stride bounds in DynamicRaggedRight"); // die if >= stride @@ -11392,8 +11469,8 @@ InheritedArray2L::InheritedArray2L(size_t some_dim1) { template KOKKOS_INLINE_FUNCTION T& InheritedArray2L::operator()(size_t i, size_t dest) const { - assert(i < dim1_ && "i is out of bounds in InheritedArray2L 1D!"); - assert(dest < 2 && "dest is out of bounds in InheritedArray2L 1D!"); + MATAR_CHECK_BOUNDS(i, dim1_, "i", "InheritedArray2L"); + MATAR_CHECK_BOUNDS_NO_LABEL(dest, 2, "dest", "InheritedArray2L"); if (dest == 0) return h_this_array_(i); else From 1f08ee922e25f8fbbac67f6ea5d4401f95ec999f Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 12 Feb 2026 18:23:40 +0000 Subject: [PATCH 2/8] Remove Location output from bounds checking macros The Location output (__FILE__:__LINE__) was pointing to the header file rather than the user's code, making it unhelpful for debugging. The array label and class name provide sufficient context for identifying which array caused the bounds violation. Co-authored-by: Jacob Moore --- src/include/kokkos_types.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/include/kokkos_types.h b/src/include/kokkos_types.h index 64a1b44d..13a1af3b 100644 --- a/src/include/kokkos_types.h +++ b/src/include/kokkos_types.h @@ -116,7 +116,6 @@ using SHArray1D = Kokkos::View; #define MATAR_CHECK_BOUNDS(i, dim, index_name, class_name) \ if ((i) >= (dim)) { \ printf("\n[MATAR BOUNDS ERROR]\n"); \ - printf(" Location: %s:%d\n", __FILE__, __LINE__); \ printf(" Class: %s\n", class_name); \ printf(" Array Label: %s\n", this_array_.label().c_str()); \ printf(" Index '%s' = %zu is out of bounds (dimension size = %zu)\n\n", \ @@ -128,7 +127,6 @@ using SHArray1D = Kokkos::View; #define MATAR_CHECK_BOUNDS_NO_LABEL(i, dim, index_name, class_name) \ if ((i) >= (dim)) { \ printf("\n[MATAR BOUNDS ERROR]\n"); \ - printf(" Location: %s:%d\n", __FILE__, __LINE__); \ printf(" Class: %s\n", class_name); \ printf(" Index '%s' = %zu is out of bounds (dimension size = %zu)\n\n", \ index_name, (size_t)(i), (size_t)(dim)); \ @@ -139,7 +137,6 @@ using SHArray1D = Kokkos::View; #define MATAR_CHECK_BOUNDS_MATRIX(i, dim, index_name, class_name) \ if ((i) < 1 || (i) > (dim)) { \ printf("\n[MATAR BOUNDS ERROR]\n"); \ - printf(" Location: %s:%d\n", __FILE__, __LINE__); \ printf(" Class: %s\n", class_name); \ printf(" Array Label: %s\n", this_array_.label().c_str()); \ printf(" Index '%s' = %zu is out of bounds (valid range: 1 to %zu)\n\n", \ @@ -151,7 +148,6 @@ using SHArray1D = Kokkos::View; #define MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dim, index_name, class_name) \ if ((i) < 1 || (i) > (dim)) { \ printf("\n[MATAR BOUNDS ERROR]\n"); \ - printf(" Location: %s:%d\n", __FILE__, __LINE__); \ printf(" Class: %s\n", class_name); \ printf(" Index '%s' = %zu is out of bounds (valid range: 1 to %zu)\n\n", \ index_name, (size_t)(i), (size_t)(dim)); \ @@ -162,7 +158,6 @@ using SHArray1D = Kokkos::View; #define MATAR_CHECK_ORDER(expected, actual, class_name) \ if ((expected) != (actual)) { \ printf("\n[MATAR ORDER MISMATCH ERROR]\n"); \ - printf(" Location: %s:%d\n", __FILE__, __LINE__); \ printf(" Class: %s\n", class_name); \ printf(" Array Label: %s\n", this_array_.label().c_str()); \ printf(" Expected order %zu but got %zu\n\n", (size_t)(expected), (size_t)(actual)); \ @@ -173,7 +168,6 @@ using SHArray1D = Kokkos::View; #define MATAR_CHECK_ORDER_NO_LABEL(expected, actual, class_name) \ if ((expected) != (actual)) { \ printf("\n[MATAR ORDER MISMATCH ERROR]\n"); \ - printf(" Location: %s:%d\n", __FILE__, __LINE__); \ printf(" Class: %s\n", class_name); \ printf(" Expected order %zu but got %zu\n\n", (size_t)(expected), (size_t)(actual)); \ assert(false && "MATAR order check failed"); \ From 4f4850a7daeb0c79bf17a00aa2e47fb83c9a75c8 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 12 Feb 2026 18:26:46 +0000 Subject: [PATCH 3/8] Add dimensionality (1D, 2D, etc.) to class names in macros This improves debugging by showing the exact dimension of the array operation that caused a bounds violation, e.g.: [MATAR BOUNDS ERROR] Class: FArrayKokkos 3D Array Label: my_array Index 'k' = 10 is out of bounds (dimension size = 5) Co-authored-by: Jacob Moore --- src/include/kokkos_types.h | 1272 ++++++++++++++++++------------------ 1 file changed, 636 insertions(+), 636 deletions(-) diff --git a/src/include/kokkos_types.h b/src/include/kokkos_types.h index 13a1af3b..43f9f0dc 100644 --- a/src/include/kokkos_types.h +++ b/src/include/kokkos_types.h @@ -446,8 +446,8 @@ FArrayKokkos::FArrayKokkos(size_t dim0, size_t template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()( size_t i) const { - MATAR_CHECK_ORDER(1, order_, "FArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); + MATAR_CHECK_ORDER(1, order_, "FArrayKokkos 1D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 1D"); return this_array_(i); } @@ -455,9 +455,9 @@ T& FArrayKokkos::operator()( size_t i) const { template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "FArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); + MATAR_CHECK_ORDER(2, order_, "FArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 2D"); return this_array_(i + (j * dims_[0])); } @@ -465,10 +465,10 @@ T& FArrayKokkos::operator()(size_t i, size_t j) template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "FArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos"); + MATAR_CHECK_ORDER(3, order_, "FArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 3D"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1])); } @@ -477,11 +477,11 @@ T& FArrayKokkos::operator()(size_t i, size_t j, template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "FArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos"); + MATAR_CHECK_ORDER(4, order_, "FArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 4D"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2])); @@ -492,12 +492,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "FArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos"); + MATAR_CHECK_ORDER(5, order_, "FArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos 5D"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -509,13 +509,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "FArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "FArrayKokkos"); + MATAR_CHECK_ORDER(6, order_, "FArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "FArrayKokkos 6D"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -528,14 +528,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "FArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "FArrayKokkos"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "FArrayKokkos"); + MATAR_CHECK_ORDER(7, order_, "FArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "FArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "FArrayKokkos 7D"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -830,8 +830,8 @@ ViewFArrayKokkos::ViewFArrayKokkos(T *some_array, size_t dim0, size_t dim1, template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewFArrayKokkos 1D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 1D"); return this_array_[i]; } @@ -839,9 +839,9 @@ T& ViewFArrayKokkos::operator()(size_t i) const { template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewFArrayKokkos 2D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 2D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 2D"); return this_array_[i + (j * dims_[0])]; } @@ -849,10 +849,10 @@ T& ViewFArrayKokkos::operator()(size_t i, size_t j) const { template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewFArrayKokkos 3D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 3D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 3D"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos 3D"); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1])]; } @@ -862,11 +862,11 @@ template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos 4D"); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] *dims_[2])]; @@ -877,12 +877,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos 5D"); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -894,13 +894,13 @@ template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewFArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewFArrayKokkos 6D"); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -914,14 +914,14 @@ KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewFArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(o, dims_[6], "o", "ViewFArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(o, dims_[6], "o", "ViewFArrayKokkos 7D"); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -1190,27 +1190,27 @@ FMatrixKokkos::FMatrixKokkos(size_t dim1, size_ template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); + MATAR_CHECK_ORDER(1, order_, "FMatrixKokkos 1D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 1D"); return this_matrix_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); + MATAR_CHECK_ORDER(2, order_, "FMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 2D"); return this_matrix_((i - 1) + ((j - 1) * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos"); + MATAR_CHECK_ORDER(3, order_, "FMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 3D"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -1218,11 +1218,11 @@ T& FMatrixKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos"); + MATAR_CHECK_ORDER(4, order_, "FMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 4D"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); @@ -1232,12 +1232,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos"); + MATAR_CHECK_ORDER(5, order_, "FMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 5D"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1248,13 +1248,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos"); + MATAR_CHECK_ORDER(6, order_, "FMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos 6D"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1266,14 +1266,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "FMatrixKokkos"); + MATAR_CHECK_ORDER(7, order_, "FMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "FMatrixKokkos 7D"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1574,17 +1574,17 @@ ViewFMatrixKokkos::ViewFMatrixKokkos(T* some_matrix, size_t dim1, template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewFMatrixKokkos 1D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 1D"); return this_matrix_[(i - 1)]; } template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewFMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 2D"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0])]; } @@ -1592,10 +1592,10 @@ template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewFMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 3D"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])]; @@ -1605,11 +1605,11 @@ template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos 4D"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])]; @@ -1619,12 +1619,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos 5D"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1636,13 +1636,13 @@ KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewFMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewFMatrixKokkos 6D"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1655,14 +1655,14 @@ KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(o, dims_[6], "o", "ViewFMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(o, dims_[6], "o", "ViewFMatrixKokkos 7D"); return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1959,27 +1959,27 @@ DFArrayKokkos::DFArrayKokkos(size_t dim0, size_ template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); + MATAR_CHECK_ORDER(1, order_, "DFArrayKokkos 1D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 1D"); return this_array_.view_device()(i); } template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); + MATAR_CHECK_ORDER(2, order_, "DFArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 2D"); return this_array_.view_device()(i + (j * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos"); + MATAR_CHECK_ORDER(3, order_, "DFArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 3D"); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1])); } @@ -1987,11 +1987,11 @@ T& DFArrayKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos"); + MATAR_CHECK_ORDER(4, order_, "DFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 4D"); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2])); @@ -2001,12 +2001,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos"); + MATAR_CHECK_ORDER(5, order_, "DFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos 5D"); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2017,13 +2017,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DFArrayKokkos"); + MATAR_CHECK_ORDER(6, order_, "DFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DFArrayKokkos 6D"); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2035,14 +2035,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DFArrayKokkos"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DFArrayKokkos"); + MATAR_CHECK_ORDER(7, order_, "DFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DFArrayKokkos 7D"); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2445,27 +2445,27 @@ DViewFArrayKokkos::DViewFArrayKokkos(T * inp_ar template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); + MATAR_CHECK_ORDER(1, order_, "DViewFArrayKokkos 1D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 1D"); return this_array_(i); } template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); + MATAR_CHECK_ORDER(2, order_, "DViewFArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 2D"); return this_array_(i + (j * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos"); + MATAR_CHECK_ORDER(3, order_, "DViewFArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 3D"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1])); } @@ -2473,11 +2473,11 @@ T& DViewFArrayKokkos::operator()(size_t i, size template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos"); + MATAR_CHECK_ORDER(4, order_, "DViewFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 4D"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2])); @@ -2487,12 +2487,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos"); + MATAR_CHECK_ORDER(5, order_, "DViewFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos 5D"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2503,13 +2503,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewFArrayKokkos"); + MATAR_CHECK_ORDER(6, order_, "DViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewFArrayKokkos 6D"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2521,14 +2521,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewFArrayKokkos"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DViewFArrayKokkos"); + MATAR_CHECK_ORDER(7, order_, "DViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewFArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DViewFArrayKokkos 7D"); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2867,27 +2867,27 @@ DFMatrixKokkos::DFMatrixKokkos(size_t dim1, siz template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); + MATAR_CHECK_ORDER(1, order_, "DFMatrixKokkos 1D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 1D"); return this_matrix_.view_device()((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); + MATAR_CHECK_ORDER(2, order_, "DFMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 2D"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos"); + MATAR_CHECK_ORDER(3, order_, "DFMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 3D"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -2895,11 +2895,11 @@ T& DFMatrixKokkos::operator()(size_t i, size_t template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos"); + MATAR_CHECK_ORDER(4, order_, "DFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 4D"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); @@ -2909,12 +2909,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos"); + MATAR_CHECK_ORDER(5, order_, "DFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 5D"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -2925,13 +2925,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos"); + MATAR_CHECK_ORDER(6, order_, "DFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos 6D"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -2943,14 +2943,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DFMatrixKokkos"); + MATAR_CHECK_ORDER(7, order_, "DFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DFMatrixKokkos 7D"); return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -3338,27 +3338,27 @@ DViewFMatrixKokkos::DViewFMatrixKokkos(T * inp_ template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); + MATAR_CHECK_ORDER(1, order_, "DViewFMatrixKokkos 1D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 1D"); return this_matrix_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); + MATAR_CHECK_ORDER(2, order_, "DViewFMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 2D"); return this_matrix_((i - 1) + ((j - 1) * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos"); + MATAR_CHECK_ORDER(3, order_, "DViewFMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 3D"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -3366,11 +3366,11 @@ T& DViewFMatrixKokkos::operator()(size_t i, siz template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos"); + MATAR_CHECK_ORDER(4, order_, "DViewFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 4D"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); @@ -3380,12 +3380,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos"); + MATAR_CHECK_ORDER(5, order_, "DViewFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 5D"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -3396,13 +3396,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos"); + MATAR_CHECK_ORDER(6, order_, "DViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos 6D"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -3414,14 +3414,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewFMatrixKokkos"); + MATAR_CHECK_ORDER(7, order_, "DViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewFMatrixKokkos 7D"); return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -3737,27 +3737,27 @@ CArrayKokkos::CArrayKokkos(size_t dim0, size_t template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "CArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); + MATAR_CHECK_ORDER(1, order_, "CArrayKokkos 1D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 1D"); return this_array_(i); } template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "CArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); + MATAR_CHECK_ORDER(2, order_, "CArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 2D"); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "CArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos"); + MATAR_CHECK_ORDER(3, order_, "CArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 3D"); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -3765,11 +3765,11 @@ T& CArrayKokkos::operator()(size_t i, size_t j, template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "CArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos"); + MATAR_CHECK_ORDER(4, order_, "CArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 4D"); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -3779,12 +3779,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "CArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos"); + MATAR_CHECK_ORDER(5, order_, "CArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos 5D"); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -3795,13 +3795,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "CArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "CArrayKokkos"); + MATAR_CHECK_ORDER(6, order_, "CArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "CArrayKokkos 6D"); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -3813,14 +3813,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "CArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "CArrayKokkos"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "CArrayKokkos"); + MATAR_CHECK_ORDER(7, order_, "CArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "CArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "CArrayKokkos 7D"); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -4118,27 +4118,27 @@ ViewCArrayKokkos::ViewCArrayKokkos(T* some_array, size_t dim0, template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewCArrayKokkos 1D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 1D"); return this_array_[i]; } template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewCArrayKokkos 2D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 2D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 2D"); return this_array_[j + (i * dims_[1])]; } template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewCArrayKokkos 3D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 3D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 3D"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos 3D"); return this_array_[k + (j * dims_[2]) + (i * dims_[2] * dims_[1])]; } @@ -4147,11 +4147,11 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos 4D"); return this_array_[l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])]; @@ -4161,12 +4161,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos 5D"); return this_array_[m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -4177,13 +4177,13 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewCArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewCArrayKokkos 6D"); return this_array_[n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -4195,14 +4195,14 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewCArrayKokkos"); - MATAR_CHECK_BOUNDS_NO_LABEL(o, dims_[6], "o", "ViewCArrayKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS_NO_LABEL(o, dims_[6], "o", "ViewCArrayKokkos 7D"); return this_array_[o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -4471,27 +4471,27 @@ CMatrixKokkos::CMatrixKokkos(size_t dim1, size_ template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); + MATAR_CHECK_ORDER(1, order_, "CMatrixKokkos 1D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 1D"); return this_matrix_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); + MATAR_CHECK_ORDER(2, order_, "CMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 2D"); return this_matrix_((j - 1) + ((i - 1) * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos"); + MATAR_CHECK_ORDER(3, order_, "CMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 3D"); return this_matrix_((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -4499,11 +4499,11 @@ T& CMatrixKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos"); + MATAR_CHECK_ORDER(4, order_, "CMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 4D"); return this_matrix_((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); @@ -4513,12 +4513,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos"); + MATAR_CHECK_ORDER(5, order_, "CMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 5D"); return this_matrix_((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -4529,13 +4529,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos"); + MATAR_CHECK_ORDER(6, order_, "CMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos 6D"); return this_matrix_((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -4547,14 +4547,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "CMatrixKokkos"); + MATAR_CHECK_ORDER(7, order_, "CMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "CMatrixKokkos 7D"); return this_matrix_((o-1) + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -4845,27 +4845,27 @@ ViewCMatrixKokkos::ViewCMatrixKokkos(T* some_matrix, size_t dim1, size_t dim2 template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewCMatrixKokkos 1D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 1D"); return this_matrix_[(i - 1)]; } template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewCMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 2D"); return this_matrix_[(j - 1) + ((i - 1) * dims_[1])]; } template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewCMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 3D"); return this_matrix_[(k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])]; } @@ -4873,11 +4873,11 @@ T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j , size_t k, size_t l) const { - MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos 4D"); return this_matrix_[(l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])]; @@ -4887,12 +4887,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos 5D"); return this_matrix_[(m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -4903,13 +4903,13 @@ template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewCMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewCMatrixKokkos 6D"); return this_matrix_[(n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -4921,14 +4921,14 @@ template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(o, dims_[6], "o", "ViewCMatrixKokkos"); + MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(o, dims_[6], "o", "ViewCMatrixKokkos 7D"); return this_matrix_[o + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -5227,27 +5227,27 @@ DCArrayKokkos::DCArrayKokkos(size_t dim0, size_ template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); + MATAR_CHECK_ORDER(1, order_, "DCArrayKokkos 1D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 1D"); return this_array_.view_device()(i); } template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); + MATAR_CHECK_ORDER(2, order_, "DCArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 2D"); return this_array_.view_device()(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos"); + MATAR_CHECK_ORDER(3, order_, "DCArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 3D"); return this_array_.view_device()(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -5255,11 +5255,11 @@ T& DCArrayKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos"); + MATAR_CHECK_ORDER(4, order_, "DCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 4D"); return this_array_.view_device()(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -5269,12 +5269,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos"); + MATAR_CHECK_ORDER(5, order_, "DCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos 5D"); return this_array_.view_device()(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -5285,13 +5285,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DCArrayKokkos"); + MATAR_CHECK_ORDER(6, order_, "DCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DCArrayKokkos 6D"); return this_array_.view_device()(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -5303,14 +5303,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DCArrayKokkos"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DCArrayKokkos"); + MATAR_CHECK_ORDER(7, order_, "DCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DCArrayKokkos 7D"); return this_array_.view_device()(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -5721,27 +5721,27 @@ DViewCArrayKokkos::DViewCArrayKokkos(T * inp_ar template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); + MATAR_CHECK_ORDER(1, order_, "DViewCArrayKokkos 1D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 1D"); return this_array_(i); } template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); + MATAR_CHECK_ORDER(2, order_, "DViewCArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 2D"); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos"); + MATAR_CHECK_ORDER(3, order_, "DViewCArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 3D"); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -5749,11 +5749,11 @@ T& DViewCArrayKokkos::operator()(size_t i, size template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos"); + MATAR_CHECK_ORDER(4, order_, "DViewCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 4D"); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -5763,12 +5763,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos"); + MATAR_CHECK_ORDER(5, order_, "DViewCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos 5D"); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -5779,13 +5779,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewCArrayKokkos"); + MATAR_CHECK_ORDER(6, order_, "DViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewCArrayKokkos 6D"); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -5797,14 +5797,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewCArrayKokkos"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DViewCArrayKokkos"); + MATAR_CHECK_ORDER(7, order_, "DViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewCArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DViewCArrayKokkos 7D"); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -6142,27 +6142,27 @@ DCMatrixKokkos::DCMatrixKokkos(size_t dim1, siz template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); + MATAR_CHECK_ORDER(1, order_, "DCMatrixKokkos 1D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 1D"); return this_matrix_.view_device()((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); + MATAR_CHECK_ORDER(2, order_, "DCMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 2D"); return this_matrix_.view_device()((j - 1) + ((i - 1) * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos"); + MATAR_CHECK_ORDER(3, order_, "DCMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 3D"); return this_matrix_.view_device()((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -6170,11 +6170,11 @@ T& DCMatrixKokkos::operator()(size_t i, size_t template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos"); + MATAR_CHECK_ORDER(4, order_, "DCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 4D"); return this_matrix_.view_device()((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); @@ -6184,12 +6184,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos"); + MATAR_CHECK_ORDER(5, order_, "DCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 5D"); return this_matrix_.view_device()((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -6200,13 +6200,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos"); + MATAR_CHECK_ORDER(6, order_, "DCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos 6D"); return this_matrix_.view_device()((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -6218,14 +6218,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DCMatrixKokkos"); + MATAR_CHECK_ORDER(7, order_, "DCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DCMatrixKokkos 7D"); return this_matrix_.view_device()((o-1) + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -6611,27 +6611,27 @@ DViewCMatrixKokkos::DViewCMatrixKokkos(T * inp_ template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); + MATAR_CHECK_ORDER(1, order_, "DViewCMatrixKokkos 1D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 1D"); return this_matrix_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); + MATAR_CHECK_ORDER(2, order_, "DViewCMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 2D"); return this_matrix_((j - 1) + ((i - 1) * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos"); + MATAR_CHECK_ORDER(3, order_, "DViewCMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 3D"); return this_matrix_((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -6639,11 +6639,11 @@ T& DViewCMatrixKokkos::operator()(size_t i, siz template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos"); + MATAR_CHECK_ORDER(4, order_, "DViewCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 4D"); return this_matrix_((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); @@ -6653,12 +6653,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos"); + MATAR_CHECK_ORDER(5, order_, "DViewCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 5D"); return this_matrix_((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -6669,13 +6669,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos"); + MATAR_CHECK_ORDER(6, order_, "DViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos 6D"); return this_matrix_((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -6687,14 +6687,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewCMatrixKokkos"); + MATAR_CHECK_ORDER(7, order_, "DViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewCMatrixKokkos 7D"); return this_matrix_(o + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -7877,9 +7877,9 @@ DynamicArrayKokkos::DynamicArrayKokkos(size_t d template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_actual_size_[0], "i", "DynamicArrayKokkos"); + MATAR_CHECK_ORDER(1, order_, "DynamicArrayKokkos 1D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 1D"); + MATAR_CHECK_BOUNDS(i, dims_actual_size_[0], "i", "DynamicArrayKokkos 1D"); return this_array_(i); } @@ -7887,19 +7887,19 @@ T& DynamicArrayKokkos::operator()(size_t i) con template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); + MATAR_CHECK_ORDER(2, order_, "DynamicArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 2D"); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos"); + MATAR_CHECK_ORDER(3, order_, "DynamicArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 3D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 3D"); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -7907,11 +7907,11 @@ T& DynamicArrayKokkos::operator()(size_t i, siz template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos"); + MATAR_CHECK_ORDER(4, order_, "DynamicArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 4D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 4D"); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -7921,12 +7921,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos"); + MATAR_CHECK_ORDER(5, order_, "DynamicArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 5D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos 5D"); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -7937,13 +7937,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicArrayKokkos"); + MATAR_CHECK_ORDER(6, order_, "DynamicArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos 6D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicArrayKokkos 6D"); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -7955,14 +7955,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicArrayKokkos"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DynamicArrayKokkos"); + MATAR_CHECK_ORDER(7, order_, "DynamicArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicArrayKokkos 7D"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DynamicArrayKokkos 7D"); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -8334,10 +8334,10 @@ DynamicMatrixKokkos::DynamicMatrixKokkos(size_t template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DynamicMatrixKokkos"); + MATAR_CHECK_ORDER(1, order_, "DynamicMatrixKokkos 1D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DynamicMatrixKokkos 1D"); assert(i > 0 && "i cannot be 0 in DynamicMatrixKokkos 1D!"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_actual_size_[0], "i", "DynamicMatrixKokkos"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_actual_size_[0], "i", "DynamicMatrixKokkos 1D"); return this_array_((i-1)); } @@ -8345,19 +8345,19 @@ T& DynamicMatrixKokkos::operator()(size_t i) co template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); + MATAR_CHECK_ORDER(2, order_, "DynamicMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 2D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 2D"); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos"); + MATAR_CHECK_ORDER(3, order_, "DynamicMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 3D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 3D"); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -8365,11 +8365,11 @@ T& DynamicMatrixKokkos::operator()(size_t i, si template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos"); + MATAR_CHECK_ORDER(4, order_, "DynamicMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 4D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 4D"); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -8379,12 +8379,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos"); + MATAR_CHECK_ORDER(5, order_, "DynamicMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 5D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos 5D"); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -8395,13 +8395,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicMatrixKokkos"); + MATAR_CHECK_ORDER(6, order_, "DynamicMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos 6D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicMatrixKokkos 6D"); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -8413,14 +8413,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicMatrixKokkos"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DynamicMatrixKokkos"); + MATAR_CHECK_ORDER(7, order_, "DynamicMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicMatrixKokkos 7D"); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DynamicMatrixKokkos 7D"); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -10880,8 +10880,8 @@ template KOKKOS_INLINE_FUNCTION T& CSCArrayKokkos::operator()(size_t i, size_t j) const { // Check if the indices are within bounds - MATAR_CHECK_BOUNDS(i, dim1_, "i", "CSCArrayKokkos"); - MATAR_CHECK_BOUNDS(j, dim2_, "j", "CSCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim1_, "i", "CSCArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(j, dim2_, "j", "CSCArrayKokkos 2D"); size_t col_start = start_index_.data()[j]; size_t col_end = start_index_.data()[j + 1]; @@ -11463,8 +11463,8 @@ InheritedArray2L::InheritedArray2L(size_t some_dim1) { template KOKKOS_INLINE_FUNCTION T& InheritedArray2L::operator()(size_t i, size_t dest) const { - MATAR_CHECK_BOUNDS(i, dim1_, "i", "InheritedArray2L"); - MATAR_CHECK_BOUNDS_NO_LABEL(dest, 2, "dest", "InheritedArray2L"); + MATAR_CHECK_BOUNDS(i, dim1_, "i", "InheritedArray2L 2D"); + MATAR_CHECK_BOUNDS_NO_LABEL(dest, 2, "dest", "InheritedArray2L 2D"); if (dest == 0) return h_this_array_(i); else From 6ec1ec8ca0b5d62d908157870380b5f684c1deaa Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 12 Feb 2026 20:12:32 +0000 Subject: [PATCH 4/8] Rename this_matrix_ to this_array_ and array_ to this_array_ This fixes compilation errors where the MATAR_CHECK_* macros expected 'this_array_' but matrix classes used 'this_matrix_' and ragged classes used 'array_'. Changes: - Renamed this_matrix_ to this_array_ in all matrix classes (FMatrixKokkos, CMatrixKokkos, ViewFMatrixKokkos, ViewCMatrixKokkos, etc.) - Renamed array_ to this_array_ in all ragged array classes (RaggedRightArrayKokkos, RaggedDownArrayKokkos, CSRArrayKokkos, CSCArrayKokkos, DynamicRaggedRightArrayKokkos, etc.) This ensures consistent naming across all classes and allows the MATAR_CHECK_BOUNDS macros to access the array label for error messages. Co-authored-by: Jacob Moore --- src/include/kokkos_types.h | 566 ++++++++++++++++++------------------- 1 file changed, 283 insertions(+), 283 deletions(-) diff --git a/src/include/kokkos_types.h b/src/include/kokkos_types.h index 43f9f0dc..60377194 100644 --- a/src/include/kokkos_types.h +++ b/src/include/kokkos_types.h @@ -990,7 +990,7 @@ class FMatrixKokkos { size_t dims_[7]; size_t order_; size_t length_; - TArray1D this_matrix_; + TArray1D this_array_; public: FMatrixKokkos(); @@ -1088,7 +1088,7 @@ FMatrixKokkos::FMatrixKokkos(size_t dim1, const dims_[0] = dim1; order_ = 1; length_ = dim1; - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 2D constructor @@ -1100,7 +1100,7 @@ FMatrixKokkos::FMatrixKokkos(size_t dim1, size_ dims_[1] = dim2; order_ = 2; length_ = (dim1 * dim2); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 3D constructor @@ -1114,7 +1114,7 @@ FMatrixKokkos::FMatrixKokkos(size_t dim1, size_ dims_[2] = dim3; order_ = 3; length_ = (dim1 * dim2 * dim3); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 4D constructor @@ -1129,7 +1129,7 @@ FMatrixKokkos::FMatrixKokkos(size_t dim1, size_ dims_[3] = dim4; order_ = 4; length_ = (dim1 * dim2 * dim3 * dim4); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 5D constructor @@ -1146,7 +1146,7 @@ FMatrixKokkos::FMatrixKokkos(size_t dim1, size_ dims_[4] = dim5; order_ = 5; length_ = (dim1 * dim2 * dim3 * dim4 * dim5); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 5D constructor @@ -1164,7 +1164,7 @@ FMatrixKokkos::FMatrixKokkos(size_t dim1, size_ dims_[5] = dim6; order_ = 6; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 5D constructor @@ -1184,7 +1184,7 @@ FMatrixKokkos::FMatrixKokkos(size_t dim1, size_ dims_[6] = dim7; order_ = 7; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6 * dim7); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } template @@ -1192,7 +1192,7 @@ KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i) const { MATAR_CHECK_ORDER(1, order_, "FMatrixKokkos 1D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 1D"); - return this_matrix_((i - 1)); + return this_array_((i - 1)); } template @@ -1201,7 +1201,7 @@ T& FMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_ORDER(2, order_, "FMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 2D"); - return this_matrix_((i - 1) + ((j - 1) * dims_[0])); + return this_array_((i - 1) + ((j - 1) * dims_[0])); } template @@ -1211,7 +1211,7 @@ T& FMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 3D"); - return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -1223,7 +1223,7 @@ T& FMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 4D"); - return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); } @@ -1238,7 +1238,7 @@ T& FMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 5D"); - return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3])); @@ -1255,7 +1255,7 @@ T& FMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos 6D"); - return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3]) @@ -1274,7 +1274,7 @@ T& FMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "FMatrixKokkos 7D"); - return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3]) @@ -1293,7 +1293,7 @@ FMatrixKokkos& FMatrixKokkos::order() const { template KOKKOS_INLINE_FUNCTION T* FMatrixKokkos::pointer() const { - return this_matrix_.data(); + return this_array_.data(); } //return the stored Kokkos view template KOKKOS_INLINE_FUNCTION Kokkos::View FMatrixKokkos::get_kokkos_view() const { - return this_matrix_; + return this_array_; } // Get the name of the view template KOKKOS_INLINE_FUNCTION const std::string FMatrixKokkos::get_name() const{ - return this_matrix_.label(); + return this_array_.label(); } @@ -1352,7 +1352,7 @@ const std::string FMatrixKokkos::get_name() con template void FMatrixKokkos::set_values(T val) { Kokkos::parallel_for("SetValues_FMatrixKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { - this_matrix_(i) = val; + this_array_(i) = val; }); } @@ -1375,7 +1375,7 @@ class ViewFMatrixKokkos { size_t dims_[7]; size_t order_; size_t length_; - T* this_matrix_; + T* this_array_; public: @@ -1460,7 +1460,7 @@ class ViewFMatrixKokkos { template KOKKOS_INLINE_FUNCTION ViewFMatrixKokkos::ViewFMatrixKokkos() { - this_matrix_ = nullptr; + this_array_ = nullptr; length_ = order_ = 0; for (int i = 0; i < 7; i++) { dims_[i] = 0; @@ -1474,7 +1474,7 @@ ViewFMatrixKokkos::ViewFMatrixKokkos(T* some_matrix, size_t dim1) { dims_[0] = dim1; order_ = 1; length_ = dim1; - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 2D constructor @@ -1486,7 +1486,7 @@ ViewFMatrixKokkos::ViewFMatrixKokkos(T* some_matrix, size_t dim1, dims_[1] = dim2; order_ = 2; length_ = (dim1 * dim2); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 3D constructor @@ -1499,7 +1499,7 @@ ViewFMatrixKokkos::ViewFMatrixKokkos(T* some_matrix, size_t dim1, dims_[2] = dim3; order_ = 3; length_ = (dim1 * dim2 * dim3); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 4D constructor @@ -1514,7 +1514,7 @@ ViewFMatrixKokkos::ViewFMatrixKokkos(T* some_matrix, size_t dim1, dims_[3] = dim4; order_ = 4; length_ = (dim1 * dim2 * dim3 * dim4); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 5D constructor @@ -1530,7 +1530,7 @@ ViewFMatrixKokkos::ViewFMatrixKokkos(T* some_matrix, size_t dim1, dims_[4] = dim5; order_ = 5; length_ = (dim1 * dim2 * dim3 * dim4 * dim5); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 6D constructor @@ -1548,7 +1548,7 @@ ViewFMatrixKokkos::ViewFMatrixKokkos(T* some_matrix, size_t dim1, dims_[5] = dim6; order_ = 6; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 6D constructor @@ -1567,7 +1567,7 @@ ViewFMatrixKokkos::ViewFMatrixKokkos(T* some_matrix, size_t dim1, dims_[6] = dim7; order_ = 7; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6 * dim7); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } @@ -1576,7 +1576,7 @@ KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i) const { MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewFMatrixKokkos 1D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 1D"); - return this_matrix_[(i - 1)]; + return this_array_[(i - 1)]; } template @@ -1585,7 +1585,7 @@ T& ViewFMatrixKokkos::operator()(size_t i, size_t j) const { MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewFMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 2D"); - return this_matrix_[(i - 1) + ((j - 1) * dims_[0])]; + return this_array_[(i - 1) + ((j - 1) * dims_[0])]; } template @@ -1597,7 +1597,7 @@ T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k) const MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 3D"); - return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])]; } @@ -1610,7 +1610,7 @@ T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos 4D"); - return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])]; } @@ -1625,7 +1625,7 @@ T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos 5D"); - return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3])]; @@ -1643,7 +1643,7 @@ T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewFMatrixKokkos 6D"); - return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3]) @@ -1663,7 +1663,7 @@ T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewFMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(o, dims_[6], "o", "ViewFMatrixKokkos 7D"); - return this_matrix_[(i - 1) + ((j - 1) * dims_[0]) + return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3]) @@ -1701,13 +1701,13 @@ size_t ViewFMatrixKokkos::order() const { template KOKKOS_INLINE_FUNCTION T* ViewFMatrixKokkos::pointer() const { - return this_matrix_; + return this_array_; } template void ViewFMatrixKokkos::set_values(T val) { Kokkos::parallel_for( Kokkos::RangePolicy<> ( 0, length_), KOKKOS_CLASS_LAMBDA(const int i){ - this_matrix_[i] = val; + this_array_[i] = val; }); } @@ -2643,7 +2643,7 @@ class DFMatrixKokkos { size_t length_; size_t order_; // tensor order (rank) bool lock_ = false; - TArray1D this_matrix_; + TArray1D this_array_; public: DFMatrixKokkos(); @@ -2762,9 +2762,9 @@ DFMatrixKokkos::DFMatrixKokkos(size_t dim1, con dims_[0] = dim1; order_ = 1; length_ = dim1; - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewFMatrix - host = ViewFMatrix (this_matrix_.view_host().data(), dim1); + host = ViewFMatrix (this_array_.view_host().data(), dim1); } // Overloaded 2D constructor @@ -2775,9 +2775,9 @@ DFMatrixKokkos::DFMatrixKokkos(size_t dim1, siz dims_[1] = dim2; order_ = 2; length_ = (dim1 * dim2); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewFMatrix - host = ViewFMatrix (this_matrix_.view_host().data(), dim1, dim2); + host = ViewFMatrix (this_array_.view_host().data(), dim1, dim2); } template @@ -2789,9 +2789,9 @@ DFMatrixKokkos::DFMatrixKokkos(size_t dim1, siz dims_[2] = dim3; order_ = 3; length_ = (dim1 * dim2 * dim3); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewFMatrix - host = ViewFMatrix (this_matrix_.view_host().data(), dim1, dim2, dim3); + host = ViewFMatrix (this_array_.view_host().data(), dim1, dim2, dim3); } template @@ -2804,9 +2804,9 @@ DFMatrixKokkos::DFMatrixKokkos(size_t dim1, siz dims_[3] = dim4; order_ = 4; length_ = (dim1 * dim2 * dim3 * dim4); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewFMatrix - host = ViewFMatrix (this_matrix_.view_host().data(), dim1, dim2, dim3, dim4); + host = ViewFMatrix (this_array_.view_host().data(), dim1, dim2, dim3, dim4); } template @@ -2821,9 +2821,9 @@ DFMatrixKokkos::DFMatrixKokkos(size_t dim1, siz dims_[4] = dim5; order_ = 5; length_ = (dim1 * dim2 * dim3 * dim4 * dim5); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewFMatrix - host = ViewFMatrix (this_matrix_.view_host().data(), dim1, dim2, dim3, dim4, dim5); + host = ViewFMatrix (this_array_.view_host().data(), dim1, dim2, dim3, dim4, dim5); } template @@ -2839,9 +2839,9 @@ DFMatrixKokkos::DFMatrixKokkos(size_t dim1, siz dims_[5] = dim6; order_ = 6; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewFMatrix - host = ViewFMatrix (this_matrix_.view_host().data(), dim1, dim2, dim3, dim4, dim5, dim6); + host = ViewFMatrix (this_array_.view_host().data(), dim1, dim2, dim3, dim4, dim5, dim6); } template @@ -2859,9 +2859,9 @@ DFMatrixKokkos::DFMatrixKokkos(size_t dim1, siz dims_[6] = dim7; order_ = 7; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6 * dim7); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewFMatrix - host = ViewFMatrix (this_matrix_.view_host().data(), dim1, dim2, dim3, dim4, dim5, dim6, dim7); + host = ViewFMatrix (this_array_.view_host().data(), dim1, dim2, dim3, dim4, dim5, dim6, dim7); } template @@ -2869,7 +2869,7 @@ KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i) const { MATAR_CHECK_ORDER(1, order_, "DFMatrixKokkos 1D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 1D"); - return this_matrix_.view_device()((i - 1)); + return this_array_.view_device()((i - 1)); } template @@ -2878,7 +2878,7 @@ T& DFMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_ORDER(2, order_, "DFMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 2D"); - return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0])); + return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0])); } template @@ -2888,7 +2888,7 @@ T& DFMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 3D"); - return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -2900,7 +2900,7 @@ T& DFMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 4D"); - return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); } @@ -2915,7 +2915,7 @@ T& DFMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 5D"); - return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3])); @@ -2932,7 +2932,7 @@ T& DFMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos 6D"); - return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3]) @@ -2951,7 +2951,7 @@ T& DFMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DFMatrixKokkos 7D"); - return this_matrix_.view_device()((i - 1) + ((j - 1) * dims_[0]) + return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3]) @@ -2971,7 +2971,7 @@ DFMatrixKokkos& DFMatrixKokkos::order() const { template KOKKOS_INLINE_FUNCTION T* DFMatrixKokkos::device_pointer() const { - return this_matrix_.view_device().data(); + return this_array_.view_device().data(); } template KOKKOS_INLINE_FUNCTION T* DFMatrixKokkos::host_pointer() const { - return this_matrix_.view_host().data(); + return this_array_.view_host().data(); } template void DFMatrixKokkos::update_host() { assert(!lock_ && "This data is locked, no copy will be done."); if (lock_) return; - this_matrix_.template modify(); - this_matrix_.template sync(); + this_array_.template modify(); + this_array_.template sync(); } template void DFMatrixKokkos::update_device() { assert(!lock_ && "This data is locked, no copy will be done."); if (lock_) return; - this_matrix_.template modify(); - this_matrix_.template sync(); + this_array_.template modify(); + this_array_.template sync(); } // Get the name of the view template KOKKOS_INLINE_FUNCTION const std::string DFMatrixKokkos::get_name() const{ - return this_matrix_.view_host().label(); + return this_array_.view_host().label(); } template void DFMatrixKokkos::set_values(T val) { Kokkos::parallel_for( Kokkos::RangePolicy<> ( 0, length_), KOKKOS_CLASS_LAMBDA(const int i){ - this_matrix_.view_device()(i) = val; + this_array_.view_device()(i) = val; }); } @@ -3081,8 +3081,8 @@ class DViewFMatrixKokkos { size_t dims_[7]; size_t length_; size_t order_; // tensor order (rank) - TArray1D this_matrix_; - TArray1DHost this_matrix_host_; + TArray1D this_array_; + TArray1DHost this_array_host_; T * temp_inp_matrix_; public: @@ -3199,12 +3199,12 @@ DViewFMatrixKokkos::DViewFMatrixKokkos(T * inp_ order_ = 1; length_ = dim1; // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); - // Create host ViewFMatrix. Note: inp_matrix and this_matrix_host_.data() are the same pointer + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); + // Create host ViewFMatrix. Note: inp_matrix and this_array_host_.data() are the same pointer host = ViewFMatrix (inp_matrix, dim1); } @@ -3217,11 +3217,11 @@ DViewFMatrixKokkos::DViewFMatrixKokkos(T * inp_ order_ = 2; length_ = (dim1 * dim2); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewFMatrix host = ViewFMatrix (inp_matrix, dim1, dim2); } @@ -3236,11 +3236,11 @@ DViewFMatrixKokkos::DViewFMatrixKokkos(T * inp_ order_ = 3; length_ = (dim1 * dim2 * dim3); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewFMatrix host = ViewFMatrix (inp_matrix, dim1, dim2, dim3); } @@ -3256,11 +3256,11 @@ DViewFMatrixKokkos::DViewFMatrixKokkos(T * inp_ order_ = 4; length_ = (dim1 * dim2 * dim3 * dim4); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewFMatrix host = ViewFMatrix (inp_matrix, dim1, dim2, dim3, dim4); } @@ -3278,11 +3278,11 @@ DViewFMatrixKokkos::DViewFMatrixKokkos(T * inp_ order_ = 5; length_ = (dim1 * dim2 * dim3 * dim4 * dim5); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewFMatrix host = ViewFMatrix (inp_matrix, dim1, dim2, dim3, dim4, dim5); } @@ -3301,11 +3301,11 @@ DViewFMatrixKokkos::DViewFMatrixKokkos(T * inp_ order_ = 6; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewFMatrix host = ViewFMatrix (inp_matrix, dim1, dim2, dim3, dim4, dim5, dim6); } @@ -3326,11 +3326,11 @@ DViewFMatrixKokkos::DViewFMatrixKokkos(T * inp_ order_ = 7; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6 * dim7); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewFMatrix host = ViewFMatrix (inp_matrix, dim1, dim2, dim3, dim4, dim5, dim6, dim7); } @@ -3340,7 +3340,7 @@ KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i) const { MATAR_CHECK_ORDER(1, order_, "DViewFMatrixKokkos 1D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 1D"); - return this_matrix_((i - 1)); + return this_array_((i - 1)); } template @@ -3349,7 +3349,7 @@ T& DViewFMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_ORDER(2, order_, "DViewFMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 2D"); - return this_matrix_((i - 1) + ((j - 1) * dims_[0])); + return this_array_((i - 1) + ((j - 1) * dims_[0])); } template @@ -3359,7 +3359,7 @@ T& DViewFMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 3D"); - return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -3371,7 +3371,7 @@ T& DViewFMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 4D"); - return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); } @@ -3386,7 +3386,7 @@ T& DViewFMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 5D"); - return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3])); @@ -3403,7 +3403,7 @@ T& DViewFMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos 6D"); - return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3]) @@ -3422,7 +3422,7 @@ T& DViewFMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewFMatrixKokkos 7D"); - return this_matrix_((i - 1) + ((j - 1) * dims_[0]) + return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) + ((m - 1) * dims_[0] * dims_[1] * dims_[2] * dims_[3]) @@ -3443,8 +3443,8 @@ DViewFMatrixKokkos& DViewFMatrixKokkos::order() const { template KOKKOS_INLINE_FUNCTION T* DViewFMatrixKokkos::device_pointer() const { - return this_matrix_.data(); + return this_array_.data(); } template KOKKOS_INLINE_FUNCTION T* DViewFMatrixKokkos::host_pointer() const { - return this_matrix_host_.data(); + return this_array_host_.data(); } template void DViewFMatrixKokkos::update_host() { // Deep copy of device view to host view - deep_copy(this_matrix_host_, this_matrix_); + deep_copy(this_array_host_, this_array_); } template void DViewFMatrixKokkos::update_device() { // Deep copy of host view to device view - deep_copy(this_matrix_, this_matrix_host_); + deep_copy(this_array_, this_array_host_); } // Get the name of the view template KOKKOS_INLINE_FUNCTION const std::string DViewFMatrixKokkos::get_name() const{ - return this_matrix_.label(); + return this_array_.label(); } template void DViewFMatrixKokkos::set_values(T val) { Kokkos::parallel_for( Kokkos::RangePolicy<> ( 0, length_), KOKKOS_CLASS_LAMBDA(const int i){ - this_matrix_(i) = val; + this_array_(i) = val; }); } @@ -4270,7 +4270,7 @@ class CMatrixKokkos { size_t dims_[7]; size_t order_; size_t length_; - TArray1D this_matrix_; + TArray1D this_array_; public: CMatrixKokkos(); @@ -4368,7 +4368,7 @@ CMatrixKokkos::CMatrixKokkos(size_t dim1, const dims_[0] = dim1; order_ = 1; length_ = dim1; - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 2D constructor @@ -4380,7 +4380,7 @@ CMatrixKokkos::CMatrixKokkos(size_t dim1, size_ dims_[1] = dim2; order_ = 2; length_ = (dim1 * dim2); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 3D constructor @@ -4394,7 +4394,7 @@ CMatrixKokkos::CMatrixKokkos(size_t dim1, size_ dims_[2] = dim3; order_ = 3; length_ = (dim1 * dim2 * dim3); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 4D constructor @@ -4409,7 +4409,7 @@ CMatrixKokkos::CMatrixKokkos(size_t dim1, size_ dims_[3] = dim4; order_ = 4; length_ = (dim1 * dim2 * dim3 * dim4); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 5D constructor @@ -4427,7 +4427,7 @@ CMatrixKokkos::CMatrixKokkos(size_t dim1, size_ dims_[4] = dim5; order_ = 5; length_ = (dim1 * dim2 * dim3 * dim4 * dim5); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 6D constructor @@ -4445,7 +4445,7 @@ CMatrixKokkos::CMatrixKokkos(size_t dim1, size_ dims_[5] = dim6; order_ = 6; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // Overloaded 7D constructor @@ -4465,7 +4465,7 @@ CMatrixKokkos::CMatrixKokkos(size_t dim1, size_ dims_[6] = dim7; order_ = 7; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6 * dim7); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } template @@ -4473,7 +4473,7 @@ KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i) const { MATAR_CHECK_ORDER(1, order_, "CMatrixKokkos 1D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 1D"); - return this_matrix_((i - 1)); + return this_array_((i - 1)); } template @@ -4482,7 +4482,7 @@ T& CMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_ORDER(2, order_, "CMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 2D"); - return this_matrix_((j - 1) + ((i - 1) * dims_[1])); + return this_array_((j - 1) + ((i - 1) * dims_[1])); } template @@ -4492,7 +4492,7 @@ T& CMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 3D"); - return this_matrix_((k - 1) + ((j - 1) * dims_[2]) + return this_array_((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -4504,7 +4504,7 @@ T& CMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 4D"); - return this_matrix_((l - 1) + ((k - 1) * dims_[3]) + return this_array_((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); } @@ -4519,7 +4519,7 @@ T& CMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 5D"); - return this_matrix_((m - 1) + ((l - 1) * dims_[4]) + return this_array_((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) + ((i - 1) * dims_[4] * dims_[3] * dims_[2] * dims_[1])); @@ -4536,7 +4536,7 @@ T& CMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos 6D"); - return this_matrix_((n - 1) + ((m - 1) * dims_[5]) + return this_array_((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) + ((j - 1) * dims_[5] * dims_[4] * dims_[3] * dims_[2]) @@ -4555,7 +4555,7 @@ T& CMatrixKokkos::operator()(size_t i, size_t j MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "CMatrixKokkos 7D"); - return this_matrix_((o-1) + ((n - 1) * dims_[6]) + return this_array_((o-1) + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) + ((k - 1) * dims_[6] * dims_[5] * dims_[4] * dims_[3]) @@ -4577,7 +4577,7 @@ CMatrixKokkos & CMatrixKokkos::order() const { template KOKKOS_INLINE_FUNCTION T* CMatrixKokkos::pointer() const { - return this_matrix_.data(); + return this_array_.data(); } //return the stored Kokkos view template KOKKOS_INLINE_FUNCTION Kokkos::View CMatrixKokkos::get_kokkos_view() const { - return this_matrix_; + return this_array_; } // Get the name of the view template KOKKOS_INLINE_FUNCTION const std::string CMatrixKokkos::get_name() const{ - return this_matrix_.label(); + return this_array_.label(); } // set values of array template void CMatrixKokkos::set_values(T val) { Kokkos::parallel_for("SetValues_CMatrixKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { - this_matrix_(i) = val; + this_array_(i) = val; }); } @@ -4657,7 +4657,7 @@ class ViewCMatrixKokkos { size_t dims_[7]; size_t order_; size_t length_; - T* this_matrix_; + T* this_array_; public: KOKKOS_INLINE_FUNCTION @@ -4737,7 +4737,7 @@ template KOKKOS_INLINE_FUNCTION ViewCMatrixKokkos::ViewCMatrixKokkos(){ length_ = order_ = 0; - this_matrix_ = NULL; + this_array_ = NULL; for (int i = 0; i < 7; i++) { dims_[i] = 0; } @@ -4750,7 +4750,7 @@ ViewCMatrixKokkos::ViewCMatrixKokkos(T* some_matrix, size_t dim1) { dims_[0] = dim1; order_ = 1; length_ = dim1; - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 2D constructor @@ -4762,7 +4762,7 @@ ViewCMatrixKokkos::ViewCMatrixKokkos(T* some_matrix, size_t dim1, dims_[1] = dim2; order_ = 2; length_ = (dim1 * dim2); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 3D constructor @@ -4775,7 +4775,7 @@ ViewCMatrixKokkos::ViewCMatrixKokkos(T* some_matrix, size_t dim1, size_t dim2 dims_[2] = dim3; order_ = 3; length_ = (dim1 * dim2 * dim3); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 4D constructor @@ -4789,7 +4789,7 @@ ViewCMatrixKokkos::ViewCMatrixKokkos(T* some_matrix, size_t dim1, size_t dim2 dims_[3] = dim4; order_ = 4; length_ = (dim1 * dim2 * dim3 * dim4); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 5D constructor @@ -4804,7 +4804,7 @@ ViewCMatrixKokkos::ViewCMatrixKokkos(T* some_matrix, size_t dim1, size_t dim2 dims_[4] = dim5; order_ = 5; length_ = (dim1 * dim2 * dim3 * dim4 * dim5); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 6D constructor @@ -4821,7 +4821,7 @@ ViewCMatrixKokkos::ViewCMatrixKokkos(T* some_matrix, size_t dim1, size_t dim2 dims_[5] = dim6; order_ = 6; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } // Overloaded 7D constructor @@ -4839,7 +4839,7 @@ ViewCMatrixKokkos::ViewCMatrixKokkos(T* some_matrix, size_t dim1, size_t dim2 dims_[6] = dim7; order_ = 7; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6 * dim7); - this_matrix_ = some_matrix; + this_array_ = some_matrix; } template @@ -4847,7 +4847,7 @@ KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i) const { MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewCMatrixKokkos 1D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 1D"); - return this_matrix_[(i - 1)]; + return this_array_[(i - 1)]; } template @@ -4856,7 +4856,7 @@ T& ViewCMatrixKokkos::operator()(size_t i, size_t j) const { MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewCMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 2D"); - return this_matrix_[(j - 1) + ((i - 1) * dims_[1])]; + return this_array_[(j - 1) + ((i - 1) * dims_[1])]; } template @@ -4866,7 +4866,7 @@ T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 3D"); - return this_matrix_[(k - 1) + ((j - 1) * dims_[2]) + return this_array_[(k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])]; } @@ -4878,7 +4878,7 @@ T& ViewCMatrixKokkos::operator()(size_t i, size_t j , size_t k, size_t l) con MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos 4D"); - return this_matrix_[(l - 1) + ((k - 1) * dims_[3]) + return this_array_[(l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])]; } @@ -4893,7 +4893,7 @@ T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos 5D"); - return this_matrix_[(m - 1) + ((l - 1) * dims_[4]) + return this_array_[(m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) + ((i - 1) * dims_[4] * dims_[3] * dims_[2] * dims_[1])]; @@ -4910,7 +4910,7 @@ T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewCMatrixKokkos 6D"); - return this_matrix_[(n - 1) + ((m - 1) * dims_[5]) + return this_array_[(n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) + ((j - 1) * dims_[5] * dims_[4] * dims_[3] * dims_[2]) @@ -4929,7 +4929,7 @@ T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewCMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(o, dims_[6], "o", "ViewCMatrixKokkos 7D"); - return this_matrix_[o + ((n - 1) * dims_[6]) + return this_array_[o + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) + ((k - 1) * dims_[6] * dims_[5] * dims_[4] * dims_[3]) @@ -4968,13 +4968,13 @@ size_t ViewCMatrixKokkos::order() const { template KOKKOS_INLINE_FUNCTION T* ViewCMatrixKokkos::pointer() const { - return this_matrix_; + return this_array_; } template void ViewCMatrixKokkos::set_values(T val) { Kokkos::parallel_for( Kokkos::RangePolicy<> ( 0, length_), KOKKOS_CLASS_LAMBDA(const int i){ - this_matrix_[i] = val; + this_array_[i] = val; }); } @@ -5919,7 +5919,7 @@ class DCMatrixKokkos { size_t length_; size_t order_; // tensor order (rank) bool lock_ = false; - TArray1D this_matrix_; + TArray1D this_array_; public: // Data member to access host view @@ -6037,9 +6037,9 @@ DCMatrixKokkos::DCMatrixKokkos(size_t dim1, con dims_[0] = dim1; order_ = 1; length_ = dim1; - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewCMatrix - host = ViewCMatrix (this_matrix_.view_host().data(), dim1); + host = ViewCMatrix (this_array_.view_host().data(), dim1); } // Overloaded 2D constructor @@ -6050,9 +6050,9 @@ DCMatrixKokkos::DCMatrixKokkos(size_t dim1, siz dims_[1] = dim2; order_ = 2; length_ = (dim1 * dim2); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewCMatrix - host = ViewCMatrix (this_matrix_.view_host().data(), dim1, dim2); + host = ViewCMatrix (this_array_.view_host().data(), dim1, dim2); } template @@ -6064,9 +6064,9 @@ DCMatrixKokkos::DCMatrixKokkos(size_t dim1, siz dims_[2] = dim3; order_ = 3; length_ = (dim1 * dim2 * dim3); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewCMatrix - host = ViewCMatrix (this_matrix_.view_host().data(), dim1, dim2, dim3); + host = ViewCMatrix (this_array_.view_host().data(), dim1, dim2, dim3); } template @@ -6079,9 +6079,9 @@ DCMatrixKokkos::DCMatrixKokkos(size_t dim1, siz dims_[3] = dim4; order_ = 4; length_ = (dim1 * dim2 * dim3 * dim4); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewCMatrix - host = ViewCMatrix (this_matrix_.view_host().data(), dim1, dim2, dim3, dim4); + host = ViewCMatrix (this_array_.view_host().data(), dim1, dim2, dim3, dim4); } template @@ -6096,9 +6096,9 @@ DCMatrixKokkos::DCMatrixKokkos(size_t dim1, siz dims_[4] = dim5; order_ = 5; length_ = (dim1 * dim2 * dim3 * dim4 * dim5); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewCMatrix - host = ViewCMatrix (this_matrix_.view_host().data(), dim1, dim2, dim3, dim4, dim5); + host = ViewCMatrix (this_array_.view_host().data(), dim1, dim2, dim3, dim4, dim5); } template @@ -6114,9 +6114,9 @@ DCMatrixKokkos::DCMatrixKokkos(size_t dim1, siz dims_[5] = dim6; order_ = 6; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewCMatrix - host = ViewCMatrix (this_matrix_.view_host().data(), dim1, dim2, dim3, dim4, dim5, dim6); + host = ViewCMatrix (this_array_.view_host().data(), dim1, dim2, dim3, dim4, dim5, dim6); } template @@ -6134,9 +6134,9 @@ DCMatrixKokkos::DCMatrixKokkos(size_t dim1, siz dims_[6] = dim7; order_ = 7; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6 * dim7); - this_matrix_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); // Create host ViewCMatrix - host = ViewCMatrix (this_matrix_.view_host().data(), dim1, dim2, dim3, dim4, dim5, dim6, dim7); + host = ViewCMatrix (this_array_.view_host().data(), dim1, dim2, dim3, dim4, dim5, dim6, dim7); } template @@ -6144,7 +6144,7 @@ KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i) const { MATAR_CHECK_ORDER(1, order_, "DCMatrixKokkos 1D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 1D"); - return this_matrix_.view_device()((i - 1)); + return this_array_.view_device()((i - 1)); } template @@ -6153,7 +6153,7 @@ T& DCMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_ORDER(2, order_, "DCMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 2D"); - return this_matrix_.view_device()((j - 1) + ((i - 1) * dims_[1])); + return this_array_.view_device()((j - 1) + ((i - 1) * dims_[1])); } template @@ -6163,7 +6163,7 @@ T& DCMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 3D"); - return this_matrix_.view_device()((k - 1) + ((j - 1) * dims_[2]) + return this_array_.view_device()((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -6175,7 +6175,7 @@ T& DCMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 4D"); - return this_matrix_.view_device()((l - 1) + ((k - 1) * dims_[3]) + return this_array_.view_device()((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); } @@ -6190,7 +6190,7 @@ T& DCMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 5D"); - return this_matrix_.view_device()((m - 1) + ((l - 1) * dims_[4]) + return this_array_.view_device()((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) + ((i - 1) * dims_[4] * dims_[3] * dims_[2] * dims_[1])); @@ -6207,7 +6207,7 @@ T& DCMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos 6D"); - return this_matrix_.view_device()((n - 1) + ((m - 1) * dims_[5]) + return this_array_.view_device()((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) + ((j - 1) * dims_[5] * dims_[4] * dims_[3] * dims_[2]) @@ -6226,7 +6226,7 @@ T& DCMatrixKokkos::operator()(size_t i, size_t MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DCMatrixKokkos 7D"); - return this_matrix_.view_device()((o-1) + ((n - 1) * dims_[6]) + return this_array_.view_device()((o-1) + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) + ((k - 1) * dims_[6] * dims_[5] * dims_[4] * dims_[3]) @@ -6246,7 +6246,7 @@ DCMatrixKokkos& DCMatrixKokkos::order() const { template KOKKOS_INLINE_FUNCTION T* DCMatrixKokkos::device_pointer() const { - return this_matrix_.view_device().data(); + return this_array_.view_device().data(); } template KOKKOS_INLINE_FUNCTION T* DCMatrixKokkos::host_pointer() const { - return this_matrix_.view_host().data(); + return this_array_.view_host().data(); } template void DCMatrixKokkos::update_host() { assert(!lock_ && "This data is locked, no copy will be done."); if (lock_) return; - this_matrix_.template modify(); - this_matrix_.template sync(); + this_array_.template modify(); + this_array_.template sync(); } template void DCMatrixKokkos::update_device() { assert(!lock_ && "This data is locked, no copy will be done."); if (lock_) return; - this_matrix_.template modify(); - this_matrix_.template sync(); + this_array_.template modify(); + this_array_.template sync(); } // Get the name of the view template KOKKOS_INLINE_FUNCTION const std::string DCMatrixKokkos::get_name() const{ - return this_matrix_.view_host().label(); + return this_array_.view_host().label(); } template void DCMatrixKokkos::set_values(T val) { Kokkos::parallel_for( Kokkos::RangePolicy<> ( 0, length_), KOKKOS_CLASS_LAMBDA(const int i){ - this_matrix_.view_device()(i) = val; + this_array_.view_device()(i) = val; }); } @@ -6356,8 +6356,8 @@ class DViewCMatrixKokkos { size_t dims_[7]; size_t length_; size_t order_; // tensor order (rank) - TArray1D this_matrix_; - TArray1DHost this_matrix_host_; + TArray1D this_array_; + TArray1DHost this_array_host_; T * temp_inp_matrix_; public: @@ -6472,12 +6472,12 @@ DViewCMatrixKokkos::DViewCMatrixKokkos(T * inp_ order_ = 1; length_ = dim1; // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); - // Create host ViewCMatrix. Note: inp_matrix and this_matrix_host_.data() are the same pointer + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); + // Create host ViewCMatrix. Note: inp_matrix and this_array_host_.data() are the same pointer host = ViewCMatrix (inp_matrix, dim1); } @@ -6490,11 +6490,11 @@ DViewCMatrixKokkos::DViewCMatrixKokkos(T * inp_ order_ = 2; length_ = (dim1 * dim2); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewCMatrix host = ViewCMatrix (inp_matrix, dim1, dim2); } @@ -6509,11 +6509,11 @@ DViewCMatrixKokkos::DViewCMatrixKokkos(T * inp_ order_ = 3; length_ = (dim1 * dim2 * dim3); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewCMatrix host = ViewCMatrix (inp_matrix, dim1, dim2, dim3); } @@ -6529,11 +6529,11 @@ DViewCMatrixKokkos::DViewCMatrixKokkos(T * inp_ order_ = 4; length_ = (dim1 * dim2 * dim3 * dim4); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewCMatrix host = ViewCMatrix (inp_matrix, dim1, dim2, dim3, dim4); } @@ -6551,11 +6551,11 @@ DViewCMatrixKokkos::DViewCMatrixKokkos(T * inp_ order_ = 5; length_ = (dim1 * dim2 * dim3 * dim4 * dim5); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewCMatrix host = ViewCMatrix (inp_matrix, dim1, dim2, dim3, dim4, dim5); } @@ -6574,11 +6574,11 @@ DViewCMatrixKokkos::DViewCMatrixKokkos(T * inp_ order_ = 6; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewCMatrix host = ViewCMatrix (inp_matrix, dim1, dim2, dim3, dim4, dim5, dim6); } @@ -6599,11 +6599,11 @@ DViewCMatrixKokkos::DViewCMatrixKokkos(T * inp_ order_ = 7; length_ = (dim1 * dim2 * dim3 * dim4 * dim5 * dim6 * dim7); // Create a 1D host view of the external allocation - this_matrix_host_ = TArray1DHost(inp_matrix, length_); + this_array_host_ = TArray1DHost(inp_matrix, length_); // Assign temp point to inp_matrix pointer that is passed in temp_inp_matrix_ = inp_matrix; // Create a device copy of that host view - this_matrix_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_matrix_host_); + this_array_ = create_mirror_view_and_copy(Kokkos::view_alloc(memspace, tag_string), this_array_host_); // Create host ViewCMatrix host = ViewCMatrix (inp_matrix, dim1, dim2, dim3, dim4, dim5, dim6, dim7); } @@ -6613,7 +6613,7 @@ KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i) const { MATAR_CHECK_ORDER(1, order_, "DViewCMatrixKokkos 1D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 1D"); - return this_matrix_((i - 1)); + return this_array_((i - 1)); } template @@ -6622,7 +6622,7 @@ T& DViewCMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_ORDER(2, order_, "DViewCMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 2D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 2D"); - return this_matrix_((j - 1) + ((i - 1) * dims_[1])); + return this_array_((j - 1) + ((i - 1) * dims_[1])); } template @@ -6632,7 +6632,7 @@ T& DViewCMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 3D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 3D"); - return this_matrix_((k - 1) + ((j - 1) * dims_[2]) + return this_array_((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -6644,7 +6644,7 @@ T& DViewCMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 4D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 4D"); - return this_matrix_((l - 1) + ((k - 1) * dims_[3]) + return this_array_((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); } @@ -6659,7 +6659,7 @@ T& DViewCMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 5D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 5D"); - return this_matrix_((m - 1) + ((l - 1) * dims_[4]) + return this_array_((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) + ((i - 1) * dims_[4] * dims_[3] * dims_[2] * dims_[1])); @@ -6676,7 +6676,7 @@ T& DViewCMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 6D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos 6D"); - return this_matrix_((n - 1) + ((m - 1) * dims_[5]) + return this_array_((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) + ((j - 1) * dims_[5] * dims_[4] * dims_[3] * dims_[2]) @@ -6695,7 +6695,7 @@ T& DViewCMatrixKokkos::operator()(size_t i, siz MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos 7D"); MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewCMatrixKokkos 7D"); - return this_matrix_(o + ((n - 1) * dims_[6]) + return this_array_(o + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) + ((k - 1) * dims_[6] * dims_[5] * dims_[4] * dims_[3]) @@ -6716,8 +6716,8 @@ DViewCMatrixKokkos& DViewCMatrixKokkos::order() const { template KOKKOS_INLINE_FUNCTION T* DViewCMatrixKokkos::device_pointer() const { - return this_matrix_.data(); + return this_array_.data(); } template KOKKOS_INLINE_FUNCTION T* DViewCMatrixKokkos::host_pointer() const { - return this_matrix_host_.data(); + return this_array_host_.data(); } template void DViewCMatrixKokkos::update_host() { // Deep copy of device view to host view - deep_copy(this_matrix_host_, this_matrix_); + deep_copy(this_array_host_, this_array_); } template void DViewCMatrixKokkos::update_device() { // Deep copy of host view to device view - deep_copy(this_matrix_, this_matrix_host_); + deep_copy(this_array_, this_array_host_); } // Get the name of the view template KOKKOS_INLINE_FUNCTION const std::string DViewCMatrixKokkos::get_name() const{ - return this_matrix_.label(); + return this_array_.label(); } template void DViewCMatrixKokkos::set_values(T val) { Kokkos::parallel_for( Kokkos::RangePolicy<> ( 0, length_), KOKKOS_CLASS_LAMBDA(const int i){ - this_matrix_(i) = val; + this_array_(i) = val; }); } @@ -8561,7 +8561,7 @@ class RaggedRightArrayKokkos { using Strides1D = Kokkos::View; private: - TArray1D array_; + TArray1D this_array_; size_t dim1_; size_t length_; @@ -8801,7 +8801,7 @@ void RaggedRightArrayKokkos::data_setup #endif //allocate view - array_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // A method to return the stride size @@ -8864,13 +8864,13 @@ T& RaggedRightArrayKokkos::operator()(s MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos"); // die if >= dim1 MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= stride - return array_(j + start); + return this_array_(j + start); } // End operator() template KOKKOS_INLINE_FUNCTION T* RaggedRightArrayKokkos::pointer() { - return array_.data(); + return this_array_.data(); } @@ -8938,7 +8938,7 @@ RaggedRightArrayKokkos & RaggedRightArr // }); //Kokkos::fence(); - array_ = temp.array_; + this_array_ = temp.this_array_; mystrides_ = temp.mystrides_; /* @@ -8962,14 +8962,14 @@ RaggedRightArrayKokkos & RaggedRightArr template KOKKOS_INLINE_FUNCTION Kokkos::View RaggedRightArrayKokkos::get_kokkos_view() { - return array_; + return this_array_; } //set values to input template void RaggedRightArrayKokkos::set_values(T val) { Kokkos::parallel_for("SetValues_RaggedRightArrayKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { - array_(i) = val; + this_array_(i) = val; }); } @@ -8977,7 +8977,7 @@ void RaggedRightArrayKokkos::set_values template KOKKOS_INLINE_FUNCTION const std::string RaggedRightArrayKokkos::get_name() const{ - return array_.label(); + return this_array_.label(); } // Destructor @@ -9000,7 +9000,7 @@ class RaggedRightArrayofVectorsKokkos { using Strides1D = Kokkos::View; private: - TArray1D array_; + TArray1D this_array_; size_t dim1_, vector_dim_; size_t length_; @@ -9240,7 +9240,7 @@ void RaggedRightArrayofVectorsKokkos::d #endif //allocate view - array_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // A method to return the stride size @@ -9295,13 +9295,13 @@ T& RaggedRightArrayofVectorsKokkos::ope MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= stride MATAR_CHECK_BOUNDS(k, vector_dim_, "k", "RaggedRightArrayKokkos"); // die if >= vector_dim - return array_(j*vector_dim_ + start + k); + return this_array_(j*vector_dim_ + start + k); } // End operator() template KOKKOS_INLINE_FUNCTION T* RaggedRightArrayofVectorsKokkos::pointer() { - return array_.data(); + return this_array_.data(); } @@ -9318,7 +9318,7 @@ RaggedRightArrayofVectorsKokkos & Ragge start_index_ = temp.start_index_; length_ = temp.length_; - array_ = temp.array_; + this_array_ = temp.this_array_; mystrides_ = temp.mystrides_; } @@ -9329,14 +9329,14 @@ RaggedRightArrayofVectorsKokkos & Ragge template KOKKOS_INLINE_FUNCTION Kokkos::View RaggedRightArrayofVectorsKokkos::get_kokkos_view() { - return array_; + return this_array_; } template void RaggedRightArrayofVectorsKokkos::set_values(T val) { Kokkos::parallel_for( Kokkos::RangePolicy<> ( 0, length_), KOKKOS_CLASS_LAMBDA(const int i){ - array_(i) = val; + this_array_(i) = val; }); } @@ -9344,7 +9344,7 @@ void RaggedRightArrayofVectorsKokkos:: template KOKKOS_INLINE_FUNCTION const std::string RaggedRightArrayofVectorsKokkos::get_name() const{ - return array_.label(); + return this_array_.label(); } // Destructor @@ -9368,7 +9368,7 @@ class RaggedDownArrayKokkos { using Strides1D = Kokkos::View; private: - TArray1D array_; + TArray1D this_array_; size_t dim2_; size_t length_; @@ -9555,7 +9555,7 @@ void RaggedDownArrayKokkos::data_setup( #endif //allocate view - array_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // A method to return the stride size @@ -9580,7 +9580,7 @@ T& RaggedDownArrayKokkos::operator()(si MATAR_CHECK_BOUNDS(i, stride(j), "i", "RaggedDownArrayKokkos"); // die if >= stride MATAR_CHECK_BOUNDS(j, dim2_, "j", "RaggedDownArrayKokkos"); // die if >= dim1 - return array_(i + start); + return this_array_(i + start); } // End operator() template @@ -9676,7 +9676,7 @@ operator= (const RaggedDownArrayKokkos Kokkos::fence(); */ length_ = temp.length_; - array_ = temp.length_; + this_array_ = temp.length_; mystrides_ = temp.mystrides_; /* @@ -9700,14 +9700,14 @@ operator= (const RaggedDownArrayKokkos template KOKKOS_INLINE_FUNCTION Kokkos::View RaggedDownArrayKokkos::get_kokkos_view() { - return array_; + return this_array_; } //set values to input template void RaggedDownArrayKokkos::set_values(T val) { Kokkos::parallel_for("SetValues_RaggedDownArrayKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { - array_(i) = val; + this_array_(i) = val; }); } @@ -9715,7 +9715,7 @@ void RaggedDownArrayKokkos::set_values( template KOKKOS_INLINE_FUNCTION const std::string RaggedDownArrayKokkos::get_name() const{ - return array_.label(); + return this_array_.label(); } template @@ -9744,7 +9744,7 @@ class DynamicRaggedRightArrayKokkos { private: // THIS WILL BE A GPU POINTER! SArray1D stride_; - TArray1D array_; + TArray1D this_array_; size_t dim1_; size_t dim2_; @@ -9843,7 +9843,7 @@ DynamicRaggedRightArrayKokkos::DynamicRaggedRig #endif //allocate view - array_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // A method to set the stride size for row i @@ -9871,7 +9871,7 @@ T& DynamicRaggedRightArrayKokkos::operator()(si // Cannot assert on Kokkos View //assert(j < stride_[i] && "j is out of stride bounds in DynamicRaggedRight"); // die if >= stride - return array_(j + i*dim2_); + return this_array_(j + i*dim2_); } //overload = operator @@ -9886,7 +9886,7 @@ DynamicRaggedRightArrayKokkos& dim2_ = temp.dim2_; length_ = temp.length_; stride_ = temp.stride_; - array_ = temp.array_; + this_array_ = temp.this_array_; /* #ifdef HAVE_CLASS_LAMBDA Kokkos::parallel_for("StrideZeroOut", dim1_, KOKKOS_CLASS_LAMBDA(const int i) { @@ -9906,14 +9906,14 @@ DynamicRaggedRightArrayKokkos& template KOKKOS_INLINE_FUNCTION Kokkos::View DynamicRaggedRightArrayKokkos::get_kokkos_view() { - return array_; + return this_array_; } //set values to input template void DynamicRaggedRightArrayKokkos::set_values(T val) { Kokkos::parallel_for("SetValues_DynamicRaggedRightArrayKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { - array_(i) = val; + this_array_(i) = val; }); } @@ -9922,18 +9922,18 @@ void DynamicRaggedRightArrayKokkos::set_values_ // Kokkos::parallel_for( Kokkos::TeamPolicy<>( dim1_, Kokkos::AUTO, 32 ), KOKKOS_CLASS_LAMBDA ( const Kokkos::TeamPolicy<>::member_type &teamMember ) { // const int i_i = teamMember.league_rank(); // Kokkos::parallel_for( Kokkos::TeamThreadRange( teamMember, 0, stride_(i_i) ), [&] ( const int (j_j) ) { - // array_(dim2_*i_i+j_j) = val; + // this_array_(dim2_*i_i+j_j) = val; // }); // }); Kokkos::parallel_for("SetValues_DynamicRaggedRightArrayKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { - array_(i) = val; + this_array_(i) = val; }); } // Get the name of the view template KOKKOS_INLINE_FUNCTION const std::string DynamicRaggedRightArrayKokkos::get_name() const{ - return array_.label(); + return this_array_.label(); } // Destructor @@ -9958,7 +9958,7 @@ class DynamicRaggedDownArrayKokkos { private: SArray1D stride_; - TArray1D array_; + TArray1D this_array_; size_t dim1_; size_t dim2_; @@ -10060,7 +10060,7 @@ DynamicRaggedDownArrayKokkos::DynamicRaggedDown #endif //allocate view - array_ = TArray1D(tag_string, length_); + this_array_ = TArray1D(tag_string, length_); } // A method to set the stride size for column j @@ -10097,7 +10097,7 @@ T& DynamicRaggedDownArrayKokkos::operator()(siz // Can't do this assert with a Kokkos View //assert(i < stride_[j] && "i is out of stride bounds in DynamicRaggedDownArrayKokkos"); // die if >= stride - return array_(i + j*dim1_); + return this_array_(i + j*dim1_); } //overload = operator @@ -10112,7 +10112,7 @@ DynamicRaggedDownArrayKokkos& dim2_ = temp.dim2_; length_ = temp.length_; stride_ = temp.stride_; - array_ = temp.array_; + this_array_ = temp.this_array_; /* #ifdef HAVE_CLASS_LAMBDA Kokkos::parallel_for("StrideZeroOut", dim2_, KOKKOS_CLASS_LAMBDA(const int j) { @@ -10132,14 +10132,14 @@ DynamicRaggedDownArrayKokkos& template KOKKOS_INLINE_FUNCTION Kokkos::View DynamicRaggedDownArrayKokkos::get_kokkos_view() { - return array_; + return this_array_; } //set values to input template void DynamicRaggedDownArrayKokkos::set_values(T val) { Kokkos::parallel_for("SetValues_DynamicRaggedDownArrayKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { - array_(i) = val; + this_array_(i) = val; }); } @@ -10148,18 +10148,18 @@ void DynamicRaggedDownArrayKokkos::set_values_s // Kokkos::parallel_for( Kokkos::TeamPolicy<>( dim2_, Kokkos::AUTO, 32 ), KOKKOS_CLASS_LAMBDA ( const Kokkos::TeamPolicy<>::member_type &teamMember ) { // const int j_j = teamMember.league_rank(); // Kokkos::parallel_for( Kokkos::TeamThreadRange( teamMember, 0, stride_(j_j) ), [&] ( const int (i_i) ) { - // array_(dim1_*j_j+i_i) = val; + // this_array_(dim1_*j_j+i_i) = val; // }); // }); Kokkos::parallel_for("SetValues_DynamicRaggedDownArrayKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { - array_(i) = val; + this_array_(i) = val; }); } // Get the name of the view template KOKKOS_INLINE_FUNCTION const std::string DynamicRaggedDownArrayKokkos::get_name() const{ - return array_.label(); + return this_array_.label(); } // Destructor @@ -10180,7 +10180,7 @@ class CSRArrayKokkos { private: // What ought to be private ? size_t dim1_, dim2_; size_t nnz_; - TArray1D array_; + TArray1D this_array_; SArray1D column_index_; SArray1D start_index_; TArray1D miss_; @@ -10377,7 +10377,7 @@ CSRArrayKokkos::CSRArrayKokkos( dim1_ = dim1; dim2_ = dim2; start_index_ = start_index.get_kokkos_view(); - array_ = array.get_kokkos_view(); + this_array_ = array.get_kokkos_view(); column_index_ = colum_index.get_kokkos_view(); nnz_ = colum_index.extent(); miss_ = TArray1D("miss", 1); @@ -10412,13 +10412,13 @@ CSRArrayKokkos::CSRArrayKokkos(const CArrayKok } column_index_ = Kokkos::View("column Indices", nnz_); - array_ = Kokkos::View("array elements", nnz_); + this_array_ = Kokkos::View("array elements", nnz_); size_t next = 0 ; for(size_t i = 0; i < dim1_; i++){ for(size_t j =0 ; j < dim2_; j++){ if(dense(i,j) != 0){ // column_index_(next) = j; - // array_(next) = dense(i,j); + // this_array_(next) = dense(i,j); next++; } } @@ -10455,7 +10455,7 @@ T& CSRArrayKokkos::operator()(size_t i, size size_t k; for(k = 0; k < row_end - row_start; k++){ if(column_index_[row_start + k] == j){ - return array_.data()[row_start + k]; + return this_array_.data()[row_start + k]; } } miss_[0] = (T) NULL; @@ -10471,7 +10471,7 @@ T& CSRArrayKokkos::value(size_t i, size_t j) size_t k; for(k = 0; k < row_end - row_start; k++){ if(column_index_[row_start + k] == j){ - return array_.data()[row_start + k]; + return this_array_.data()[row_start + k]; } } miss_[0] = (T) NULL; @@ -10481,7 +10481,7 @@ T& CSRArrayKokkos::value(size_t i, size_t j) template KOKKOS_INLINE_FUNCTION T* CSRArrayKokkos::pointer() const{ - return array_.data(); + return this_array_.data(); } template @@ -10500,7 +10500,7 @@ CSRArrayKokkos& CSRArrayKokkos::begin(size_t i){ MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); size_t row_start = start_index_.data()[i]; - return &array_.data()[row_start]; + return &this_array_.data()[row_start]; } template KOKKOS_INLINE_FUNCTION T* CSRArrayKokkos::end(size_t i){ MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); size_t row_start = start_index_.data()[i+1]; - return &array_.data()[row_start]; + return &this_array_.data()[row_start]; } template @@ -10581,14 +10581,14 @@ template KOKKOS_INLINE_FUNCTION T& CSRArrayKokkos::get_val_flat(size_t k) const{ MATAR_CHECK_BOUNDS(k, nnz_, "k", "CSRArrayKokkos"); - return array_.data()[k]; + return this_array_.data()[k]; } // Get the name of the view // template // KOKKOS_INLINE_FUNCTION // const std::string CSRArrayKokkos::get_name() const{ -// return array_.label(); +// return this_array_.label(); // } template @@ -10653,7 +10653,7 @@ int CSRArray::toCSC(CArray &data, CArray &col_ptrs, CArray } int idx = nnz_cols[column_index_[i]] + col_counts[column_index_[i]]; col_counts[column_index_[i]] += 1; - data(idx) = array_[i]; + data(idx) = this_array_[i]; row_ptrs(idx) = row - 1; } // I return an int because I thought I might need to return an error code @@ -10665,7 +10665,7 @@ int CSRArray::toCSC(CArray &data, CArray &col_ptrs, CArray template void CSRArrayKokkos::set_values(T val) { Kokkos::parallel_for( Kokkos::RangePolicy<> ( 0, nnz_), KOKKOS_CLASS_LAMBDA(const int i){ - array_[i] = val; + this_array_[i] = val; }); } @@ -10682,7 +10682,7 @@ class CSCArrayKokkos private: // What ought to be private ? size_t dim1_, dim2_; size_t nnz_; - TArray1D array_; + TArray1D this_array_; TArray1D miss_; SArray1D start_index_; SArray1D row_index_; @@ -10868,7 +10868,7 @@ CSCArrayKokkos::CSCArrayKokkos( dim1_ = dim1; dim2_ = dim2; start_index_ = start_index.get_kokkos_view(); - array_ = array.get_kokkos_view(); + this_array_ = array.get_kokkos_view(); row_index_ = row_index.get_kokkos_view(); nnz_ = row_index.extent(); @@ -10889,7 +10889,7 @@ T& CSCArrayKokkos::operator()(size_t i, size for(k = 0; k < col_end - col_start; k++){ if(row_index_.data()[col_start + k] == i){ - return array_.data()[col_start + k]; + return this_array_.data()[col_start + k]; } } miss_[0] = (T) NULL; @@ -10899,7 +10899,7 @@ T& CSCArrayKokkos::operator()(size_t i, size template KOKKOS_INLINE_FUNCTION T* CSCArrayKokkos::pointer() const { - return array_.data(); + return this_array_.data(); } @@ -10911,7 +10911,7 @@ T& CSCArrayKokkos::value(size_t i, size_t j) size_t k; for(k =0; k < col_end - col_start;k++){ if(row_index_.data()[col_start + k] == i){ - return array_.data()[col_start + k]; + return this_array_.data()[col_start + k]; } } miss_[0] = (T) NULL; @@ -10935,7 +10935,7 @@ CSCArrayKokkos& CSCArrayKokkos::begin(size_t i){ MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos"); size_t col_start = start_index_.data()[i]; - return &array_.data()[col_start]; + return &this_array_.data()[col_start]; } template @@ -10973,7 +10973,7 @@ KOKKOS_INLINE_FUNCTION T* CSCArrayKokkos::end(size_t i){ MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos"); size_t col_start = start_index_.data()[i+1]; - return &array_.data()[col_start]; + return &this_array_.data()[col_start]; } template @@ -11005,13 +11005,13 @@ size_t CSCArrayKokkos::nnz(size_t i){ template KOKKOS_INLINE_FUNCTION T& CSCArrayKokkos::get_val_flat(size_t k){ - return array_.data()[k]; + return this_array_.data()[k]; } // template // KOKKOS_INLINE_FUNCTION // const std::string CSCArrayKokkos::get_name() const{ -// return array_.label(); +// return this_array_.label(); // } @@ -11039,7 +11039,7 @@ int CSCArrayKokkos::flat_index(size_t i, size template void CSCArrayKokkos::set_values(T val) { Kokkos::parallel_for( Kokkos::RangePolicy<> ( 0, nnz_), KOKKOS_CLASS_LAMBDA(const int i){ - array_(i) = val; + this_array_(i) = val; }); } @@ -11081,7 +11081,7 @@ int CSCArray::toCSR(CArray &data, CArray &col_ptrs, CArray } int idx = nnz_rows[row_index_[i]] + row_counts[row_index_[i]]; row_counts[row_index_[i]] += 1; - data(idx) = array_[i]; + data(idx) = this_array_[i]; col_ptrs(idx) = col - 1; } // I return an int because I thought I might need to return an error code @@ -11105,7 +11105,7 @@ class DDynamicRaggedRightArrayKokkos { private: - TArray1D array_; + TArray1D this_array_; typename TArray1D::t_dev array_dev_; typename TArray1D::t_host array_host_; Strides1D mystrides_; @@ -11212,9 +11212,9 @@ DDynamicRaggedRightArrayKokkos::DDynamicRaggedR data_setup(); //allocate view - array_ = TArray1D(tag_string, length_); - array_host_ = array_.view_host(); - array_dev_ = array_.view_device(); + this_array_ = TArray1D(tag_string, length_); + array_host_ = this_array_.view_host(); + array_dev_ = this_array_.view_device(); } //setup start indices @@ -11304,9 +11304,9 @@ DDynamicRaggedRightArrayKokkos& mystrides_ = temp.mystrides_; mystrides_dev_ = temp.mystrides_dev_; mystrides_host_ = temp.mystrides_host_; - array_ = temp.array_; - array_dev_ = temp.array_dev_; - array_host_ = temp.array_host_; + this_array_ = temp.this_array_; + array_dev_ = temp.this_array_dev_; + array_host_ = temp.this_array_host_; /* #ifdef HAVE_CLASS_LAMBDA Kokkos::parallel_for("StrideZeroOut", dim1_, KOKKOS_CLASS_LAMBDA(const int i) { @@ -11326,7 +11326,7 @@ DDynamicRaggedRightArrayKokkos& template KOKKOS_INLINE_FUNCTION Kokkos::DualView DDynamicRaggedRightArrayKokkos::get_kokkos_dual_view() { - return array_; + return this_array_; } //set values to input @@ -11340,15 +11340,15 @@ void DDynamicRaggedRightArrayKokkos::set_values template void DDynamicRaggedRightArrayKokkos::update_host() { - array_.template modify(); - array_.template sync(); + this_array_.template modify(); + this_array_.template sync(); } template void DDynamicRaggedRightArrayKokkos::update_device() { - array_.template modify(); - array_.template sync(); + this_array_.template modify(); + this_array_.template sync(); } template @@ -11370,7 +11370,7 @@ void DDynamicRaggedRightArrayKokkos::set_values // Kokkos::parallel_for( Kokkos::TeamPolicy<>( dim1_, Kokkos::AUTO, 32 ), KOKKOS_CLASS_LAMBDA ( const Kokkos::TeamPolicy<>::member_type &teamMember ) { // const int i_i = teamMember.league_rank(); // Kokkos::parallel_for( Kokkos::TeamThreadRange( teamMember, 0, stride_(i_i) ), [&] ( const int (j_j) ) { - // array_(dim2_*i_i+j_j) = val; + // this_array_(dim2_*i_i+j_j) = val; // }); // }); Kokkos::parallel_for("SetValues_DynamicRaggedRightArrayKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { @@ -11381,7 +11381,7 @@ void DDynamicRaggedRightArrayKokkos::set_values template KOKKOS_INLINE_FUNCTION const std::string DDynamicRaggedRightArrayKokkos::get_name() const{ - return array_.view_host().label(); + return this_array_.view_host().label(); } // Destructor From 348d05ec069ac5714cbdd161634572207a916cf7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 12 Feb 2026 20:27:24 +0000 Subject: [PATCH 5/8] Fix undeclared variable 'd' in DynamicArrayKokkos and DynamicMatrixKokkos The MATAR_CHECK_BOUNDS macro was incorrectly using 'd' instead of 'i' as the first parameter in the dims() and dims_max() functions. Co-authored-by: Jacob Moore --- src/include/kokkos_types.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/kokkos_types.h b/src/include/kokkos_types.h index 60377194..a1519b84 100644 --- a/src/include/kokkos_types.h +++ b/src/include/kokkos_types.h @@ -8008,7 +8008,7 @@ size_t DynamicArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t DynamicArrayKokkos::dims(size_t i) const { - MATAR_CHECK_BOUNDS(d, order_ + 1, "i", "DynamicArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicArrayKokkos dims()"); assert(dims_actual_size_[i] >= 0 && "Access to DynamicArrayKokkos dims is out of bounds!"); return dims_actual_size_[i]; } @@ -8016,7 +8016,7 @@ size_t DynamicArrayKokkos::dims(size_t i) const template KOKKOS_INLINE_FUNCTION size_t DynamicArrayKokkos::dims_max(size_t i) const { - MATAR_CHECK_BOUNDS(d, order_ + 1, "i", "DynamicArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicArrayKokkos dims_max()"); assert(dims_[i] >= 0 && "Access to DynamicArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -8467,7 +8467,7 @@ template ::dims(size_t i) const { i--; - MATAR_CHECK_BOUNDS(d, order_ + 1, "i", "DynamicMatrixKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicMatrixKokkos dims()"); assert(dims_actual_size_[i] >= 0 && "Access to DynamicMatrixKokkos dims is out of bounds!"); return dims_actual_size_[i]; } @@ -8476,7 +8476,7 @@ template ::dims_max(size_t i) const { i--; - MATAR_CHECK_BOUNDS(d, order_ + 1, "i", "DynamicMatrixKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicMatrixKokkos dims_max()"); assert(dims_[i] >= 0 && "Access to DynamicMatrixKokkos dims is out of bounds!"); return dims_[i]; } From d8f77e9ee85bd3e0608b11a8bcae35bceecffff4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 12 Feb 2026 20:39:22 +0000 Subject: [PATCH 6/8] Update macros to take label as parameter This allows the same macros to work with different array types: - Regular Kokkos views: this_array_.label().c_str() - Dual views (DCArrayKokkos, etc.): this_array_.h_view.label().c_str() - View types (raw pointers): "" (empty string) Changes: - Consolidated MATAR_CHECK_BOUNDS and MATAR_CHECK_BOUNDS_NO_LABEL into single MATAR_CHECK_BOUNDS with label parameter - Consolidated MATAR_CHECK_BOUNDS_MATRIX and MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL into single MATAR_CHECK_BOUNDS_MATRIX with label parameter - Consolidated MATAR_CHECK_ORDER and MATAR_CHECK_ORDER_NO_LABEL into single MATAR_CHECK_ORDER with label parameter - Macros now conditionally print label only if non-empty - Updated all 711 macro calls with appropriate label accessor Co-authored-by: Jacob Moore --- src/include/kokkos_types.h | 1478 ++++++++++++++++++------------------ 1 file changed, 724 insertions(+), 754 deletions(-) diff --git a/src/include/kokkos_types.h b/src/include/kokkos_types.h index a1519b84..ccd7c2ff 100644 --- a/src/include/kokkos_types.h +++ b/src/include/kokkos_types.h @@ -111,75 +111,45 @@ using SHArray1D = Kokkos::View; // Bounds checking macros with enhanced error output // These macros provide detailed error messages in debug mode for bounds violations +// The label parameter should be passed as a const char* (e.g., this_array_.label().c_str()) +// For types without labels, pass "" (empty string) #ifndef NDEBUG - // For Kokkos View arrays with labels - #define MATAR_CHECK_BOUNDS(i, dim, index_name, class_name) \ + // For 0-based array indexing (i must be < dim) + #define MATAR_CHECK_BOUNDS(i, dim, index_name, class_name, label) \ if ((i) >= (dim)) { \ printf("\n[MATAR BOUNDS ERROR]\n"); \ printf(" Class: %s\n", class_name); \ - printf(" Array Label: %s\n", this_array_.label().c_str()); \ + if ((label) && (label)[0] != '\0') printf(" Array Label: %s\n", label); \ printf(" Index '%s' = %zu is out of bounds (dimension size = %zu)\n\n", \ index_name, (size_t)(i), (size_t)(dim)); \ assert(false && "MATAR bounds check failed"); \ } - // For View arrays (raw pointers) without labels - #define MATAR_CHECK_BOUNDS_NO_LABEL(i, dim, index_name, class_name) \ - if ((i) >= (dim)) { \ - printf("\n[MATAR BOUNDS ERROR]\n"); \ - printf(" Class: %s\n", class_name); \ - printf(" Index '%s' = %zu is out of bounds (dimension size = %zu)\n\n", \ - index_name, (size_t)(i), (size_t)(dim)); \ - assert(false && "MATAR bounds check failed"); \ - } - - // For Matrix types with 1-based indexing (with label) - #define MATAR_CHECK_BOUNDS_MATRIX(i, dim, index_name, class_name) \ - if ((i) < 1 || (i) > (dim)) { \ - printf("\n[MATAR BOUNDS ERROR]\n"); \ - printf(" Class: %s\n", class_name); \ - printf(" Array Label: %s\n", this_array_.label().c_str()); \ - printf(" Index '%s' = %zu is out of bounds (valid range: 1 to %zu)\n\n", \ - index_name, (size_t)(i), (size_t)(dim)); \ - assert(false && "MATAR bounds check failed"); \ - } - - // For Matrix types with 1-based indexing (without label) - #define MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dim, index_name, class_name) \ + // For 1-based matrix indexing (i must be >= 1 and <= dim) + #define MATAR_CHECK_BOUNDS_MATRIX(i, dim, index_name, class_name, label) \ if ((i) < 1 || (i) > (dim)) { \ printf("\n[MATAR BOUNDS ERROR]\n"); \ printf(" Class: %s\n", class_name); \ + if ((label) && (label)[0] != '\0') printf(" Array Label: %s\n", label); \ printf(" Index '%s' = %zu is out of bounds (valid range: 1 to %zu)\n\n", \ index_name, (size_t)(i), (size_t)(dim)); \ assert(false && "MATAR bounds check failed"); \ } // For order/rank validation - #define MATAR_CHECK_ORDER(expected, actual, class_name) \ - if ((expected) != (actual)) { \ - printf("\n[MATAR ORDER MISMATCH ERROR]\n"); \ - printf(" Class: %s\n", class_name); \ - printf(" Array Label: %s\n", this_array_.label().c_str()); \ - printf(" Expected order %zu but got %zu\n\n", (size_t)(expected), (size_t)(actual)); \ - assert(false && "MATAR order check failed"); \ - } - - // For order/rank validation without label - #define MATAR_CHECK_ORDER_NO_LABEL(expected, actual, class_name) \ + #define MATAR_CHECK_ORDER(expected, actual, class_name, label) \ if ((expected) != (actual)) { \ printf("\n[MATAR ORDER MISMATCH ERROR]\n"); \ printf(" Class: %s\n", class_name); \ + if ((label) && (label)[0] != '\0') printf(" Array Label: %s\n", label); \ printf(" Expected order %zu but got %zu\n\n", (size_t)(expected), (size_t)(actual)); \ assert(false && "MATAR order check failed"); \ } #else // In Release mode, these macros do nothing - #define MATAR_CHECK_BOUNDS(i, dim, index_name, class_name) ((void)0) - #define MATAR_CHECK_BOUNDS_NO_LABEL(i, dim, index_name, class_name) ((void)0) - #define MATAR_CHECK_BOUNDS_MATRIX(i, dim, index_name, class_name) ((void)0) - #define MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dim, index_name, class_name) ((void)0) - #define MATAR_CHECK_ORDER(expected, actual, class_name) ((void)0) - #define MATAR_CHECK_ORDER_NO_LABEL(expected, actual, class_name) ((void)0) + #define MATAR_CHECK_BOUNDS(i, dim, index_name, class_name, label) ((void)0) + #define MATAR_CHECK_BOUNDS_MATRIX(i, dim, index_name, class_name, label) ((void)0) + #define MATAR_CHECK_ORDER(expected, actual, class_name, label) ((void)0) #endif @@ -446,8 +416,8 @@ FArrayKokkos::FArrayKokkos(size_t dim0, size_t template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()( size_t i) const { - MATAR_CHECK_ORDER(1, order_, "FArrayKokkos 1D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "FArrayKokkos 1D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 1D", this_array_.label().c_str()); return this_array_(i); } @@ -455,9 +425,9 @@ T& FArrayKokkos::operator()( size_t i) const { template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "FArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "FArrayKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 2D", this_array_.label().c_str()); return this_array_(i + (j * dims_[0])); } @@ -465,10 +435,10 @@ T& FArrayKokkos::operator()(size_t i, size_t j) template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "FArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "FArrayKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 3D", this_array_.label().c_str()); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1])); } @@ -477,11 +447,11 @@ T& FArrayKokkos::operator()(size_t i, size_t j, template KOKKOS_INLINE_FUNCTION T& FArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "FArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "FArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 4D", this_array_.label().c_str()); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2])); @@ -492,12 +462,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "FArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "FArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos 5D", this_array_.label().c_str()); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -509,13 +479,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "FArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "FArrayKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "FArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "FArrayKokkos 6D", this_array_.label().c_str()); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -528,14 +498,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "FArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "FArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "FArrayKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "FArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "FArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "FArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "FArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "FArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "FArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "FArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "FArrayKokkos 7D", this_array_.label().c_str()); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -578,7 +548,7 @@ size_t FArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t FArrayKokkos::dims(size_t i) const { - MATAR_CHECK_BOUNDS(i, order_, "i", "FArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "FArrayKokkos dims()", this_array_.label().c_str()); assert(dims_[i]>0 && "Access to FArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -830,8 +800,8 @@ ViewFArrayKokkos::ViewFArrayKokkos(T *some_array, size_t dim0, size_t dim1, template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewFArrayKokkos 1D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "ViewFArrayKokkos 1D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewFArrayKokkos 1D", ""); return this_array_[i]; } @@ -839,9 +809,9 @@ T& ViewFArrayKokkos::operator()(size_t i) const { template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewFArrayKokkos 2D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 2D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "ViewFArrayKokkos 2D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewFArrayKokkos 2D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewFArrayKokkos 2D", ""); return this_array_[i + (j * dims_[0])]; } @@ -849,10 +819,10 @@ T& ViewFArrayKokkos::operator()(size_t i, size_t j) const { template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewFArrayKokkos 3D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 3D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 3D"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "ViewFArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewFArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewFArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "ViewFArrayKokkos 3D", ""); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1])]; } @@ -862,11 +832,11 @@ template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "ViewFArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewFArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewFArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "ViewFArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "ViewFArrayKokkos 4D", ""); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] *dims_[2])]; @@ -877,12 +847,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "ViewFArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewFArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewFArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "ViewFArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "ViewFArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "ViewFArrayKokkos 5D", ""); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -894,13 +864,13 @@ template KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewFArrayKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "ViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "ViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "ViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "ViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "ViewFArrayKokkos 6D", ""); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -914,14 +884,14 @@ KOKKOS_INLINE_FUNCTION T& ViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(o, dims_[6], "o", "ViewFArrayKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "ViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "ViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "ViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "ViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "ViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "ViewFArrayKokkos 7D", ""); return this_array_[i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -945,7 +915,7 @@ size_t ViewFArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t ViewFArrayKokkos::dims(size_t i) const { - MATAR_CHECK_BOUNDS_NO_LABEL(i, order_, "i", "ViewFArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "ViewFArrayKokkos dims()", ""); assert(dims_[i]>0 && "Access to ViewFArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -1190,27 +1160,27 @@ FMatrixKokkos::FMatrixKokkos(size_t dim1, size_ template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "FMatrixKokkos 1D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "FMatrixKokkos 1D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 1D", this_array_.label().c_str()); return this_array_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "FMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "FMatrixKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 2D", this_array_.label().c_str()); return this_array_((i - 1) + ((j - 1) * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "FMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "FMatrixKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 3D", this_array_.label().c_str()); return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -1218,11 +1188,11 @@ T& FMatrixKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& FMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "FMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "FMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 4D", this_array_.label().c_str()); return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); @@ -1232,12 +1202,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "FMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "FMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 5D", this_array_.label().c_str()); return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1248,13 +1218,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "FMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "FMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos 6D", this_array_.label().c_str()); return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1266,14 +1236,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "FMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "FMatrixKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "FMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "FMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "FMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "FMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "FMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "FMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "FMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "FMatrixKokkos 7D", this_array_.label().c_str()); return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1316,7 +1286,7 @@ template ::dims(size_t i) const { i--; - MATAR_CHECK_BOUNDS(i, order_, "i", "FMatrixKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "FMatrixKokkos dims()", this_array_.label().c_str()); assert(dims_[i]>0 && "Access to FMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -1574,17 +1544,17 @@ ViewFMatrixKokkos::ViewFMatrixKokkos(T* some_matrix, size_t dim1, template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewFMatrixKokkos 1D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "ViewFMatrixKokkos 1D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewFMatrixKokkos 1D", ""); return this_array_[(i - 1)]; } template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewFMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "ViewFMatrixKokkos 2D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewFMatrixKokkos 2D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewFMatrixKokkos 2D", ""); return this_array_[(i - 1) + ((j - 1) * dims_[0])]; } @@ -1592,10 +1562,10 @@ template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewFMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "ViewFMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewFMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewFMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "ViewFMatrixKokkos 3D", ""); return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])]; @@ -1605,11 +1575,11 @@ template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "ViewFMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewFMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewFMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "ViewFMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "ViewFMatrixKokkos 4D", ""); return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])]; @@ -1619,12 +1589,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "ViewFMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewFMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewFMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "ViewFMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "ViewFMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "ViewFMatrixKokkos 5D", ""); return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1636,13 +1606,13 @@ KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewFMatrixKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "ViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "ViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "ViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "ViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "ViewFMatrixKokkos 6D", ""); return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1655,14 +1625,14 @@ KOKKOS_INLINE_FUNCTION T& ViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(o, dims_[6], "o", "ViewFMatrixKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "ViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "ViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "ViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "ViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "ViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "ViewFMatrixKokkos 7D", ""); return this_array_[(i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -1687,7 +1657,7 @@ template KOKKOS_INLINE_FUNCTION size_t ViewFMatrixKokkos::dims(size_t i) const { i--; - MATAR_CHECK_BOUNDS_NO_LABEL(i, order_, "i", "ViewFMatrixKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "ViewFMatrixKokkos dims()", ""); assert(dims_[i]>0 && "Access to ViewFMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -1959,27 +1929,27 @@ DFArrayKokkos::DFArrayKokkos(size_t dim0, size_ template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DFArrayKokkos 1D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "DFArrayKokkos 1D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 1D", this_array_.h_view.label().c_str()); return this_array_.view_device()(i); } template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DFArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "DFArrayKokkos 2D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 2D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 2D", this_array_.h_view.label().c_str()); return this_array_.view_device()(i + (j * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DFArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "DFArrayKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 3D", this_array_.h_view.label().c_str()); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1])); } @@ -1987,11 +1957,11 @@ T& DFArrayKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& DFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "DFArrayKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 4D", this_array_.h_view.label().c_str()); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2])); @@ -2001,12 +1971,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "DFArrayKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos 5D", this_array_.h_view.label().c_str()); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2017,13 +1987,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DFArrayKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "DFArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DFArrayKokkos 6D", this_array_.h_view.label().c_str()); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2035,14 +2005,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DFArrayKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "DFArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DFArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DFArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DFArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DFArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DFArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DFArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DFArrayKokkos 7D", this_array_.h_view.label().c_str()); return this_array_.view_device()(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2087,7 +2057,7 @@ size_t DFArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t DFArrayKokkos::dims(size_t i) const { - MATAR_CHECK_BOUNDS(i, order_, "i", "DFArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DFArrayKokkos dims()", this_array_.h_view.label().c_str()); assert(dims_[i]>0 && "Access to DFArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -2445,27 +2415,27 @@ DViewFArrayKokkos::DViewFArrayKokkos(T * inp_ar template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DViewFArrayKokkos 1D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "DViewFArrayKokkos 1D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 1D", ""); return this_array_(i); } template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DViewFArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "DViewFArrayKokkos 2D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 2D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 2D", ""); return this_array_(i + (j * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DViewFArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "DViewFArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 3D", ""); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1])); } @@ -2473,11 +2443,11 @@ T& DViewFArrayKokkos::operator()(size_t i, size template KOKKOS_INLINE_FUNCTION T& DViewFArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DViewFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "DViewFArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 4D", ""); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2])); @@ -2487,12 +2457,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DViewFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "DViewFArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos 5D", ""); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2503,13 +2473,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewFArrayKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "DViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewFArrayKokkos 6D", ""); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2521,14 +2491,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewFArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DViewFArrayKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "DViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewFArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DViewFArrayKokkos 7D", ""); return this_array_(i + (j * dims_[0]) + (k * dims_[0] * dims_[1]) + (l * dims_[0] * dims_[1] * dims_[2]) @@ -2574,7 +2544,7 @@ size_t DViewFArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t DViewFArrayKokkos::dims(size_t i) const { - MATAR_CHECK_BOUNDS(i, order_, "i", "DViewFArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DViewFArrayKokkos dims()", ""); assert(dims_[i]>0 && "Access to DViewFArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -2867,27 +2837,27 @@ DFMatrixKokkos::DFMatrixKokkos(size_t dim1, siz template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DFMatrixKokkos 1D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "DFMatrixKokkos 1D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 1D", this_array_.h_view.label().c_str()); return this_array_.view_device()((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DFMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "DFMatrixKokkos 2D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 2D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 2D", this_array_.h_view.label().c_str()); return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DFMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "DFMatrixKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 3D", this_array_.h_view.label().c_str()); return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -2895,11 +2865,11 @@ T& DFMatrixKokkos::operator()(size_t i, size_t template KOKKOS_INLINE_FUNCTION T& DFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "DFMatrixKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 4D", this_array_.h_view.label().c_str()); return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); @@ -2909,12 +2879,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "DFMatrixKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 5D", this_array_.h_view.label().c_str()); return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -2925,13 +2895,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "DFMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos 6D", this_array_.h_view.label().c_str()); return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -2943,14 +2913,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DFMatrixKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "DFMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DFMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DFMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DFMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DFMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DFMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DFMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DFMatrixKokkos 7D", this_array_.h_view.label().c_str()); return this_array_.view_device()((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -2996,7 +2966,7 @@ template ::dims(size_t i) const { i--; - MATAR_CHECK_BOUNDS(i, order_, "i", "DFMatrixKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DFMatrixKokkos dims()", this_array_.h_view.label().c_str()); assert(dims_[i]>0 && "Access to DFMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -3338,27 +3308,27 @@ DViewFMatrixKokkos::DViewFMatrixKokkos(T * inp_ template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DViewFMatrixKokkos 1D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "DViewFMatrixKokkos 1D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 1D", ""); return this_array_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DViewFMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "DViewFMatrixKokkos 2D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 2D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 2D", ""); return this_array_((i - 1) + ((j - 1) * dims_[0])); } template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DViewFMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "DViewFMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 3D", ""); return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1])); } @@ -3366,11 +3336,11 @@ T& DViewFMatrixKokkos::operator()(size_t i, siz template KOKKOS_INLINE_FUNCTION T& DViewFMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DViewFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "DViewFMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 4D", ""); return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2])); @@ -3380,12 +3350,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DViewFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "DViewFMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 5D", ""); return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -3396,13 +3366,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "DViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos 6D", ""); return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -3414,14 +3384,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewFMatrixKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "DViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewFMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewFMatrixKokkos 7D", ""); return this_array_((i - 1) + ((j - 1) * dims_[0]) + ((k - 1) * dims_[0] * dims_[1]) + ((l - 1) * dims_[0] * dims_[1] * dims_[2]) @@ -3468,7 +3438,7 @@ template ::dims(size_t i) const { i--; - MATAR_CHECK_BOUNDS(i, order_, "i", "DViewFMatrixKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DViewFMatrixKokkos dims()", ""); assert(dims_[i]>0 && "Access to DViewFMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -3737,27 +3707,27 @@ CArrayKokkos::CArrayKokkos(size_t dim0, size_t template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "CArrayKokkos 1D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "CArrayKokkos 1D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 1D", this_array_.label().c_str()); return this_array_(i); } template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "CArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "CArrayKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 2D", this_array_.label().c_str()); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "CArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "CArrayKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 3D", this_array_.label().c_str()); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -3765,11 +3735,11 @@ T& CArrayKokkos::operator()(size_t i, size_t j, template KOKKOS_INLINE_FUNCTION T& CArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "CArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "CArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 4D", this_array_.label().c_str()); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -3779,12 +3749,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "CArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "CArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos 5D", this_array_.label().c_str()); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -3795,13 +3765,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "CArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "CArrayKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "CArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "CArrayKokkos 6D", this_array_.label().c_str()); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -3813,14 +3783,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "CArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "CArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "CArrayKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "CArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "CArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "CArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "CArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "CArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "CArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "CArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "CArrayKokkos 7D", this_array_.label().c_str()); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -3864,7 +3834,7 @@ size_t CArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t CArrayKokkos::dims(size_t i) const { - MATAR_CHECK_BOUNDS(i, order_, "i", "CArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "CArrayKokkos dims()", this_array_.label().c_str()); assert(dims_[i]>0 && "Access to CArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -4118,27 +4088,27 @@ ViewCArrayKokkos::ViewCArrayKokkos(T* some_array, size_t dim0, template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewCArrayKokkos 1D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "ViewCArrayKokkos 1D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewCArrayKokkos 1D", ""); return this_array_[i]; } template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewCArrayKokkos 2D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 2D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "ViewCArrayKokkos 2D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewCArrayKokkos 2D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewCArrayKokkos 2D", ""); return this_array_[j + (i * dims_[1])]; } template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewCArrayKokkos 3D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 3D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 3D"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "ViewCArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewCArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewCArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "ViewCArrayKokkos 3D", ""); return this_array_[k + (j * dims_[2]) + (i * dims_[2] * dims_[1])]; } @@ -4147,11 +4117,11 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "ViewCArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewCArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewCArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "ViewCArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "ViewCArrayKokkos 4D", ""); return this_array_[l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])]; @@ -4161,12 +4131,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "ViewCArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewCArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewCArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "ViewCArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "ViewCArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "ViewCArrayKokkos 5D", ""); return this_array_[m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -4177,13 +4147,13 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewCArrayKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "ViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "ViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "ViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "ViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "ViewCArrayKokkos 6D", ""); return this_array_[n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -4195,14 +4165,14 @@ template KOKKOS_INLINE_FUNCTION T& ViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(i, dims_[0], "i", "ViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(j, dims_[1], "j", "ViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(k, dims_[2], "k", "ViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(l, dims_[3], "l", "ViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(m, dims_[4], "m", "ViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(n, dims_[5], "n", "ViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS_NO_LABEL(o, dims_[6], "o", "ViewCArrayKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "ViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "ViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "ViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "ViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "ViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "ViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "ViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "ViewCArrayKokkos 7D", ""); return this_array_[o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -4226,7 +4196,7 @@ size_t ViewCArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t ViewCArrayKokkos::dims(size_t i) const { - MATAR_CHECK_BOUNDS_NO_LABEL(i, order_, "i", "ViewCArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "ViewCArrayKokkos dims()", ""); assert(dims_[i]>0 && "Access to ViewCArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -4471,27 +4441,27 @@ CMatrixKokkos::CMatrixKokkos(size_t dim1, size_ template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "CMatrixKokkos 1D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "CMatrixKokkos 1D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 1D", this_array_.label().c_str()); return this_array_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "CMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "CMatrixKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 2D", this_array_.label().c_str()); return this_array_((j - 1) + ((i - 1) * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "CMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "CMatrixKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 3D", this_array_.label().c_str()); return this_array_((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -4499,11 +4469,11 @@ T& CMatrixKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& CMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "CMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "CMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 4D", this_array_.label().c_str()); return this_array_((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); @@ -4513,12 +4483,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "CMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "CMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 5D", this_array_.label().c_str()); return this_array_((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -4529,13 +4499,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "CMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "CMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos 6D", this_array_.label().c_str()); return this_array_((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -4547,14 +4517,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "CMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "CMatrixKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "CMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "CMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "CMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "CMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "CMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "CMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "CMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "CMatrixKokkos 7D", this_array_.label().c_str()); return this_array_((o-1) + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -4599,7 +4569,7 @@ template ::dims(size_t i) const { i--; - MATAR_CHECK_BOUNDS(i, order_, "i", "CMatrixKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "CMatrixKokkos dims()", this_array_.label().c_str()); assert(dims_[i]>0 && "Access to CMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -4845,27 +4815,27 @@ ViewCMatrixKokkos::ViewCMatrixKokkos(T* some_matrix, size_t dim1, size_t dim2 template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER_NO_LABEL(1, order_, "ViewCMatrixKokkos 1D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "ViewCMatrixKokkos 1D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewCMatrixKokkos 1D", ""); return this_array_[(i - 1)]; } template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER_NO_LABEL(2, order_, "ViewCMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "ViewCMatrixKokkos 2D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewCMatrixKokkos 2D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewCMatrixKokkos 2D", ""); return this_array_[(j - 1) + ((i - 1) * dims_[1])]; } template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER_NO_LABEL(3, order_, "ViewCMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "ViewCMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewCMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewCMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "ViewCMatrixKokkos 3D", ""); return this_array_[(k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])]; } @@ -4873,11 +4843,11 @@ T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j , size_t k, size_t l) const { - MATAR_CHECK_ORDER_NO_LABEL(4, order_, "ViewCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "ViewCMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewCMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewCMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "ViewCMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "ViewCMatrixKokkos 4D", ""); return this_array_[(l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])]; @@ -4887,12 +4857,12 @@ template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER_NO_LABEL(5, order_, "ViewCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "ViewCMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewCMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewCMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "ViewCMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "ViewCMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "ViewCMatrixKokkos 5D", ""); return this_array_[(m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -4903,13 +4873,13 @@ template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER_NO_LABEL(6, order_, "ViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewCMatrixKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "ViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "ViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "ViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "ViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "ViewCMatrixKokkos 6D", ""); return this_array_[(n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -4921,14 +4891,14 @@ template KOKKOS_INLINE_FUNCTION T& ViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER_NO_LABEL(7, order_, "ViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(i, dims_[0], "i", "ViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(j, dims_[1], "j", "ViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(k, dims_[2], "k", "ViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(l, dims_[3], "l", "ViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(m, dims_[4], "m", "ViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(n, dims_[5], "n", "ViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX_NO_LABEL(o, dims_[6], "o", "ViewCMatrixKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "ViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "ViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "ViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "ViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "ViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "ViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "ViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "ViewCMatrixKokkos 7D", ""); return this_array_[o + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -4954,7 +4924,7 @@ template KOKKOS_INLINE_FUNCTION size_t ViewCMatrixKokkos::dims(size_t i) const { i--; - MATAR_CHECK_BOUNDS_NO_LABEL(i, order_, "i", "ViewCMatrixKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "ViewCMatrixKokkos dims()", ""); assert(dims_[i]>0 && "Access to ViewCMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -5227,27 +5197,27 @@ DCArrayKokkos::DCArrayKokkos(size_t dim0, size_ template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DCArrayKokkos 1D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "DCArrayKokkos 1D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 1D", this_array_.h_view.label().c_str()); return this_array_.view_device()(i); } template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DCArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "DCArrayKokkos 2D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 2D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 2D", this_array_.h_view.label().c_str()); return this_array_.view_device()(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DCArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "DCArrayKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 3D", this_array_.h_view.label().c_str()); return this_array_.view_device()(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -5255,11 +5225,11 @@ T& DCArrayKokkos::operator()(size_t i, size_t j template KOKKOS_INLINE_FUNCTION T& DCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "DCArrayKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 4D", this_array_.h_view.label().c_str()); return this_array_.view_device()(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -5269,12 +5239,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "DCArrayKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos 5D", this_array_.h_view.label().c_str()); return this_array_.view_device()(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -5285,13 +5255,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DCArrayKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "DCArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DCArrayKokkos 6D", this_array_.h_view.label().c_str()); return this_array_.view_device()(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -5303,14 +5273,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DCArrayKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "DCArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DCArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DCArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DCArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DCArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DCArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DCArrayKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DCArrayKokkos 7D", this_array_.h_view.label().c_str()); return this_array_.view_device()(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -5355,7 +5325,7 @@ size_t DCArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t DCArrayKokkos::dims(size_t i) const { - MATAR_CHECK_BOUNDS(i, order_, "i", "DCArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DCArrayKokkos dims()", this_array_.h_view.label().c_str()); assert(dims_[i]>0 && "Access to DCArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -5721,27 +5691,27 @@ DViewCArrayKokkos::DViewCArrayKokkos(T * inp_ar template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DViewCArrayKokkos 1D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "DViewCArrayKokkos 1D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 1D", ""); return this_array_(i); } template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DViewCArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "DViewCArrayKokkos 2D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 2D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 2D", ""); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DViewCArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "DViewCArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 3D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 3D", ""); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -5749,11 +5719,11 @@ T& DViewCArrayKokkos::operator()(size_t i, size template KOKKOS_INLINE_FUNCTION T& DViewCArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DViewCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "DViewCArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 4D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 4D", ""); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -5763,12 +5733,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DViewCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "DViewCArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 5D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos 5D", ""); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -5779,13 +5749,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewCArrayKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "DViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos 6D", ""); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewCArrayKokkos 6D", ""); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -5797,14 +5767,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewCArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DViewCArrayKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "DViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DViewCArrayKokkos 7D", ""); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DViewCArrayKokkos 7D", ""); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -5851,7 +5821,7 @@ size_t DViewCArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t DViewCArrayKokkos::dims(size_t i) const { - MATAR_CHECK_BOUNDS(i, order_, "i", "DViewCArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DViewCArrayKokkos dims()", ""); assert(dims_[i]>0 && "Access to DViewCArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -6142,27 +6112,27 @@ DCMatrixKokkos::DCMatrixKokkos(size_t dim1, siz template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DCMatrixKokkos 1D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "DCMatrixKokkos 1D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 1D", this_array_.h_view.label().c_str()); return this_array_.view_device()((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DCMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "DCMatrixKokkos 2D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 2D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 2D", this_array_.h_view.label().c_str()); return this_array_.view_device()((j - 1) + ((i - 1) * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DCMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "DCMatrixKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 3D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 3D", this_array_.h_view.label().c_str()); return this_array_.view_device()((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -6170,11 +6140,11 @@ T& DCMatrixKokkos::operator()(size_t i, size_t template KOKKOS_INLINE_FUNCTION T& DCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "DCMatrixKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 4D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 4D", this_array_.h_view.label().c_str()); return this_array_.view_device()((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); @@ -6184,12 +6154,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "DCMatrixKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 5D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 5D", this_array_.h_view.label().c_str()); return this_array_.view_device()((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -6200,13 +6170,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "DCMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 6D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos 6D", this_array_.h_view.label().c_str()); return this_array_.view_device()((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -6218,14 +6188,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DCMatrixKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "DCMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DCMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DCMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DCMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DCMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DCMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DCMatrixKokkos 7D", this_array_.h_view.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DCMatrixKokkos 7D", this_array_.h_view.label().c_str()); return this_array_.view_device()((o-1) + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -6271,7 +6241,7 @@ template ::dims(size_t i) const { i--; - MATAR_CHECK_BOUNDS(i, order_, "i", "DCMatrixKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DCMatrixKokkos dims()", this_array_.h_view.label().c_str()); assert(dims_[i]>0 && "Access to DCMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -6611,27 +6581,27 @@ DViewCMatrixKokkos::DViewCMatrixKokkos(T * inp_ template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DViewCMatrixKokkos 1D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "DViewCMatrixKokkos 1D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 1D", ""); return this_array_((i - 1)); } template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DViewCMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "DViewCMatrixKokkos 2D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 2D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 2D", ""); return this_array_((j - 1) + ((i - 1) * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DViewCMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "DViewCMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 3D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 3D", ""); return this_array_((k - 1) + ((j - 1) * dims_[2]) + ((i - 1) * dims_[2] * dims_[1])); } @@ -6639,11 +6609,11 @@ T& DViewCMatrixKokkos::operator()(size_t i, siz template KOKKOS_INLINE_FUNCTION T& DViewCMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DViewCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "DViewCMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 4D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 4D", ""); return this_array_((l - 1) + ((k - 1) * dims_[3]) + ((j - 1) * dims_[3] * dims_[2]) + ((i - 1) * dims_[3] * dims_[2] * dims_[1])); @@ -6653,12 +6623,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DViewCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "DViewCMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 5D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 5D", ""); return this_array_((m - 1) + ((l - 1) * dims_[4]) + ((k - 1) * dims_[4] * dims_[3]) + ((j - 1) * dims_[4] * dims_[3] * dims_[2]) @@ -6669,13 +6639,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "DViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 6D", ""); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos 6D", ""); return this_array_((n - 1) + ((m - 1) * dims_[5]) + ((l - 1) * dims_[5] * dims_[4]) + ((k - 1) * dims_[5] * dims_[4] * dims_[3]) @@ -6687,14 +6657,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewCMatrixKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "DViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(j, dims_[1], "j", "DViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(k, dims_[2], "k", "DViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(l, dims_[3], "l", "DViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(m, dims_[4], "m", "DViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(n, dims_[5], "n", "DViewCMatrixKokkos 7D", ""); + MATAR_CHECK_BOUNDS_MATRIX(o, dims_[6], "o", "DViewCMatrixKokkos 7D", ""); return this_array_(o + ((n - 1) * dims_[6]) + ((m - 1) * dims_[6] * dims_[5]) + ((l - 1) * dims_[6] * dims_[5] * dims_[4]) @@ -6741,7 +6711,7 @@ template ::dims(size_t i) const { i--; - MATAR_CHECK_BOUNDS(i, order_, "i", "DViewCMatrixKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_, "i", "DViewCMatrixKokkos dims()", ""); assert(dims_[i]>0 && "Access to DViewCMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -7318,7 +7288,7 @@ template ::stride(size_t i) const { // Ensure that i is within bounds - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); return mystrides_dev_(i); } @@ -7328,7 +7298,7 @@ KOKKOS_INLINE_FUNCTION size_t DRaggedRightArrayKokkos::dims(size_t i) const { // Ensure that i is within bounds assert(i >= 0 && "i is less than 0 in the DRaggedRightArrayKokkos class"); - MATAR_CHECK_BOUNDS(i, 3, "i", "DRaggedRightArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, 3, "i", "DRaggedRightArrayKokkos dims()", this_array_.h_view.label().c_str()); return dims_[i]; } @@ -7336,7 +7306,7 @@ size_t DRaggedRightArrayKokkos::dims(si template size_t DRaggedRightArrayKokkos::stride_host(size_t i) const { // Ensure that i is within bounds - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); return mystrides_host_(i); } @@ -7382,8 +7352,8 @@ T& DRaggedRightArrayKokkos::operator()( size_t start = start_index_dev_(i); // asserts - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim1 - MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= stride + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= stride return this_array_dev_(j + start); } // End operator() @@ -7399,9 +7369,9 @@ T& DRaggedRightArrayKokkos::operator()( size_t start = start_index_dev_(i); // asserts - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim0 - MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= dim1 - MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos"); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim0 + MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim2 size_t index_1D = start + k + dims_[1]*j; @@ -7419,10 +7389,10 @@ T& DRaggedRightArrayKokkos::operator()( size_t start = start_index_dev_(i); // asserts - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim1 - MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= stride - MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos"); // die if >= dims_[1] - MATAR_CHECK_BOUNDS(l, dims_[2], "l", "DRaggedRightArrayKokkos"); // die if >= dims_[2] + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= stride + MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dims_[1] + MATAR_CHECK_BOUNDS(l, dims_[2], "l", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dims_[2] size_t index_1D = start + l + dims_[2]*k + dims_[2]*dims_[1]*j; @@ -7437,8 +7407,8 @@ T& DRaggedRightArrayKokkos::host(size_t size_t start = start_index_host_(i); // asserts - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim1 - MATAR_CHECK_BOUNDS(j, stride_host(i), "j", "DRaggedRightArrayKokkos"); // die if >= stride + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride_host(i), "j", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= stride return this_array_host_(j + start); } // End operator() @@ -7452,9 +7422,9 @@ T& DRaggedRightArrayKokkos::host(size_t size_t start = start_index_host_(i); // asserts - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim0 - MATAR_CHECK_BOUNDS(j, stride_host(i), "j", "DRaggedRightArrayKokkos"); // die if >= dim1 - MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos"); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim0 + MATAR_CHECK_BOUNDS(j, stride_host(i), "j", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim2 size_t index_1D = start + k + dims_[1]*j; @@ -7470,10 +7440,10 @@ T& DRaggedRightArrayKokkos::host(size_t size_t start = start_index_host_(i); // asserts - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos"); // die if >= dim1 - MATAR_CHECK_BOUNDS(j, stride_host(i), "j", "DRaggedRightArrayKokkos"); // die if >= stride - MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos"); // die if >= dims_[1] - MATAR_CHECK_BOUNDS(l, dims_[2], "l", "DRaggedRightArrayKokkos"); // die if >= dims_[2] + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride_host(i), "j", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= stride + MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dims_[1] + MATAR_CHECK_BOUNDS(l, dims_[2], "l", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dims_[2] size_t index_1D = start + l + dims_[2]*k + dims_[2]*dims_[1]*j; @@ -7877,9 +7847,9 @@ DynamicArrayKokkos::DynamicArrayKokkos(size_t d template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DynamicArrayKokkos 1D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 1D"); - MATAR_CHECK_BOUNDS(i, dims_actual_size_[0], "i", "DynamicArrayKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "DynamicArrayKokkos 1D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 1D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_actual_size_[0], "i", "DynamicArrayKokkos 1D", this_array_.label().c_str()); return this_array_(i); } @@ -7887,19 +7857,19 @@ T& DynamicArrayKokkos::operator()(size_t i) con template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DynamicArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "DynamicArrayKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 2D", this_array_.label().c_str()); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DynamicArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 3D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "DynamicArrayKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 3D", this_array_.label().c_str()); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -7907,11 +7877,11 @@ T& DynamicArrayKokkos::operator()(size_t i, siz template KOKKOS_INLINE_FUNCTION T& DynamicArrayKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DynamicArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 4D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "DynamicArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 4D", this_array_.label().c_str()); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -7921,12 +7891,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DynamicArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 5D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "DynamicArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos 5D", this_array_.label().c_str()); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -7937,13 +7907,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DynamicArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos 6D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicArrayKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "DynamicArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicArrayKokkos 6D", this_array_.label().c_str()); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -7955,14 +7925,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DynamicArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicArrayKokkos 7D"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DynamicArrayKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "DynamicArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicArrayKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DynamicArrayKokkos 7D", this_array_.label().c_str()); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -8008,7 +7978,7 @@ size_t DynamicArrayKokkos::extent() const { template KOKKOS_INLINE_FUNCTION size_t DynamicArrayKokkos::dims(size_t i) const { - MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicArrayKokkos dims()", this_array_.label().c_str()); assert(dims_actual_size_[i] >= 0 && "Access to DynamicArrayKokkos dims is out of bounds!"); return dims_actual_size_[i]; } @@ -8016,7 +7986,7 @@ size_t DynamicArrayKokkos::dims(size_t i) const template KOKKOS_INLINE_FUNCTION size_t DynamicArrayKokkos::dims_max(size_t i) const { - MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicArrayKokkos dims_max()"); + MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicArrayKokkos dims_max()", this_array_.label().c_str()); assert(dims_[i] >= 0 && "Access to DynamicArrayKokkos dims is out of bounds!"); return dims_[i]; } @@ -8064,7 +8034,7 @@ const std::string DynamicArrayKokkos::get_name( // set values of array template void DynamicArrayKokkos::set_values(T val, int count) { - MATAR_CHECK_BOUNDS(count, dims_[0] + 1, "count", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(count, dims_[0] + 1, "count", "DynamicArrayKokkos", this_array_.label().c_str()); if (count == -1) { // Only set values for the actual size of the array Kokkos::parallel_for("SetValues_DynamicArrayKokkos", dims_actual_size_[0], KOKKOS_CLASS_LAMBDA(const int i) { @@ -8334,10 +8304,10 @@ DynamicMatrixKokkos::DynamicMatrixKokkos(size_t template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i) const { - MATAR_CHECK_ORDER(1, order_, "DynamicMatrixKokkos 1D"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DynamicMatrixKokkos 1D"); + MATAR_CHECK_ORDER(1, order_, "DynamicMatrixKokkos 1D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_[0], "i", "DynamicMatrixKokkos 1D", this_array_.label().c_str()); assert(i > 0 && "i cannot be 0 in DynamicMatrixKokkos 1D!"); - MATAR_CHECK_BOUNDS_MATRIX(i, dims_actual_size_[0], "i", "DynamicMatrixKokkos 1D"); + MATAR_CHECK_BOUNDS_MATRIX(i, dims_actual_size_[0], "i", "DynamicMatrixKokkos 1D", this_array_.label().c_str()); return this_array_((i-1)); } @@ -8345,19 +8315,19 @@ T& DynamicMatrixKokkos::operator()(size_t i) co template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i, size_t j) const { - MATAR_CHECK_ORDER(2, order_, "DynamicMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 2D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 2D"); + MATAR_CHECK_ORDER(2, order_, "DynamicMatrixKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 2D", this_array_.label().c_str()); return this_array_(j + (i * dims_[1])); } template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i, size_t j, size_t k) const { - MATAR_CHECK_ORDER(3, order_, "DynamicMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 3D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 3D"); + MATAR_CHECK_ORDER(3, order_, "DynamicMatrixKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 3D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 3D", this_array_.label().c_str()); return this_array_(k + (j * dims_[2]) + (i * dims_[2] * dims_[1])); } @@ -8365,11 +8335,11 @@ T& DynamicMatrixKokkos::operator()(size_t i, si template KOKKOS_INLINE_FUNCTION T& DynamicMatrixKokkos::operator()(size_t i, size_t j, size_t k, size_t l) const { - MATAR_CHECK_ORDER(4, order_, "DynamicMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 4D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 4D"); + MATAR_CHECK_ORDER(4, order_, "DynamicMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 4D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 4D", this_array_.label().c_str()); return this_array_(l + (k * dims_[3]) + (j * dims_[3] * dims_[2]) + (i * dims_[3] * dims_[2] * dims_[1])); @@ -8379,12 +8349,12 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m) const { - MATAR_CHECK_ORDER(5, order_, "DynamicMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 5D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos 5D"); + MATAR_CHECK_ORDER(5, order_, "DynamicMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 5D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos 5D", this_array_.label().c_str()); return this_array_(m + (l * dims_[4]) + (k * dims_[4] * dims_[3]) + (j * dims_[4] * dims_[3] * dims_[2]) @@ -8395,13 +8365,13 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n) const { - MATAR_CHECK_ORDER(6, order_, "DynamicMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos 6D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicMatrixKokkos 6D"); + MATAR_CHECK_ORDER(6, order_, "DynamicMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos 6D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicMatrixKokkos 6D", this_array_.label().c_str()); return this_array_(n + (m * dims_[5]) + (l * dims_[5] * dims_[4]) + (k * dims_[5] * dims_[4] * dims_[3]) @@ -8413,14 +8383,14 @@ template ::operator()(size_t i, size_t j, size_t k, size_t l, size_t m, size_t n, size_t o) const { - MATAR_CHECK_ORDER(7, order_, "DynamicMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicMatrixKokkos 7D"); - MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DynamicMatrixKokkos 7D"); + MATAR_CHECK_ORDER(7, order_, "DynamicMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DynamicMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dims_[1], "j", "DynamicMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(k, dims_[2], "k", "DynamicMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(l, dims_[3], "l", "DynamicMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(m, dims_[4], "m", "DynamicMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(n, dims_[5], "n", "DynamicMatrixKokkos 7D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(o, dims_[6], "o", "DynamicMatrixKokkos 7D", this_array_.label().c_str()); return this_array_(o + (n * dims_[6]) + (m * dims_[6] * dims_[5]) + (l * dims_[6] * dims_[5] * dims_[4]) @@ -8467,7 +8437,7 @@ template ::dims(size_t i) const { i--; - MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicMatrixKokkos dims()"); + MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicMatrixKokkos dims()", this_array_.label().c_str()); assert(dims_actual_size_[i] >= 0 && "Access to DynamicMatrixKokkos dims is out of bounds!"); return dims_actual_size_[i]; } @@ -8476,7 +8446,7 @@ template ::dims_max(size_t i) const { i--; - MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicMatrixKokkos dims_max()"); + MATAR_CHECK_BOUNDS(i, order_ + 1, "i", "DynamicMatrixKokkos dims_max()", this_array_.label().c_str()); assert(dims_[i] >= 0 && "Access to DynamicMatrixKokkos dims is out of bounds!"); return dims_[i]; } @@ -8524,7 +8494,7 @@ const std::string DynamicMatrixKokkos::get_name // set values of array template void DynamicMatrixKokkos::set_values(T val, int count) { - MATAR_CHECK_BOUNDS(count, dims_[0] + 1, "count", "DynamicArrayKokkos"); + MATAR_CHECK_BOUNDS(count, dims_[0] + 1, "count", "DynamicArrayKokkos", this_array_.label().c_str()); if (count == -1) { // Only set values for the actual size of the array Kokkos::parallel_for("SetValues_DynamicArrayKokkos", dims_actual_size_[0], KOKKOS_CLASS_LAMBDA(const int i) { @@ -8809,7 +8779,7 @@ template ::stride(size_t i) const { // Ensure that i is within bounds - MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos", this_array_.label().c_str()); return mystrides_(i); } @@ -8861,8 +8831,8 @@ T& RaggedRightArrayKokkos::operator()(s size_t start = start_index_(i); // asserts - MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos"); // die if >= dim1 - MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= stride + MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= stride return this_array_(j + start); } // End operator() @@ -9248,7 +9218,7 @@ template ::stride(size_t i) const { // Ensure that i is within bounds - MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos", this_array_.label().c_str()); return mystrides_(i); } @@ -9291,9 +9261,9 @@ T& RaggedRightArrayofVectorsKokkos::ope size_t start = start_index_(i); // asserts - MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos"); // die if >= dim1 - MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos"); // die if >= stride - MATAR_CHECK_BOUNDS(k, vector_dim_, "k", "RaggedRightArrayKokkos"); // die if >= vector_dim + MATAR_CHECK_BOUNDS(i, dim1_, "i", "RaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= stride + MATAR_CHECK_BOUNDS(k, vector_dim_, "k", "RaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= vector_dim return this_array_(j*vector_dim_ + start + k); } // End operator() @@ -9563,7 +9533,7 @@ template ::stride(size_t j) const { // Ensure that j is within bounds - MATAR_CHECK_BOUNDS(j, dim2_, "j", "RaggedDownArrayKokkos"); + MATAR_CHECK_BOUNDS(j, dim2_, "j", "RaggedDownArrayKokkos", this_array_.label().c_str()); return mystrides_(j); } @@ -9577,8 +9547,8 @@ T& RaggedDownArrayKokkos::operator()(si size_t start = start_index_(j); // asserts - MATAR_CHECK_BOUNDS(i, stride(j), "i", "RaggedDownArrayKokkos"); // die if >= stride - MATAR_CHECK_BOUNDS(j, dim2_, "j", "RaggedDownArrayKokkos"); // die if >= dim1 + MATAR_CHECK_BOUNDS(i, stride(j), "i", "RaggedDownArrayKokkos", this_array_.label().c_str()); // die if >= stride + MATAR_CHECK_BOUNDS(j, dim2_, "j", "RaggedDownArrayKokkos", this_array_.label().c_str()); // die if >= dim1 return this_array_(i + start); } // End operator() @@ -9866,8 +9836,8 @@ template ::operator()(size_t i, size_t j) const { // Asserts - MATAR_CHECK_BOUNDS(i, dim1_, "i", "DynamicRaggedRightArrayKokkos"); // die if >= dim1 - MATAR_CHECK_BOUNDS(j, stride_(i), "j", "DynamicRaggedRightArrayKokkos"); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, dim1_, "i", "DynamicRaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride_(i), "j", "DynamicRaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= dim2 // Cannot assert on Kokkos View //assert(j < stride_[i] && "j is out of stride bounds in DynamicRaggedRight"); // die if >= stride @@ -10080,7 +10050,7 @@ size_t DynamicRaggedDownArrayKokkos::size() con template KOKKOS_INLINE_FUNCTION size_t DynamicRaggedDownArrayKokkos::dims(size_t i) const { - MATAR_CHECK_BOUNDS(i, 3, "i", "DynamicRaggedDownArrayKokkos dims()"); + MATAR_CHECK_BOUNDS(i, 3, "i", "DynamicRaggedDownArrayKokkos dims()", this_array_.label().c_str()); if(i == 0) return dim1_; if(i == 1) return dim2_; } @@ -10092,8 +10062,8 @@ template ::operator()(size_t i, size_t j) const { // Asserts - MATAR_CHECK_BOUNDS(j, dim2_, "j", "RaggedDownArrayKokkos"); // die if >= dim2 - MATAR_CHECK_BOUNDS(i, stride(j), "i", "RaggedDownArrayKokkos"); // die if >= stride(j) + MATAR_CHECK_BOUNDS(j, dim2_, "j", "RaggedDownArrayKokkos", this_array_.label().c_str()); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, stride(j), "i", "RaggedDownArrayKokkos", this_array_.label().c_str()); // die if >= stride(j) // Can't do this assert with a Kokkos View //assert(i < stride_[j] && "i is out of stride bounds in DynamicRaggedDownArrayKokkos"); // die if >= stride @@ -10518,7 +10488,7 @@ void CSRArrayKokkos::to_dense(CArrayKokkos KOKKOS_INLINE_FUNCTION size_t CSRArrayKokkos::stride(size_t i) const { - MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos", this_array_.label().c_str()); return start_index_.data()[i+i] - start_index_.data()[i]; } @@ -10538,14 +10508,14 @@ size_t CSRArrayKokkos::dim1() const{ template KOKKOS_INLINE_FUNCTION T* CSRArrayKokkos::begin(size_t i){ - MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos", this_array_.label().c_str()); size_t row_start = start_index_.data()[i]; return &this_array_.data()[row_start]; } template KOKKOS_INLINE_FUNCTION T* CSRArrayKokkos::end(size_t i){ - MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos", this_array_.label().c_str()); size_t row_start = start_index_.data()[i+1]; return &this_array_.data()[row_start]; } @@ -10553,14 +10523,14 @@ T* CSRArrayKokkos::end(size_t i){ template KOKKOS_INLINE_FUNCTION size_t CSRArrayKokkos::begin_index(size_t i) const{ - MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos", this_array_.label().c_str()); return start_index_.data()[i]; } template KOKKOS_INLINE_FUNCTION size_t CSRArrayKokkos::end_index(size_t i) const{ - MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos", this_array_.label().c_str()); return start_index_.data()[i+1]; } @@ -10573,14 +10543,14 @@ size_t CSRArrayKokkos::nnz() const{ template KOKKOS_INLINE_FUNCTION size_t CSRArrayKokkos::nnz(size_t i){ - MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim1_ + 1, "i", "CSRArrayKokkos", this_array_.label().c_str()); return start_index_.data()[i+1] - start_index_.data()[i]; } template KOKKOS_INLINE_FUNCTION T& CSRArrayKokkos::get_val_flat(size_t k) const{ - MATAR_CHECK_BOUNDS(k, nnz_, "k", "CSRArrayKokkos"); + MATAR_CHECK_BOUNDS(k, nnz_, "k", "CSRArrayKokkos", this_array_.label().c_str()); return this_array_.data()[k]; } @@ -10594,7 +10564,7 @@ T& CSRArrayKokkos::get_val_flat(size_t k) cons template KOKKOS_INLINE_FUNCTION size_t CSRArrayKokkos::get_col_flat(size_t k) const{ - MATAR_CHECK_BOUNDS(k, nnz_, "k", "CSRArrayKokkos"); + MATAR_CHECK_BOUNDS(k, nnz_, "k", "CSRArrayKokkos", this_array_.label().c_str()); return column_index_.data()[k]; } @@ -10880,8 +10850,8 @@ template KOKKOS_INLINE_FUNCTION T& CSCArrayKokkos::operator()(size_t i, size_t j) const { // Check if the indices are within bounds - MATAR_CHECK_BOUNDS(i, dim1_, "i", "CSCArrayKokkos 2D"); - MATAR_CHECK_BOUNDS(j, dim2_, "j", "CSCArrayKokkos 2D"); + MATAR_CHECK_BOUNDS(i, dim1_, "i", "CSCArrayKokkos 2D", this_array_.label().c_str()); + MATAR_CHECK_BOUNDS(j, dim2_, "j", "CSCArrayKokkos 2D", this_array_.label().c_str()); size_t col_start = start_index_.data()[j]; size_t col_end = start_index_.data()[j + 1]; @@ -10943,7 +10913,7 @@ CSCArrayKokkos& CSCArrayKokkos KOKKOS_INLINE_FUNCTION size_t CSCArrayKokkos::stride(size_t i) const{ - MATAR_CHECK_BOUNDS(i, dim2_, "i", "CSCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim2_, "i", "CSCArrayKokkos", this_array_.label().c_str()); return start_index_.data()[i+1] - start_index_.data()[i]; } @@ -10963,7 +10933,7 @@ size_t CSCArrayKokkos::dim2() const{ template KOKKOS_INLINE_FUNCTION T* CSCArrayKokkos::begin(size_t i){ - MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos", this_array_.label().c_str()); size_t col_start = start_index_.data()[i]; return &this_array_.data()[col_start]; } @@ -10971,7 +10941,7 @@ T* CSCArrayKokkos::begin(size_t i){ template KOKKOS_INLINE_FUNCTION T* CSCArrayKokkos::end(size_t i){ - MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos", this_array_.label().c_str()); size_t col_start = start_index_.data()[i+1]; return &this_array_.data()[col_start]; } @@ -10979,14 +10949,14 @@ T* CSCArrayKokkos::end(size_t i){ template KOKKOS_INLINE_FUNCTION size_t CSCArrayKokkos::begin_index(size_t i){ - MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos", this_array_.label().c_str()); return start_index_.data()[i]; } template KOKKOS_INLINE_FUNCTION size_t CSCArrayKokkos::end_index(size_t i){ - MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos"); + MATAR_CHECK_BOUNDS(i, dim2_ + 1, "i", "CSCArrayKokkos", this_array_.label().c_str()); return start_index_.data()[i + 1]; } @@ -11269,8 +11239,8 @@ template ::operator()(size_t i, size_t j) const { // Asserts - MATAR_CHECK_BOUNDS(i, dim1_, "i", "DynamicRaggedRightArrayKokkos"); // die if >= dim1 - MATAR_CHECK_BOUNDS(j, mystrides_dev_(i), "j", "DDynamicRaggedRightArrayKokkos"); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, dim1_, "i", "DynamicRaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, mystrides_dev_(i), "j", "DDynamicRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim2 // Cannot assert on Kokkos View //assert(j < stride_[i] && "j is out of stride bounds in DynamicRaggedRight"); // die if >= stride @@ -11282,8 +11252,8 @@ T& DDynamicRaggedRightArrayKokkos::operator()(s template T& DDynamicRaggedRightArrayKokkos::host(size_t i, size_t j) const { // Asserts - MATAR_CHECK_BOUNDS(i, dim1_, "i", "DynamicRaggedRightArrayKokkos"); // die if >= dim1 - MATAR_CHECK_BOUNDS(j, mystrides_host_(i), "j", "DDynamicRaggedRightArrayKokkos"); // die if >= dim2 + MATAR_CHECK_BOUNDS(i, dim1_, "i", "DynamicRaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, mystrides_host_(i), "j", "DDynamicRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim2 // Cannot assert on Kokkos View //assert(j < stride_[i] && "j is out of stride bounds in DynamicRaggedRight"); // die if >= stride @@ -11463,8 +11433,8 @@ InheritedArray2L::InheritedArray2L(size_t some_dim1) { template KOKKOS_INLINE_FUNCTION T& InheritedArray2L::operator()(size_t i, size_t dest) const { - MATAR_CHECK_BOUNDS(i, dim1_, "i", "InheritedArray2L 2D"); - MATAR_CHECK_BOUNDS_NO_LABEL(dest, 2, "dest", "InheritedArray2L 2D"); + MATAR_CHECK_BOUNDS(i, dim1_, "i", "InheritedArray2L 2D", ""); + MATAR_CHECK_BOUNDS(dest, 2, "dest", "InheritedArray2L 2D", ""); if (dest == 0) return h_this_array_(i); else From 3fd4d570f9f8eb313f29643b8d24fd1b4b90bf1a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 12 Feb 2026 20:46:51 +0000 Subject: [PATCH 7/8] Fix DDynamicRaggedRightArrayKokkos to use h_view.label() DDynamicRaggedRightArrayKokkos uses DualView, so it needs to access the label via this_array_.h_view.label().c_str() instead of this_array_.label().c_str(). Also fixed the class name in the error message from 'DynamicRaggedRightArrayKokkos' to 'DDynamicRaggedRightArrayKokkos'. Co-authored-by: Jacob Moore --- src/include/kokkos_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/kokkos_types.h b/src/include/kokkos_types.h index ccd7c2ff..1db5ee0f 100644 --- a/src/include/kokkos_types.h +++ b/src/include/kokkos_types.h @@ -11239,7 +11239,7 @@ template ::operator()(size_t i, size_t j) const { // Asserts - MATAR_CHECK_BOUNDS(i, dim1_, "i", "DynamicRaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(i, dim1_, "i", "DDynamicRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim1 MATAR_CHECK_BOUNDS(j, mystrides_dev_(i), "j", "DDynamicRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim2 // Cannot assert on Kokkos View //assert(j < stride_[i] && "j is out of stride bounds in DynamicRaggedRight"); // die if >= stride @@ -11252,7 +11252,7 @@ T& DDynamicRaggedRightArrayKokkos::operator()(s template T& DDynamicRaggedRightArrayKokkos::host(size_t i, size_t j) const { // Asserts - MATAR_CHECK_BOUNDS(i, dim1_, "i", "DynamicRaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(i, dim1_, "i", "DDynamicRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim1 MATAR_CHECK_BOUNDS(j, mystrides_host_(i), "j", "DDynamicRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim2 // Cannot assert on Kokkos View //assert(j < stride_[i] && "j is out of stride bounds in DynamicRaggedRight"); // die if >= stride From 684feb6043df9cded285d55eab0238f200f96610 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 12 Feb 2026 20:54:01 +0000 Subject: [PATCH 8/8] Fix DRaggedRightArrayKokkos stride bounds checks to use h_view.label() Fixed three bounds checks for the 'j' index in DRaggedRightArrayKokkos that were incorrectly using this_array_.label() instead of this_array_.h_view.label() for DualView access. Also fixed class name in error messages from 'RaggedRightArrayKokkos' to 'DRaggedRightArrayKokkos'. Co-authored-by: Jacob Moore --- src/include/kokkos_types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/kokkos_types.h b/src/include/kokkos_types.h index 1db5ee0f..655b60f3 100644 --- a/src/include/kokkos_types.h +++ b/src/include/kokkos_types.h @@ -7353,7 +7353,7 @@ T& DRaggedRightArrayKokkos::operator()( // asserts MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim1 - MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= stride + MATAR_CHECK_BOUNDS(j, stride(i), "j", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= stride return this_array_dev_(j + start); } // End operator() @@ -7370,7 +7370,7 @@ T& DRaggedRightArrayKokkos::operator()( // asserts MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim0 - MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= dim1 + MATAR_CHECK_BOUNDS(j, stride(i), "j", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim1 MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim2 size_t index_1D = start + k + dims_[1]*j; @@ -7390,7 +7390,7 @@ T& DRaggedRightArrayKokkos::operator()( // asserts MATAR_CHECK_BOUNDS(i, dims_[0], "i", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dim1 - MATAR_CHECK_BOUNDS(j, stride(i), "j", "RaggedRightArrayKokkos", this_array_.label().c_str()); // die if >= stride + MATAR_CHECK_BOUNDS(j, stride(i), "j", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= stride MATAR_CHECK_BOUNDS(k, dims_[1], "k", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dims_[1] MATAR_CHECK_BOUNDS(l, dims_[2], "l", "DRaggedRightArrayKokkos", this_array_.h_view.label().c_str()); // die if >= dims_[2]