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.

对库函数DSPF_dp_mat_mul_gemm使用的提问



此程序是在6678上单核运行的,使用Enea操作系统,软件版本是5.1。

对库函数DSPF_dp_mat_mul_gemm()的提问

    double aaa1[8] = {1,2,3,4,1,1,1,1};
    double bbb1[8] = {2,3,4,4,1,1,1,1};
    double ccc1[4] = {1,1,1,1};
   
    double aaa[8] = {1,1,1,1,1,1,1,1};
    double bbb[8] = {9,9,9,9,1,1,1,1};
    double ccc[4] = {1,1,1,1};
   
    DSPF_dp_mat_mul_gemm (aaa1, 1, 2, 4, bbb1, 2, ccc1);
    DSPF_dp_mat_mul_gemm (aaa, 1, 2, 4, bbb, 2, ccc);
   
    printf("%lf %lf %lf %lf\n",ccc1[0] ,ccc1[1], ccc1[2], ccc1[3]);
    printf("%lf %lf %lf %lf\n",ccc[0] ,ccc[1], ccc[2], ccc[3]);
   
在看了函数的说明之后,感觉上述程序是应该可以运行成功的。但是出了一些问题。

第一种:
在File Search Path中加入路径“G:\ti\dsplib_c66x_3_1_0_0\lib\dsplib.ae66"后,直接运行。
出现问题,打印信息为如下,
[C66xx_10] 1.000000 1.000000 1.000000 1.000000
[C66xx_10] 1.000000 1.000000 1.000000 1.000000

第二种:
在工程中加入DSPF_dp_mat_mul_gemm.c 和 DSPF_dp_mat_mul_gemm.h 文件,程序中加入#include "DSPF_dp_mat_mul_gemm.h",也就是利用c文件去计算,运行结果正确。
[C66xx_10] 37.000000 14.000000 11.000000 5.000000
[C66xx_10] 37.000000 37.000000 5.000000 5.000000

问题:虽然利用第二种可以计算出正确结果,但是用第一种应该计算会更快一些,可为什么不能用呢,是我使用的问题吗?