Skip to content

Commit

Permalink
Printing more debug outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
lucbv committed Nov 4, 2024
1 parent c2a51ee commit 690f257
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions batched/dense/unit_test/Test_Batched_SerialQR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,21 @@ struct qrFunctor {
for (int diagIdx = 0; diagIdx < Q.extent_int(0); ++diagIdx) {
Q(diagIdx, diagIdx) = SC_one;
}
Kokkos::printf("Q%d = [%5.2f, %5.2f, %5.2f]\n [%5.2f, %5.2f, %5.2f]\n [%5.2f, %5.2f, %5.2f]\n",
Kokkos::printf("Q stores I\nQ%d = [%5.2f, %5.2f, %5.2f]\n [%5.2f, %5.2f, %5.2f]\n [%5.2f, %5.2f, %5.2f]\n",
matIdx, Q(0, 0), Q(0, 1), Q(0, 2), Q(1, 0), Q(1, 1), Q(1, 2), Q(2, 0), Q(2, 1), Q(2, 2));

// Call ApplyQ on Q
w(0) = 0.0, w(1) = 0.0;
KokkosBatched::SerialApplyQ<Side::Left, Trans::NoTranspose, Algo::ApplyQ::Unblocked>::invoke(A, tau, Q, w);
Kokkos::printf("\nQ%d = [%5.2f, %5.2f, %5.2f]\n [%5.2f, %5.2f, %5.2f]\n [%5.2f, %5.2f, %5.2f]\n",
Kokkos::printf("\nQ stores Q\nQ%d = [%5.2f, %5.2f, %5.2f]\n [%5.2f, %5.2f, %5.2f]\n [%5.2f, %5.2f, %5.2f]\n",
matIdx, Q(0, 0), Q(0, 1), Q(0, 2), Q(1, 0), Q(1, 1), Q(1, 2), Q(2, 0), Q(2, 1), Q(2, 2));

// Now apply Q' to Q
w(0) = 0.0, w(1) = 0.0;
KokkosBatched::SerialApplyQ<Side::Left, Trans::Transpose, Algo::ApplyQ::Unblocked>::invoke(A, tau, Q, w);
// KokkosBatched::SerialApplyQ<Side::Left, Trans::Transpose, Algo::ApplyQ::Unblocked>::invoke(A, tau, Q, w);
KokkosBatched::SerialApplyQ<Side::Left, Trans::NoTranspose, Algo::ApplyQ::Unblocked>::invoke(A, tau, Q, w);
Kokkos::printf("\nQ stores Q'Q=I\nQ%d = [%5.2f, %5.2f, %5.2f]\n [%5.2f, %5.2f, %5.2f]\n [%5.2f, %5.2f, %5.2f]\n",
matIdx, Q(0, 0), Q(0, 1), Q(0, 2), Q(1, 0), Q(1, 1), Q(1, 2), Q(2, 0), Q(2, 1), Q(2, 2));

// At this point Q stores Q'Q
// which should be the identity matrix
Expand Down

0 comments on commit 690f257

Please sign in to comment.