Automatic Differentiation
 
Loading...
Searching...
No Matches
rows_dot_self.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_PRIM_ROWS_DOT_SELF_HPP
2#define STAN_MATH_OPENCL_PRIM_ROWS_DOT_SELF_HPP
3#ifdef STAN_OPENCL
9
10namespace stan {
11namespace math {
12
21template <typename T_a,
22 require_all_kernel_expressions_and_none_scalar_t<T_a>* = nullptr>
23inline auto rows_dot_self(T_a&& a) {
24 return rowwise_sum(square(std::forward<T_a>(a)));
25}
26
27} // namespace math
28} // namespace stan
29
30#endif
31#endif
auto rowwise_sum(T &&a)
Rowwise sum reduction of a kernel generator expression.
auto rows_dot_self(T_a &&a)
Returns the dot product of each row of a matrix with itself.
fvar< T > square(const fvar< T > &x)
Definition square.hpp:12
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...