Ceci est une ancienne révision du document !


MAGMA

MAGMA Matrix Algebra on GPU and Multicore Architectures

The MAGMA project aims to develop a dense linear algebra library similar to LAPACK but for heterogeneous/hybrid architectures, starting with current "Multicore+GPU" systems.

Included are routines for the following algorithms:

  • LU, QR, and Cholesky factorizations in both real and complex arithmetic (single and double);
  • Hessenberg, bidiagonal, and tridiagonal reductions in both real and complex arithmetic (single and double);
  • Linear solvers based on LU, QR, and Cholesky in both real and complex arithmetic (single and double);
  • Eigen and singular value problem solvers in both real and complex arithmetic (single and double);
  • Generalized Hermitian-definite eigenproblem solvers;
  • Mixed-precision iterative refinement solvers based on LU, QR, and Cholesky in both real and complex arithmetic;
  • MAGMA BLAS in real arithmetic (single and double), including gemm, gemv, symv, and trsm.
MAGMA is like BLAS/LAPACK for GPU or CPU + GPU

Version installée

  • magma/cuda/1.2.1 (use module avail magma)
Cette bibliothèque dépend de MKL (blas/lapack) et de CUDA bien sûr

Utilisation

Exemple : ** Matrix Multiplication using MAGMA (subroutine : **DGEMM )

...
...
 
        magma_dsetmatrix( Am, An, h_A, lda, d_A, ldda );
        magma_dsetmatrix( Bm, Bn, h_B, ldb, d_B, lddb );
        magma_dsetmatrix( M, N, h_C, ldc, d_C, lddc );
 
        start = get_current_time();
 
        magmablas_dgemm( transA, transB, M, N, K, 
                         alpha, d_A, ldda,
                                d_B, lddb,
                         beta,  d_C, lddc );
 
        end = get_current_time();
        magma_perf = flops / GetTimerValue(start, end);
 
        magma_dgetmatrix( M, N, d_C, lddc, h_C2, ldc );
 
 
 
 
...
...
Plusieurs exemples se trouvent dans $MAGMA_HOME/testing
Pour compiler un programme utilisant MAGMA vous devez vous connecter aux machines tesla
qlogin -q tesla

Charger le module magma :

module load magma/1.2.1

Adapter le Makefile suivant selon vos besoins :

include make.inc
 
# change $(CC) to $(FORT) to use fortran compiler
 
 
 
### You only need to set your program source file
 
dgmem:
 
     $(CC) dgemm.cpp -o dgmem $(OPTS) $(INC) $(LIBDIR) $(LDLIBS)
  • magma.1376089778.txt.gz
  • Dernière modification : 2015/02/25 08:45
  • (modification externe)