Automatic Differentiation
 
Loading...
Searching...
No Matches
dot_product.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_PRIM_DOT_PRODUCT_HPP
2#define STAN_MATH_OPENCL_PRIM_DOT_PRODUCT_HPP
3#ifdef STAN_OPENCL
9
10namespace stan {
11namespace math {
12
24template <typename T_a, typename T_b,
25 require_all_kernel_expressions_and_none_scalar_t<T_a, T_b>* = nullptr>
26inline auto dot_product(const T_a& a, const T_b& b) {
27 const char* function = "dot_product(OpenCL)";
28 check_vector(function, "a", a);
29 check_vector(function, "b", b);
30 return sum(elt_multiply(a, b));
31}
32
33} // namespace math
34} // namespace stan
35
36#endif
37#endif
elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > elt_multiply(T_a &&a, T_b &&b)
void check_vector(const char *function, const char *name, const Mat &x)
Check the input is either a row vector or column vector or a matrix with a single row or column.
fvar< T > sum(const std::vector< fvar< T > > &m)
Return the sum of the entries of the specified standard vector.
Definition sum.hpp:22
auto dot_product(const T_a &a, const T_b &b)
Returns the dot product of the specified vectors.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9