0

What might be the most efficient way of calculating the following expression using CUDA C ?

(A - B(D^-1)B^T )^-1

where D is a very large symmetric matrix and A is a small symmetric matrix, which makes B and B^T medium sized rectangular non-symmetric matrices. Of course (^-1) and (^T) are the inverse and transpose operations, respectively.

talonmies
  • 70,661
  • 34
  • 192
  • 269
hko
  • 139
  • 3
  • 10
  • 1
    That's an expression, not an equation... – Oliver Charlesworth Aug 17 '13 at 19:19
  • Matrix inversion could be performed by [CULA Matrix Inversion](http://www.culatools.com/forums/viewtopic.php?f=14&t=141) or [MAGMA Matrix Inversion](http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=571) routines. For matrix multiplications, including transpositions, you could use `cuBLAS` routines. This would be the easiest way to solve your problem. – Vitality Aug 17 '13 at 19:33
  • @Oli you are right, I corrected. – hko Aug 17 '13 at 19:35
  • @Jack thanks for the inversion routines. I do have a specific [question](http://stackoverflow.com/questions/18292258/packed-symmetric-matrix-matrix-multiplication-with-cuda) for the multiplication. Could you help me with that ? – hko Aug 17 '13 at 19:40
  • I'm not aware of that possibility. Perhaps, packed storage could be difficult to be efficiently implemented on GPUs and I do not think there is much demand for that in the community. – Vitality Aug 17 '13 at 19:49
  • All of those operations are available in [ArrayFire](http://accelereyes.com/arrayfire), including matrix multiplication, inversion, transpose, solving linear systems, element-wise operations, etc, all without writing any low-level kernels, which we work on at AccelerEyes. – arrayfire Aug 17 '13 at 23:57

1 Answers1

1

If you are available to "low" level programming, then matrix inversion could be performed by CULA or MAGMA libraries.

CULA Dense contains single (real or complex) precision of System Solve, Linear Least Squares Solve, and Constrained Linear Least Squares Solve. CULA Sparse is a collection of iterative solvers for sparse matrices. Magma contains dgetrf and dgetri to calculate inverses of square double precision matrices.

For matrix multiplications, including transpositions, you could use cuBLAS routines.

If you prefer "higher" level programming, then ArrayFire enables you to perform matrix multiplications, inversions, transposes, solution of linear systems, and elementwise operations with a more naturale mathematical syntax. Also, Matlab has a GPU Computing Support for NVIDIA CUDA-Enabled GPUs.

Vitality
  • 20,705
  • 4
  • 108
  • 146
  • Its seems that only CULA and MAGMA are free. For the symmetric matrix inversion I need to use `ZPOTRF` and `ZPOTRI` functions sequentially, which are all avaliable in MAGMA but not in CULA. However, I could not install MAGMA, since it does not have a detailed readme file and I have very limited experience about installing libraries. So, any help with that is appreciated. – hko Aug 26 '13 at 12:27
  • Please, note that the basic functions of ArrayFire are free, see [ArrayFire Licensing](http://www.accelereyes.com/products/arrayfire_licensing). Perhaps you will find there matrix multiplication and transpose, but not matrix inversion. If you have issues in installing MAGMA, could you refer to their [forum](http://icl.cs.utk.edu/magma/forum/)? As an alternative, you could use [Matlab's GPU computation functionalities](http://www.mathworks.com/discovery/matlab-gpu.html) (I will add this to my answer), if you happen to have access to a licensed product. – Vitality Aug 26 '13 at 13:09
  • Thanks, I must to use C/C++ and Visual Studio. I also need double complex precision but most free libraries do not support this. In this case only MAGMA fits to me, but even in their forum I couldn't find a clear response to how to install MAGMA and use it with Visual Studio. – hko Aug 27 '13 at 11:37
  • I'm not aware of any other library fulfilling your requirements. – Vitality Aug 27 '13 at 12:07