1#ifndef STAN_MATH_OPENCL_REV_FDIM_HPP
2#define STAN_MATH_OPENCL_REV_FDIM_HPP
57template <
typename T_a,
typename T_b,
58 require_all_prim_or_rev_kernel_expression_t<T_a, T_b>* =
nullptr,
59 require_any_var_t<T_a, T_b>* =
nullptr,
60 require_any_not_stan_scalar_t<T_a, T_b>* =
nullptr>
75 auto a_deriv =
select(a_is_max, res.adj(), nan_check);
76 auto b_deriv =
select(a_is_max, -res.adj(), nan_check);
Represents an arithmetic matrix on the OpenCL device.
select_< as_operation_cl_t< T_condition >, as_operation_cl_t< T_then >, as_operation_cl_t< T_else > > select(T_condition &&condition, T_then &&then, T_else &&els)
Selection operation on kernel generator expressions.
expressions_cl< T_expressions... > expressions(T_expressions &&... expressions)
Deduces types for constructing expressions_cl object.
fvar< T > fdim(const fvar< T > &x, const fvar< T > &y)
Return the positive difference of the specified values (C++11).
static constexpr double NOT_A_NUMBER
(Quiet) not-a-number value.
adjoint_results_cl< T_results... > adjoint_results(T_results &&... results)
Deduces types for constructing adjoint_results_cl object.
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...
T value_of(const fvar< T > &v)
Return the value of the specified variable.
typename internal::arena_type_impl< std::decay_t< T > >::type arena_t
Determines a type that can be used in place of T that does any dynamic allocations on the AD stack.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
bool isnan(const stan::math::var &a)
Checks if the given number is NaN.