Automatic Differentiation
 
Loading...
Searching...
No Matches
rows_dot_product.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_PRIM_ROWS_DOT_PRODUCT_HPP
2#define STAN_MATH_OPENCL_PRIM_ROWS_DOT_PRODUCT_HPP
3#ifdef STAN_OPENCL
9
10namespace stan {
11namespace math {
12
25template <typename T_a, typename T_b,
26 require_all_kernel_expressions_and_none_scalar_t<T_a, T_b>* = nullptr>
27inline auto rows_dot_product(T_a&& a, T_b&& b) {
28 check_matching_sizes("rows_dot_product", "a", a, "b", b);
29 return rowwise_sum(elt_multiply(std::forward<T_a>(a), std::forward<T_b>(b)));
30}
31
32} // namespace math
33} // namespace stan
34
35#endif
36#endif
elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > elt_multiply(T_a &&a, T_b &&b)
auto rowwise_sum(T &&a)
Rowwise sum reduction of a kernel generator expression.
auto rows_dot_product(T_a &&a, T_b &&b)
Returns the dot product of rows of the specified matrices.
void check_matching_sizes(const char *function, const char *name1, const T_y1 &y1, const char *name2, const T_y2 &y2)
Check if two structures at the same size.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...