Why is MATLAB so fast in matrix multiplication?

前端 未结 12 1330
無奈伤痛
無奈伤痛 2020-11-22 00:29

I am making some benchmarks with CUDA, C++, C#, Java, and using MATLAB for verification and matrix generation. When I perform matrix multiplication with MATLAB, 2048x

12条回答
  •  清歌不尽
    2020-11-22 01:08

    MATLAB uses a highly optimized implementation of LAPACK from Intel known as Intel Math Kernel Library (Intel MKL) - specifically the dgemm function. The speed This library takes advantage of processor features including SIMD instructions and multi-core processors. They don't document which specific algorithm they use. If you were to call Intel MKL from C++ you should see similar performance.

    I am not sure what library MATLAB uses for GPU multiplication but probably something like nVidia CUBLAS.

提交回复
热议问题