为什么MATLAB在矩阵乘法中速度这么快?
2048x2048
1024x1024 2048x2048 4096x4096 --------- --------- --------- CUDA C (ms) 43.11 391.05 3407.99 C++ (ms) 6137.10 64369.29 551390.93 C# (ms) 10509.00 300684.00 2527250.00 Java (ms) 9149.90 92562.28 838357.94 MATLAB (ms) 75.01 423.10 3133.90
60x
float temp = 0;timer.start();for(int j = 0; j < rozmer; j++){ for (int k = 0; k < rozmer; k++) { temp = 0; for (int m = 0; m < rozmer; m++) { temp = temp + matice1[j][m] * matice2[m][k]; } matice3[j][k] = temp; }}timer.stop();
2048
1024
?
4096x4096
梵蒂冈之花
小唯快跑啊
慕的地6264312