Automatic Differentiation
 
Loading...
Searching...
No Matches
compound_assignments.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_KERNEL_GENERATOR_COMPOUND_ASSIGNMENTS_HPP
2#define STAN_MATH_OPENCL_KERNEL_GENERATOR_COMPOUND_ASSIGNMENTS_HPP
3
5
6namespace stan {
7namespace math {
8
14#define ADD_KG_COMPOUND_ASSIGMENT_OPERATOR(independent, compound) \
15 template <typename T1, typename T2, \
16 require_kernel_expression_lhs_t<T1>* = nullptr, \
17 require_all_kernel_expressions_t<T2>* = nullptr> \
18 T1 operator compound(T1&& a, T2&& b) { \
19 return a = a independent b; \
20 }
21
25
26#undef ADD_KG_COMPOUND_ASSIGMENT_OPERATOR
27
28} // namespace math
29} // namespace stan
30
31#endif // COMPOUND_ASSIGNMENTS_HPP
#define ADD_KG_COMPOUND_ASSIGMENT_OPERATOR(independent, compound)
Adds a compound assignment operator for kernel generator expressions.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...