fortran调用MKL函数库中的gemm的fortran95接口计算矩阵相乘

关于MKL函数库的使用参见下面视频
http://v.fcode.cn/video-use_library.html

下面给出示例代码
program TestMKLgemm
        use blas95
        implicit none
        integer, parameter :: m = 2, k = 2, n = 2
        real*8 :: A(m,k), B(k,n), C(m,n)
 
        A = reshape([1,2,3,4],shape(A))
        B = reshape([5,6,7,8],shape(B))
        
        C = 0.d0
        call gemm(A, B, C)
 
end program TestMKLgemm

此代码经过测试,运行正确。如果你在使用的过程中哪里出现了问题,请一定要相信是你哪里配置有问题

 

你可能感兴趣的:(FortranNote,Fortran教程,MKL函数库,fortran)