mathnet-numerics icon indicating copy to clipboard operation
mathnet-numerics copied to clipboard

Consider Magma linear algebra native provider

Open cdrnet opened this issue 10 years ago • 2 comments

http://icl.cs.utk.edu/magma/

cdrnet avatar Jul 20 '14 20:07 cdrnet

I'm quite interested in having a look at Magma and getting it working with MathNet. There are a couple of questions I have before I look into it further though.

Firstly, Magma requires a CPU based BLAS and LAPACK library such as OpenBLAS or MKL when being built and used. There are also three versions of Magma for CUDA, OpenCL and Intel Xeon Phi. So along with supporting the two CPU libraries that would give six potentially different wrapper projects. Do we create:

  1. six wrapper projects linking to the different libraries and six corresponding native providers;
  2. six wrapper projects and a single native provider which chooses which wrapper library to use; or
  3. a single wrapper project which dynamically loads the required native libraries and a single native provider

I don't think we should support Xeon Phi, particularly as MKL now supports automatic offload, but I would be very interested in a provider which supports both OpenCL and CUDA and could automatically or programmatically be be chosen depending on the system the program runs on. Or, since OpenCL should run on Intel, AMD and nVidia GPUs just support the OpenCL version.

Secondly, Magma has functions which either result in the arrays being stored in CPU memory or GPU memory. Similar to the discussions in #329 array storage management for Magma would also need to be considered unless we only use the functions which store results in CPU memory (and hence I'd assume Magma would favour CPU calculations over GPU in order to reduce copying).

kjbartel avatar Jun 24 '15 03:06 kjbartel

+1 for a single native provider

cuda avatar Jun 28 '15 13:06 cuda