This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSPlib - Matrix mul

Hi,

 

For my project, I have to make lot of matrix operation (mul, transpose, inverse). Concerning matrix mul, rather than develop my own function, I trying to use DSPlib function (DSPF_sp_mat_mul). But this function work only with : "All r1, c1, c2 are assumed to be multiple of 2 and >=2".

 

I need to make some (4x3 * 3x1) or (3x3 * 3x3) matrix mul for exemple. Can I use some optimize functions from DSPlib ? Or I need to develop my own function ?

I work on 6678 DSP.

Thanking you in advance 

  • you need to modify original code of DSPF_sp_mat_mul (use it for example).

    1. make decomposition of matrix-multiply (3x3) A*B = a01*b01+a02*b02+a03*b03,........ , then look for elements of matrix A and B, which are being used at same time in different operands (main focus - one load from memory == few computations, due to limitations of block .D)

       for example: max. performance of complex dotp is about 1.03 cycles per 1 complex multiply

                               max. performance of complex mat_mul is about 0.58 cycles per 1 complex multiply

    2. in the loop perform computations for your sub-matrix

    i suggest it gonna take (theory) about 3-4 dsp cycles per one matrix mul 3x3 x 3x3 (3*3*3=27 multiplications, 18 additions)

    DSP can perform 8 float mults and 8 float adds  => 27/8 = 3.375

    Ivan

  • Ivan,

     

    Thank you for your answer.

     

    So I can't use some DSPlib, I must write my own code ?

     

    I am going to looking for DSPF_sp_mat_mul source code.

     

    Jean-Baptiste