Automatic Differentiation
 
Loading...
Searching...
No Matches
operands_and_partials.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_REV_OPERANDS_AND_PARTIALS_HPP
2#define STAN_MATH_OPENCL_REV_OPERANDS_AND_PARTIALS_HPP
3#ifdef STAN_OPENCL
4
11
12namespace stan {
13namespace math {
14namespace internal {
15
16template <typename Op>
17class ops_partials_edge<double, var_value<Op>,
19 public:
21 partials_t partials_; // For univariate use-cases
23 explicit ops_partials_edge(const var_value<Op>& ops)
24 : partials_(constant(0.0, ops.vi_->rows(), ops.vi_->cols())),
25 partials_vec_(partials_),
26 operands_(ops) {}
27 inline auto& partial() noexcept { return partials_; }
28 inline auto& operand() const noexcept { return operands_; }
30 static constexpr int size() { return 0; }
31};
32
33} // namespace internal
34} // namespace math
35} // namespace stan
36#endif
37#endif
An edge holds both the operands and its associated partial derivatives.
require_t< is_kernel_expression_lhs< std::decay_t< T > > > require_kernel_expression_lhs_t
Require type satisfies is_kernel_expression_lhs.
auto constant(const T a, int rows, int cols)
Matrix of repeated values in kernel generator expressions.
Definition constant.hpp:130
int64_t cols(const T_x &x)
Returns the number of columns in the specified kernel generator expression.
Definition cols.hpp:21
int64_t rows(const T_x &x)
Returns the number of rows in the specified kernel generator expression.
Definition rows.hpp:22
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...