MAGMA: Initialize ipiv data to avoid internal memory access violation (#53064)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/51930
Running the reproducer under `cuda-gdb`, I see access violations in either [`zswap_kernel_batched`](https://bitbucket.org/icl/magma/src/4fd4634f35020e315b05689c277899dbd09749ed/magmablas/zgetf2_kernels.cu?at=master#lines-276) (part of the LU factorization) and other times in [`zlaswp_columnserial_kernel`](https://bitbucket.org/icl/magma/src/4fd4634f35020e315b05689c277899dbd09749ed/magmablas/zlaswp_batched.cu?at=master#lines-335) (part of the inverse).
The common factor between both of these is they use `ipiv` to index into the matrix. My best guess is the `ipiv` indices aren't written when the factorization fails, hence garbage data is used as matrix indices and we get an access violation. Initializing `ipiv` to a known-good value before the factorization fixes the issue.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/53064
Reviewed By: zhangguanheng66
Differential Revision: D26829053
Pulled By: heitorschueroff
fbshipit-source-id: 842854a6ee182f20b2acad0d76d32d27cb51b061