Matrix Multiplication Example

The algorithm and CellSs code
Below we show an example of coding for Cell Superscalar. The example is a hyper matrix multiplication. The functions submitted to the SPUs are block matrix multiplications. As can be seen, a simple annotation before the declaration of the function is enough to allow this behavior with Cell Superscalar. Following the link below you can download the whole file for this example. A simpe vectorized version of the matmul can be downloaded at the bottom of the page.
The example shows a hyper matrix multiplication calculated by blocks. The functions submitted to the SPUs are block matrix multiplications. An example of coding for Cell Superscalar is shown below.
 


Some Results


  • Scalability
The following graph shows a comparison of the scalability of five versions of the matmul code which only differ in the task code (from + non vectorized to very accurate optimizations). All tests have been run with 2048x2048 matrixes divided in blocks of 64x64 elements.

  • Performance
    The following graph shows the performance of the algorithm in comparison with the machine's peak.

Theoretical Peak 230,4 GFlops for 8 SPEs.




Downloads
Download Matrix Multiplication source files