1#ifndef STAN_MATH_OPENCL_KERNEL_GENERATOR_CAST_HPP
2#define STAN_MATH_OPENCL_KERNEL_GENERATOR_CAST_HPP
31template <
typename Scal,
typename T>
54 const std::string& col_index_name,
55 const bool view_handled,
56 const std::string& var_name_arg)
const {
60 + type_str<Scalar>() +
")" + var_name_arg +
";\n";
65 auto&& arg_copy = this->
template get_arg<0>().deep_copy();
66 return cast_<
Scalar, std::remove_reference_t<
decltype(arg_copy)>>{
78template <
typename Scalar,
typename T,
82 return cast_<Scalar, std::remove_reference_t<
decltype(a_operation)>>(
83 std::move(a_operation));
93template <
typename Scalar,
typename T, require_stan_scalar_t<T>* =
nullptr>
kernel_parts generate(const std::string &row_index_name, const std::string &col_index_name, const bool view_handled, const std::string &var_name_arg) const
Generates kernel code for this expression.
cast_(T &&arg)
Constructor.
Represents a typecast os scalar in kernel generator expressions.
Base for all kernel generator operations.
auto cast(T &&a)
Typecast a kernel generator expression scalar.
T_operation && as_operation_cl(T_operation &&a)
Converts any valid kernel generator expression into an operation.
require_all_t< is_kernel_expression_and_not_scalar< Types >... > require_all_kernel_expressions_and_none_scalar_t
Enables a template if all given types are non-scalar types that are a valid kernel generator expressi...
fvar< T > arg(const std::complex< fvar< T > > &z)
Return the phase angle of the complex argument.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Parts of an OpenCL kernel, generated by an expression.