Skip to content

Commit

Permalink
use ger internal to simplify the gbtrf implementation details
Browse files Browse the repository at this point in the history
Signed-off-by: Yuuichi Asahi <[email protected]>
  • Loading branch information
Yuuichi Asahi committed Feb 6, 2025
1 parent edca60f commit 507b3bd
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions batched/dense/impl/KokkosBatched_Gbtrf_Serial_Internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <KokkosBatched_Util.hpp>
#include <KokkosBlas1_scal.hpp>
#include <KokkosBatched_Iamax.hpp>
#include "KokkosBatched_Ger_Serial_Internal.hpp"

namespace KokkosBatched {
namespace Impl {
Expand Down Expand Up @@ -92,15 +93,9 @@ KOKKOS_INLINE_FUNCTION int SerialGbtrfInternal<Algo::Gbtrf::Unblocked>::invoke(c
auto x = Kokkos::subview(AB, Kokkos::pair<int, int>(kv + 1, kv + km + 1), j);

// dger or zgeru with alpha = -1.0
for (int k = 0; k < ju - j; ++k) {
auto y_k = AB(kv - 1 - k, j + k + 1);
if (y_k != 0) {
auto temp = -1.0 * y_k;
for (int i = 0; i < km; ++i) {
AB(kv + i - k, j + k + 1) += x(i) * temp;
}
}
}
const int abs0 = AB.stride(0), abs1 = AB.stride(1);
Impl::SerialGerInternal::invoke(KokkosBlas::Impl::OpID(), km, ju - j, -1.0, &AB(kv + 1, j), abs0,
&AB(kv - 1, j + 1), (abs1 - abs0), &AB(kv, j + 1), abs0, (abs1 - abs0));
}
}
}
Expand Down

0 comments on commit 507b3bd

Please sign in to comment.