Skip to content

Commit

Permalink
Fix printing extents and rank in error message when copying views
Browse files Browse the repository at this point in the history
  • Loading branch information
dalg24 committed Feb 16, 2023
1 parent 10fae1f commit a7daa59
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions core/src/Kokkos_CopyViews.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1636,19 +1636,19 @@ inline void deep_copy(
"match: ");
message += dst.label();
message += "(";
for (int r = 0; r < dst_type::rank - 1; r++) {
message += std::to_string(dst.extent(r));
message += std::to_string(dst.extent(0));
for (size_t r = 1; r < dst_type::rank; r++) {
message += ",";
message += std::to_string(dst.extent(r));
}
message += std::to_string(dst.extent(dst_type::rank - 1));
message += ") ";
message += src.label();
message += "(";
for (int r = 0; r < src_type::rank - 1; r++) {
message += std::to_string(src.extent(r));
message += std::to_string(src.extent(0));
for (size_t r = 1; r < src_type::rank; r++) {
message += ",";
message += std::to_string(src.extent(r));
}
message += std::to_string(src.extent(src_type::rank - 1));
message += ") ";

Kokkos::Impl::throw_runtime_exception(message);
Expand Down Expand Up @@ -1719,19 +1719,19 @@ inline void deep_copy(
"Deprecation Error: Kokkos::deep_copy extents of views don't match: ");
message += dst.label();
message += "(";
for (int r = 0; r < dst_type::rank - 1; r++) {
message += std::to_string(dst.extent(r));
message += std::to_string(dst.extent(0));
for (size_t r = 1; r < dst_type::rank; r++) {
message += ",";
message += std::to_string(dst.extent(r));
}
message += std::to_string(dst.extent(dst_type::rank - 1));
message += ") ";
message += src.label();
message += "(";
for (int r = 0; r < src_type::rank - 1; r++) {
message += std::to_string(src.extent(r));
message += std::to_string(src.extent(0));
for (size_t r = 1; r < src_type::rank; r++) {
message += ",";
message += std::to_string(src.extent(r));
}
message += std::to_string(src.extent(src_type::rank - 1));
message += ") ";

Kokkos::Impl::throw_runtime_exception(message);
Expand Down Expand Up @@ -2800,19 +2800,19 @@ inline void deep_copy(
"match: ");
message += dst.label();
message += "(";
for (int r = 0; r < dst_type::rank - 1; r++) {
message += std::to_string(dst.extent(r));
message += std::to_string(dst.extent(0));
for (size_t r = 1; r < dst_type::rank; r++) {
message += ",";
message += std::to_string(dst.extent(r));
}
message += std::to_string(dst.extent(dst_type::rank - 1));
message += ") ";
message += src.label();
message += "(";
for (int r = 0; r < src_type::rank - 1; r++) {
message += std::to_string(src.extent(r));
message += std::to_string(src.extent(0));
for (size_t r = 1; r < src_type::rank; r++) {
message += ",";
message += std::to_string(src.extent(r));
}
message += std::to_string(src.extent(src_type::rank - 1));
message += ") ";

Kokkos::Impl::throw_runtime_exception(message);
Expand Down Expand Up @@ -2869,19 +2869,19 @@ inline void deep_copy(
"Deprecation Error: Kokkos::deep_copy extents of views don't match: ");
message += dst.label();
message += "(";
for (int r = 0; r < dst_type::rank - 1; r++) {
message += std::to_string(dst.extent(r));
message += std::to_string(dst.extent(0));
for (size_t r = 1; r < dst_type::rank; r++) {
message += ",";
message += std::to_string(dst.extent(r));
}
message += std::to_string(dst.extent(dst_type::rank - 1));
message += ") ";
message += src.label();
message += "(";
for (int r = 0; r < src_type::rank - 1; r++) {
message += std::to_string(src.extent(r));
message += std::to_string(src.extent(0));
for (size_t r = 1; r < src_type::rank; r++) {
message += ",";
message += std::to_string(src.extent(r));
}
message += std::to_string(src.extent(src_type::rank - 1));
message += ") ";

Kokkos::Impl::throw_runtime_exception(message);
Expand Down

0 comments on commit a7daa59

Please sign in to comment.