Skip to content

Commit 507b3bd

Browse files
author
Yuuichi Asahi
committed
use ger internal to simplify the gbtrf implementation details
Signed-off-by: Yuuichi Asahi <y.asahi@nr.titech.ac.jp>
1 parent edca60f commit 507b3bd

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

batched/dense/impl/KokkosBatched_Gbtrf_Serial_Internal.hpp

+4-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <KokkosBatched_Util.hpp>
2222
#include <KokkosBlas1_scal.hpp>
2323
#include <KokkosBatched_Iamax.hpp>
24+
#include "KokkosBatched_Ger_Serial_Internal.hpp"
2425

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

9495
// dger or zgeru with alpha = -1.0
95-
for (int k = 0; k < ju - j; ++k) {
96-
auto y_k = AB(kv - 1 - k, j + k + 1);
97-
if (y_k != 0) {
98-
auto temp = -1.0 * y_k;
99-
for (int i = 0; i < km; ++i) {
100-
AB(kv + i - k, j + k + 1) += x(i) * temp;
101-
}
102-
}
103-
}
96+
const int abs0 = AB.stride(0), abs1 = AB.stride(1);
97+
Impl::SerialGerInternal::invoke(KokkosBlas::Impl::OpID(), km, ju - j, -1.0, &AB(kv + 1, j), abs0,
98+
&AB(kv - 1, j + 1), (abs1 - abs0), &AB(kv, j + 1), abs0, (abs1 - abs0));
10499
}
105100
}
106101
}

0 commit comments

Comments
 (0)