Automatic Differentiation
 
Loading...
Searching...
No Matches
grad.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_REV_FUN_GRAD_HPP
2#define STAN_MATH_OPENCL_REV_FUN_GRAD_HPP
3#ifdef STAN_OPENCL
5
6namespace stan {
7namespace math {
8
22inline void grad(var& v, var_value<matrix_cl<double>>& x, Eigen::VectorXd& g) {
23 grad(v.vi_);
24 g = from_matrix_cl<Eigen::VectorXd>(x.adj());
25}
26
27} // namespace math
28} // namespace stan
29#endif
30#endif
Represents an arithmetic matrix on the OpenCL device.
Definition matrix_cl.hpp:47
static void grad()
Compute the gradient for all variables starting from the end of the AD tape.
Definition grad.hpp:26
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...