Automatic Differentiation
 
Loading...
Searching...
No Matches
erfcx.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_REV_ERFCX_HPP
2#define STAN_MATH_OPENCL_REV_ERFCX_HPP
3#ifdef STAN_OPENCL
4
8
9namespace stan {
10namespace math {
11
26template <typename T,
27 require_all_kernel_expressions_and_none_scalar_t<T>* = nullptr>
29 return make_callback_var(
30 erfcx(A.val()), [A](vari_value<matrix_cl<double>>& res) mutable {
31 A.adj()
32 += elt_multiply(res.adj(), erfcx_derivative(A.val(), res.val()));
33 });
34}
35
36} // namespace math
37} // namespace stan
38
39#endif
40#endif
Represents an arithmetic matrix on the OpenCL device.
Definition matrix_cl.hpp:47
var_value< plain_type_t< T > > make_callback_var(T &&value, F &&functor)
Creates a new var initialized with a callback_vari with a given value and reverse-pass callback funct...
fvar< T > erfcx(const fvar< T > &x)
Return the scaled complementary error function of the argument.
Definition erfcx.hpp:26
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...