magistraleinformaticanetworking:spm:spm14exe1
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
| Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
| magistraleinformaticanetworking:spm:spm14exe1 [20/11/2014 alle 10:12 (11 anni fa)] – [Matrix multiplication] Massimo Torquati | magistraleinformaticanetworking:spm:spm14exe1 [17/12/2014 alle 06:29 (11 anni fa)] (versione attuale) – Massimo Torquati | ||
|---|---|---|---|
| Linea 121: | Linea 121: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | === Sample solutions === | ||
| + | See the matmul example in the FastFlow tutorial source code. | ||
| + | |||
| + | ====== Class work 4 ====== | ||
| + | |||
| + | ===== Macro Data-Flow matrix multiplication ===== | ||
| + | |||
| + | Implement by using the FastFlow MDF pattern (ff_mdf), the matrix multiplication algorithm starting from the following sequential code (matrices are of size NxN, double precision elements) : | ||
| + | < | ||
| + | for(size_t i=0;i<N; ++i) | ||
| + | for(size_t j=0; | ||
| + | A[i*N+j] = i+j; | ||
| + | B[i*N+j] = i*j; | ||
| + | } | ||
| + | for(size_t i=0;i<N; ++i) | ||
| + | for(size_t j=0; | ||
| + | C[i*N +j] = 0; | ||
| + | for(size_t k=0; | ||
| + | C[i*N + j] += A[ i*N+k ]*B[ j*N+k ]; // B is transposed ! | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | The initialization of the two matrices A and B has to be overlapped with the computation of the elements of the C matrix. | ||
| + | |||
| + | {{ http:// | ||
| + | |||
| + | === Sample solutions === | ||
| + | Sample code [[sample_mmmdf14|here]]. | ||
| + | |||
| + | ====== Class work 5 ====== | ||
| + | |||
| + | ===== Map skeleton with dynamic scheduling ===== | ||
| + | |||
| + | |||
| + | === Sample solutions === | ||
| + | Sample code [[sample_dynmap14|here]], | ||
| + | |||
| + | |||
magistraleinformaticanetworking/spm/spm14exe1.1416478347.txt.gz · Ultima modifica: 20/11/2014 alle 10:12 (11 anni fa) da Massimo Torquati
