Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| magma [2011/08/30 11:10] – [Compilation] admin | magma [2014/10/02 11:05] (Version actuelle) – admin | ||
|---|---|---|---|
| Ligne 17: | Ligne 17: | ||
| MAGMA is like BLAS/LAPACK for GPU or CPU + GPU</ | MAGMA is like BLAS/LAPACK for GPU or CPU + GPU</ | ||
| ====== Version installée ====== | ====== Version installée ====== | ||
| - | * magma/ | + | * magma/ |
| <note important> | <note important> | ||
| - | |||
| ====== Utilisation ====== | ====== Utilisation ====== | ||
| - | **Exemple : ** Factorisation QR utilisant LAPACK and MAGMA (subroutine : **'' | + | **Exemple : ** Matrix Multiplication using MAGMA (subroutine : **'' |
| - | < | + | < |
| ... | ... | ||
| ... | ... | ||
| - | /* Initialize the matrix */ | + | |
| - | | + | magma_dsetmatrix( Am, An, h_A, lda, d_A, ldda ); |
| - | lapackf77_dlacpy( MagmaUpperLowerStr, | + | magma_dsetmatrix( Bm, Bn, h_B, ldb, d_B, lddb ); |
| - | + | magma_dsetmatrix( M, N, h_C, ldc, d_C, lddc ); | |
| - | /* ===================================================================== | + | |
| - | | + | |
| - | | + | |
| - | start = get_current_time(); | + | |
| - | lapackf77_dgeqrf(& | + | |
| - | end = get_current_time(); | + | |
| - | if (info < 0) | + | |
| - | printf(" | + | |
| - | + | ||
| - | cpu_perf = flops / GetTimerValue(start, | + | |
| - | + | ||
| - | /* ==================================================================== | + | |
| - | | + | |
| - | | + | |
| - | cublasSetMatrix( M, N, sizeof(double), | + | |
| - | | + | |
| - | | + | |
| - | | + | start = get_current_time(); |
| - | magma_dgeqrf2_gpu( M, N, d_A, ldda, tau, & | + | |
| - | end = get_current_time(); | + | |
| - | if (info < 0) | + | |
| - | printf(" | + | |
| | | ||
| - | gpu_perf = flops / GetTimerValue(start, end); | + | magmablas_dgemm( transA, transB, M, N, K, |
| + | | ||
| + | d_B, lddb, | ||
| + | | ||
| + | |||
| + | end = get_current_time(); | ||
| + | magma_perf = flops / GetTimerValue(start, | ||
| + | | ||
| + | magma_dgetmatrix( M, N, d_C, lddc, h_C2, ldc ); | ||
| ... | ... | ||
| ... | ... | ||
| </ | </ | ||
| - | < | + | |
| + | |||
| + | |||
| ===== Compilation ===== | ===== Compilation ===== | ||
| + | |||
| <note warning> | <note warning> | ||
| - | Pour compiler un programme utilisant MAGMA **vous devez** vous connecter aux machines '' | + | Pour compiler un programme utilisant MAGMA **vous devez** vous connecter aux machines '' |
| + | </ | ||
| + | |||
| + | |||
| + | Exemple : | ||
| < | < | ||
| - | qlogin -q tesla | + | qlogin -q tesla.q -l k20 |
| </ | </ | ||
| - | Charger | + | Charger |
| < | < | ||
| - | module load cuda magma | + | module load magma |
| </ | </ | ||
| - | Adapter le '' | + | Adapter le '' |
| - | <file C Makefile> | ||
| - | FIXME | ||
| - | </ | + | <code c> |
| + | |||
| + | include ${MAGMA_HOME}/make.inc | ||
| + | |||
| + | # change $(CC) to $(FORT) to use fortran compiler | ||
| + | # | ||
| + | |||
| + | ### You only need to set your program source | ||
| + | |||
| + | dgmem: | ||
| + | |||
| + | $(CC) dgemm.cpp -o dgmem $(OPTS) $(INC) $(LIBDIR) $(LDLIBS) | ||
| + | |||
| + | </code> | ||
| Ligne 91: | Ligne 96: | ||
| ===== Liens ===== | ===== Liens ===== | ||
| + | * Des exemples se trouvent dans $MAGMA_DIR/ | ||
| * http:// | * http:// | ||
| - | |||