Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions include/cute/util/print_tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ print_layout(Layout const& layout) // (m,n) -> idx
CUTE_STATIC_ASSERT_V(rank(layout) == Int<2>{});

int idx_width = num_digits(cosize(layout)) + 2;
const char* delim = "+-----------------------";

print(layout); print("\n");

Expand All @@ -63,7 +62,12 @@ print_layout(Layout const& layout) // (m,n) -> idx
for (int m = 0; m < size<0>(layout); ++m) {
// Header
print(" ");
for (int n = 0; n < size<1>(layout); ++n) { printf("%.*s", idx_width+1, delim); }
for (int n = 0; n < size<1>(layout); ++n) {
printf("+");
for (int i = 0; i < idx_width; ++i) {
printf("-");
}
}
printf("+\n");
// Values
printf("%2d ", m); // Row indices
Expand All @@ -72,7 +76,12 @@ print_layout(Layout const& layout) // (m,n) -> idx
}
// Footer
print(" ");
for (int n = 0; n < size<1>(layout); ++n) { printf("%.*s", idx_width+1, delim); }
for (int n = 0; n < size<1>(layout); ++n) {
printf("+");
for (int i = 0; i < idx_width; ++i) {
printf("-");
}
}
printf("+\n");
}

Expand Down