Skip to content

Commit 1ce6fd2

Browse files
author
Yuuichi Asahi
committed
Add missing check for pbtrs
1 parent 2450abd commit 1ce6fd2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

batched/dense/impl/KokkosBatched_Pbtrs_Serial_Impl.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ KOKKOS_INLINE_FUNCTION static int checkPbtrsInput([[maybe_unused]] const AViewTy
3535
#if (KOKKOSKERNELS_DEBUG_LEVEL > 0)
3636
const int ldb = x.extent(0);
3737
const int lda = A.extent(0), n = A.extent(1);
38+
const int kd = lda - 1;
39+
if (kd < 0) {
40+
Kokkos::printf(
41+
"KokkosBatched::pbtrs: leading dimension of A must not be less than 1: %d, A: "
42+
"%d "
43+
"x %d \n",
44+
lda, n);
45+
return 1;
46+
}
3847
if (ldb < Kokkos::max(1, n)) {
3948
Kokkos::printf(
4049
"KokkosBatched::pbtrs: Dimensions of x and A do not match: x: %d, A: "

0 commit comments

Comments
 (0)