# cuSOLVER LU Decomposition with multiple RHS

**URL:** <https://forums.developer.nvidia.com/t/cusolver-lu-decomposition-with-multiple-rhs/221929>\
**Category:** GPU-Accelerated Libraries\
**Tags:** cusolver\
**Created:** [July 26, 2022, 3:51pm UTC](https://forums.developer.nvidia.com/t/cusolver-lu-decomposition-with-multiple-rhs/221929 "2022-07-26T15:51:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![picard1969](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@picard1969](https://forums.developer.nvidia.com/u/picard1969)\
**Post date:** [July 26, 2022, 3:51pm UTC](https://forums.developer.nvidia.com/t/cusolver-lu-decomposition-with-multiple-rhs/221929/1 "2022-07-26T15:51:47Z")

</div>

Good afternoon,

I am new to using cusolver with dense matrices and would like to know if there is information on how to use this library to implement a particular version of LU Decomposition. I would like to be able to pass a matrix and vector to solve using LU Decomposition whereby the vector is actually made up of multiple columns rather than a single column. Is this possible and if so can anyone provide a link/example code to this?

Thank you for any assistance.

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [July 27, 2022, 4:25am UTC](https://forums.developer.nvidia.com/t/cusolver-lu-decomposition-with-multiple-rhs/221929/2 "2022-07-27T04:25:44Z")

</div>

solution of a dense linear system using LU factorization is supported using the routines [cusolverDnXgetrf](https://docs.nvidia.com/cuda/cusolver/index.html#cusolverDnXgetrf) for factorization followed by [cusolverDnXgetrs](https://docs.nvidia.com/cuda/cusolver/index.html#cusolverDnXgetrs) for the solve. Multiple RHS are supported. A sample code is [here](https://github.com/NVIDIA/CUDALibrarySamples/tree/master/cuSOLVER/Xgetrf). Yes, I’m aware that the sample code doesn’t demonstrate multiple RHS. That should be a fairly trivial adaptation.

---

<div class="post-metadata">

**Author:** ![picard1969](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@picard1969](https://forums.developer.nvidia.com/u/picard1969)\
**Post date:** [July 27, 2022, 11:56am UTC](https://forums.developer.nvidia.com/t/cusolver-lu-decomposition-with-multiple-rhs/221929/3 "2022-07-27T11:56:11Z")

</div>

Thanks @Robert_Crovella that is just what I was looking for.

Also, am I correct in the idea that cuSOLVER for dense matrix operations employs column-major format?

Thanks again.

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [July 27, 2022, 9:31pm UTC](https://forums.developer.nvidia.com/t/cusolver-lu-decomposition-with-multiple-rhs/221929/4 "2022-07-27T21:31:49Z")

</div>

From [here](https://docs.nvidia.com/cuda/cusolver/index.html#format-dense-matrix):

> 2.3.3. Matrix (Dense) Format  
> The dense matrices are assumed to be stored in column-major order in memory.

---

<div class="post-metadata">

**Author:** ![picard1969](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@picard1969](https://forums.developer.nvidia.com/u/picard1969)\
**Post date:** [August 1, 2022, 11:58am UTC](https://forums.developer.nvidia.com/t/cusolver-lu-decomposition-with-multiple-rhs/221929/5 "2022-08-01T11:58:23Z")

</div>

Cool, thanks. Just wanted to be sure.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [August 15, 2022, 11:59am UTC](https://forums.developer.nvidia.com/t/cusolver-lu-decomposition-with-multiple-rhs/221929/6 "2022-08-15T11:59:04Z")

</div>

Closed on August 15, 2022, 11:59am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
