@@ -166,6 +166,39 @@ namespace af
166166 const matProp optLhs = AF_MAT_NONE,
167167 const matProp optRhs = AF_MAT_NONE);
168168
169+ #if AF_API_VERSION >= 35
170+ /* *
171+ \brief Return the dot product of two vectors as a scalar
172+
173+ Scalar dot product between two vectors. Also referred to as the inner
174+ product.
175+
176+ \code
177+ // compute scalar dot product
178+ array x = randu(100), y = randu(100);
179+ float h_dot = dot<float>(x,y);
180+ \endcode
181+
182+ \param[in] lhs The array object on the left hand side
183+ \param[in] rhs The array object on the right hand side
184+ \param[in] optLhs Options for lhs. Currently only \ref AF_MAT_NONE and
185+ AF_MAT_CONJ are supported.
186+ \param[in] optRhs Options for rhs. Currently only \ref AF_MAT_NONE and AF_MAT_CONJ are supported
187+ \return The result of the dot product of lhs, rhs as a host scalar
188+
189+ \note optLhs and optRhs can only be one of \ref AF_MAT_NONE or \ref AF_MAT_CONJ
190+ \note optLhs = AF_MAT_CONJ and optRhs = AF_MAT_NONE will run conjugate dot operation.
191+ \note This function is not supported in GFOR
192+
193+ \returns out = dot(lhs, rhs)
194+
195+ \ingroup blas_func_dot
196+ */
197+ template <typename T> T dot (const array &lhs, const array &rhs,
198+ const matProp optLhs = AF_MAT_NONE,
199+ const matProp optRhs = AF_MAT_NONE);
200+ #endif
201+
169202 /* *
170203 \brief Transposes a matrix
171204
@@ -235,11 +268,41 @@ extern "C" {
235268 print(dot<float>(x,y));
236269 \endcode
237270
271+ \param[out] out The array object with the result of the dot operation
272+ \param[in] lhs The array object on the left hand side
273+ \param[in] rhs The array object on the right hand side
274+ \param[in] optLhs Options for lhs. Currently only \ref AF_MAT_NONE and
275+ AF_MAT_CONJ are supported.
276+ \param[in] optRhs Options for rhs. Currently only \ref AF_MAT_NONE and AF_MAT_CONJ are supported
277+ \return AF_SUCCESS if the process is successful.
278+
238279 \ingroup blas_func_dot
239280 */
240- AFAPI af_err af_dot ( af_array *out,
281+ AFAPI af_err af_dot (af_array *out,
282+ const af_array lhs, const af_array rhs,
283+ const af_mat_prop optLhs, const af_mat_prop optRhs);
284+
285+ #if AF_API_VERSION >= 35
286+ /* *
287+ Scalar dot product between two vectors. Also referred to as the inner
288+ product. Returns the result as a host scalar.
289+
290+ \param[out] real is the real component of the result of dot operation
291+ \param[out] imag is the imaginary component of the result of dot operation
292+ \param[in] lhs The array object on the left hand side
293+ \param[in] rhs The array object on the right hand side
294+ \param[in] optLhs Options for lhs. Currently only \ref AF_MAT_NONE and
295+ AF_MAT_CONJ are supported.
296+ \param[in] optRhs Options for rhs. Currently only \ref AF_MAT_NONE and AF_MAT_CONJ are supported
297+
298+ \return AF_SUCCESS if the process is successful.
299+
300+ \ingroup blas_func_dot
301+ */
302+ AFAPI af_err af_dot_all (double *real, double *imag,
241303 const af_array lhs, const af_array rhs,
242304 const af_mat_prop optLhs, const af_mat_prop optRhs);
305+ #endif
243306
244307 /* *
245308 \brief Transposes a matrix
0 commit comments