6 use libxsmm,
only : libxsmm_available, libxsmm_dispatch, &
7 libxsmm_dmmcall_abc, libxsmm_dmmfunction, libxsmm_smmcall_abc, &
8 libxsmm_smmfunction, libxsmm_prefetch
18 module procedure mxm_blas_qp
25 module procedure mxm_libxsmm_qp
32 private :: mxm_blas_qp, mxm_libxsmm_qp
39 subroutine mxm(a, n1, b, n2, c, n3)
40 integer,
intent(in) :: n1, n2, n3
41 real(kind=
rp),
intent(in) :: a(n1, n2)
42 real(kind=
rp),
intent(in) :: b(n2, n3)
43 real(kind=
rp),
intent(inout) :: c(n1, n3)
54 integer,
intent(in) :: n1, n2, n3
55 real(kind=
sp),
intent(in) :: a(n1, n2)
56 real(kind=
sp),
intent(in) :: b(n2, n3)
57 real(kind=
sp),
intent(inout) :: c(n1, n3)
59 call sgemm(
'N',
'N', n1, n3, n2, 1.0, a, n1, b, n2, 0.0, c, n1)
64 integer,
intent(in) :: n1, n2, n3
65 real(kind=
dp),
intent(in) :: a(n1, n2)
66 real(kind=
dp),
intent(in) :: b(n2, n3)
67 real(kind=
dp),
intent(inout) :: c(n1, n3)
69 call dgemm(
'N',
'N', n1, n3, n2, 1d0, a, n1, b, n2, 0d0, c, n1)
74 subroutine mxm_blas_qp(a, n1, b, n2, c, n3)
75 integer,
intent(in) :: n1, n2, n3
76 real(kind=
qp),
intent(in) :: a(n1, n2)
77 real(kind=
qp),
intent(in) :: b(n2, n3)
78 real(kind=
qp),
intent(inout) :: c(n1, n3)
82 end subroutine mxm_blas_qp
86 integer,
intent(in) :: n1, n2, n3
87 real(kind=
sp),
intent(in) :: a(n1, n2)
88 real(kind=
sp),
intent(in) :: b(n2, n3)
89 real(kind=
sp),
intent(inout) :: c(n1, n3)
91 type(libxsmm_smmfunction) :: xmm
93 call libxsmm_dispatch(xmm, n1, n3, n2, &
94 alpha = 1.0, beta = 0.0, prefetch = libxsmm_prefetch)
95 if (libxsmm_available(xmm))
then
96 call libxsmm_smmcall_abc(xmm, a, b, c)
103 integer,
intent(in) :: n1, n2, n3
104 real(kind=
dp),
intent(in) :: a(n1, n2)
105 real(kind=
dp),
intent(in) :: b(n2, n3)
106 real(kind=
dp),
intent(inout) :: c(n1, n3)
108 type(libxsmm_dmmfunction) :: xmm
110 call libxsmm_dispatch(xmm, n1, n3, n2, &
111 alpha = 1d0, beta = 0d0, prefetch = libxsmm_prefetch)
112 if (libxsmm_available(xmm))
then
113 call libxsmm_dmmcall_abc(xmm, a, b, c)
120 subroutine mxm_libxsmm_qp(a, n1, b, n2, c, n3)
121 integer,
intent(in) :: n1, n2, n3
122 real(kind=
qp),
intent(in) :: a(n1, n2)
123 real(kind=
qp),
intent(in) :: b(n2, n3)
124 real(kind=
qp),
intent(inout) :: c(n1, n3)
128 end subroutine mxm_libxsmm_qp
Wrapper for all matrix-matrix product implementations.
subroutine, private mxm_blas_sp(a, n1, b, n2, c, n3)
subroutine, private mxm_libxsmm_dp(a, n1, b, n2, c, n3)
subroutine, private mxm_blas_dp(a, n1, b, n2, c, n3)
subroutine, private mxm_libxsmm_sp(a, n1, b, n2, c, n3)
subroutine, public mxm(a, n1, b, n2, c, n3)
Compute matrix-matrix product for contiguously packed matrices A,B, and C.
integer, parameter, public qp
integer, parameter, public dp
integer, parameter, public sp
integer, parameter, public rp
Global precision used in computations.