MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / matmul

Function matmul

src/backend/cpu/blas.hpp:22–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21template<typename T>
22Array<T> matmul(const Array<T> &lhs, const Array<T> &rhs, af_mat_prop optLhs,
23 af_mat_prop optRhs) {
24 int Mdim = optLhs == AF_MAT_NONE ? 0 : 1;
25 int Ndim = optRhs == AF_MAT_NONE ? 1 : 0;
26 Array<T> res = createEmptyArray<T>(
27 dim4(lhs.dims()[Mdim], rhs.dims()[Ndim], lhs.dims()[2], lhs.dims()[3]));
28 static const T alpha = T(1.0);
29 static const T beta = T(0.0);
30 gemm(res, optLhs, optRhs, &alpha, lhs, rhs, &beta);
31 return res;
32}
33
34template<typename T>
35Array<T> dot(const Array<T> &lhs, const Array<T> &rhs, af_mat_prop optLhs,

Callers 3

convolve2_unwrapFunction · 0.70
conv2DataGradientFunction · 0.70
conv2FilterGradientFunction · 0.70

Calls 3

dim4Class · 0.70
gemmFunction · 0.70
dimsMethod · 0.45

Tested by

no test coverage detected