| 31 | |
| 32 | template<typename T, bool conjugate, bool both_conjugate> |
| 33 | void 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 |