implement batched serial getrs #2483
Merged
+569
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements getrs function.
Following files are added:
KokkosBatched_Getrs_Serial_Impl.hpp
: Internal interfacesKokkosBatched_Getrs_Serial_Internal.hpp
: Implementation detailsKokkosBatched_Getrs.hpp
: APIsTest_Batched_SerialGetrs.hpp
: Unit tests for thatDetailed description
It solves a general N-by-N matrix
A
using the LU factorization computed by getrf.Here, the matrix has the following shape.
A
:(batch_count, n, n)
The N-by-N factorized matrix by getrf where
A = P * L * U
; the unit diagonal elements ofL
are not stored.IPIV
:(batch_count, n)
The pivot indices from getrf. for
0 <= i < n
, rowi
of the matrix was interchanged with row IPIV(i).Parallelization would be made in the following manner. This is efficient only when
A is given in
LayoutLeft
for GPUs andLayoutRight
for CPUs (parallelized over batch direction).Tests
A
and factorize it intoLU
withipiv
bygetrf
.Then, solve
A * x = b
withgetrs
to getx
, while keeping the originalb
inx_ref
. Finally, confirm thatA * x
is equal tob (=x_ref)
usinggem
.A
as follows to confirmLU
==A
.