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

Function dot

src/backend/cpu/kernel/dot.hpp:33–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32template<typename T, bool conjugate, bool both_conjugate>
33void dot(Param<T> output, CParam<T> lhs, CParam<T> rhs, af_mat_prop optLhs,
34 af_mat_prop optRhs) {
35 UNUSED(optLhs);
36 UNUSED(optRhs);
37 int N = lhs.dims(0);
38
39 T out = 0;
40 const T *pL = lhs.get();
41 const T *pR = rhs.get();
42
43 for (int i = 0; i < N; i++)
44 out += (conjugate ? kernel::conj(pL[i]) : pL[i]) * pR[i];
45
46 if (both_conjugate) out = kernel::conj(out);
47
48 *output.get() = out;
49}
50
51} // namespace kernel
52} // namespace cpu

Callers

nothing calls this directly

Calls 3

conjFunction · 0.70
dimsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected