Closed yasahi-hpc closed 3 weeks ago
Looks fine, the only small question would be: "Are we worried about views containing more than 2B elements with an int return type?"
Assuming that this is a KokkosBatched
functionality, return value should be smaller than 2B elements for a practical use case. However, if you are thinking of security issue like https://github.com/kokkos/kokkos-kernels/pull/2397, it makes sense to use int64_t
. If you prefer, I can fix it accordingly.
I am not really worried was just thinking about it. One thing we could do is check the type that the view is using to store indices and use that. Then the problem becomes a Kokkos Core problem :p
Sure.
I will rely on the index_type
of a View.
This PR implements iamax function, which is needed for getrf PR.
Following files are added:
KokkosBatched_Iamax_Serial_Impl.hpp
: Internal interfaces with implementation detailsKokkosBatched_Iamax.hpp
: APIsTest_Batched_SerialIamax.hpp
: Unit tests for thatDetailed description
This returns the index of the first element having maximum absolute value.
X
:(batch_count, n)
The length N vector.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
X
. Compare the return value with the index of the first element having maximum absolute value.