Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
magma [2013/08/09 22:05] – [Compilation] adminmagma [2014/10/02 11:05] (Version actuelle) – admin
Ligne 17: Ligne 17:
 MAGMA is like BLAS/LAPACK for GPU  or CPU + GPU</note> MAGMA is like BLAS/LAPACK for GPU  or CPU + GPU</note>
 ====== Version installée ====== ====== Version installée ======
-  * magma/cuda/1.2.1 (use module avail magma)+  * magma/cuda/1.5.1 (use module avail magma)
  
 <note important>Cette bibliothèque dépend de MKL (blas/lapack) et de CUDA bien sûr </note> <note important>Cette bibliothèque dépend de MKL (blas/lapack) et de CUDA bien sûr </note>
Ligne 23: Ligne 23:
 ====== Utilisation ====== ====== Utilisation ======
  
-**Exemple : ** Factorisation QR utilisant LAPACK and MAGMA (subroutine :  **''DGEQRF''** ) +**Exemple : ** Matrix Multiplication using MAGMA (subroutine :  **''DGEMM''** ) 
-<code Cpp>+<code c>
 ... ...
 ... ...
- /* Initialize the matrix */ +  
-        lapackf77_dlarnv( &ione, ISEED, &n2, h_A ); +magma_dsetmatrix( Am, An, h_A, lda, d_A, ldda ); 
-        lapackf77_dlacpy( MagmaUpperLowerStr, &M, &N, h_A, &lda, h_R, &lda );+magma_dsetmatrix( Bm, Bn, h_B, ldb, d_B, lddb ); 
 +magma_dsetmatrix( M, N, h_C, ldc, d_C, lddc );
  
-        /* ===================================================================== +start = get_current_time();
-           Performs operation using LAPACK +
-           =================================================================== */ +
-        start = get_current_time(); +
-        lapackf77_dgeqrf(&M, &N, h_A, &M, tau, hwork, &lhwork, &info); +
-        end = get_current_time(); +
-        if (info < 0) +
-            printf("Argument %d of lapack_dgeqrf had an illegal value.\n", -info); +
- +
-        cpu_perf = flops / GetTimerValue(start, end); +
- +
-        /* ==================================================================== +
-           Performs operation using MAGMA +
-           =================================================================== */ +
-        cublasSetMatrix( M, N, sizeof(double), h_R, lda, d_A, ldda); +
-        magma_dgeqrf2_gpu( M, N, d_A, ldda, tau, &info); +
-        cublasSetMatrix( M, N, sizeof(double), h_R, lda, d_A, ldda); +
- +
-        start = get_current_time(); +
-        magma_dgeqrf2_gpu( M, N, d_A, ldda, tau, &info); +
-        end = get_current_time(); +
-        if (info < 0) +
-          printf("Argument %d of magma_dgeqrf2 had an illegal value.\n", -info);+
                  
-        gpu_perf = flops / GetTimerValue(start, end);+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 );
 ... ...
 ... ...
 </code> </code>
  
-<note>Plusieurs exemples se trouvent dans $MAGMA_HOME/testing</note>+ 
 + 
 + 
  
 ===== Compilation ===== ===== Compilation =====
 +
 <note warning> <note warning>
-Pour compiler un programme utilisant MAGMA **vous devez** vous connecter aux machines ''tesla''</note>+Pour compiler un programme utilisant MAGMA **vous devez** vous connecter aux machines ''tesla''
  
 +</note>
 +
 +
 +Exemple :
 <code> <code>
-qlogin -q tesla+qlogin -q tesla.q -l k20
 </code> </code>
  
Ligne 74: Ligne 69:
  
 <code> <code>
-module load magma/1.2.1+module load magma
 </code> </code>
  
 Adapter le ''Makefile'' suivant selon vos besoins : Adapter le ''Makefile'' suivant selon vos besoins :
  
-<file C Makefile> 
  
-FIXME 
  
-</file>+<code c> 
 + 
 +include ${MAGMA_HOME}/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) 
 + 
 +</code>
  
  
Ligne 90: Ligne 96:
 ===== Liens ===== ===== Liens =====
  
 +  * Des exemples se trouvent dans $MAGMA_DIR/testing 
   * http://icl.cs.utk.edu/magma/index.html   * http://icl.cs.utk.edu/magma/index.html
  • magma.1376085923.txt.gz
  • Dernière modification : 2015/02/25 08:45
  • (modification externe)