1#ifndef STAN_MATH_OPENCL_PRIM_STD_NORMAL_LPDF_HPP
2#define STAN_MATH_OPENCL_PRIM_STD_NORMAL_LPDF_HPP
29template <
bool propto,
typename T_y_cl,
30 require_all_prim_or_rev_kernel_expression_t<T_y_cl>* =
nullptr,
31 require_any_not_stan_scalar_t<T_y_cl>* =
nullptr>
33 static constexpr const char* function =
"std_normal_lpdf(OpenCL)";
50 =
check_cl(function,
"Random variable", y_val,
"not NaN");
51 auto y_not_nan = !isnan(y_val);
55 auto y_deriv = -y_val;
72 partials<0>(ops_partials) = std::move(y_deriv_cl);
74 return ops_partials.build(logp);
Represents an arithmetic matrix on the OpenCL device.
elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > elt_multiply(T_a &&a, T_b &&b)
auto check_cl(const char *function, const char *var_name, T &&y, const char *must_be)
Constructs a check on opencl matrix or expression.
results_cl< T_results... > results(T_results &&... results)
Deduces types for constructing results_cl object.
auto as_column_vector_or_scalar(T &&a)
as_column_vector_or_scalar of a kernel generator expression.
calc_if_< true, as_operation_cl_t< T > > calc_if(T &&a)
auto colwise_sum(T &&a)
Column wise sum - reduction of a kernel generator expression.
expressions_cl< T_expressions... > expressions(T_expressions &&... expressions)
Deduces types for constructing expressions_cl object.
return_type_t< T_y_cl > std_normal_lpdf(const T_y_cl &y)
The log of the normal density for the specified scalar(s) given a location of 0 and a scale of 1.
auto from_matrix_cl(const T &src)
Copies the source matrix that is stored on the OpenCL device to the destination Eigen matrix.
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
int64_t size(const T &m)
Returns the size (number of the elements) of a matrix_cl or var_value<matrix_cl<T>>.
T value_of(const fvar< T > &v)
Return the value of the specified variable.
const double NEG_LOG_SQRT_TWO_PI
The value of minus the natural logarithm of the square root of , .
auto sum(const std::vector< T > &m)
Return the sum of the entries of the specified standard vector.
auto make_partials_propagator(Ops &&... ops)
Construct an partials_propagator.
typename partials_return_type< Args... >::type partials_return_t
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.
Metaprogramming struct to detect whether a given type is constant in the mathematical sense (not the ...
Template metaprogram to calculate whether a summand needs to be included in a proportional (log) prob...