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

Function matmul

src/backend/opencl/blas.hpp:29–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28template<typename T>
29Array<T> matmul(const Array<T> &lhs, const Array<T> &rhs, af_mat_prop optLhs,
30 af_mat_prop optRhs) {
31 int Mdim = optLhs == AF_MAT_NONE ? 0 : 1;
32 int Ndim = optRhs == AF_MAT_NONE ? 1 : 0;
33 Array<T> res = createEmptyArray<T>(
34 dim4(lhs.dims()[Mdim], rhs.dims()[Ndim], lhs.dims()[2], lhs.dims()[3]));
35 static const T alpha = T(1.0);
36 static const T beta = T(0.0);
37 gemm(res, optLhs, optRhs, &alpha, lhs, rhs, &beta);
38 return res;
39}
40
41template<typename T>
42Array<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

gemmFunction · 0.70
dim4Class · 0.50
dimsMethod · 0.45

Tested by

no test coverage detected