1#ifndef STAN_MATH_OPENCL_KERNEL_GENERATOR_SCALAR_HPP
2#define STAN_MATH_OPENCL_KERNEL_GENERATOR_SCALAR_HPP
31 static_assert(std::is_arithmetic<T>::value,
32 "class scalar_<T>: std::is_arithmetic<T> must be true!");
58 const std::string& col_index_name,
59 const bool view_handled)
const {
76 std::unordered_map<const void*, const char*>& generated,
77 std::unordered_map<const void*, const char*>& generated_all,
78 cl::Kernel& kernel,
int& arg_num)
const {
79 if (generated.count(
this) == 0) {
81 kernel.setArg(arg_num++,
a_);
104 return {std::numeric_limits<int>::min(), std::numeric_limits<int>::max()};
static constexpr int dynamic
Base for all kernel generator operations.
scalar_(const T a)
Constructor for an arithmetic type.
int rows() const
Number of rows of a matrix that would be the result of evaluating this expression.
scalar_< T > deep_copy() const
Creates a deep copy of this expression.
void set_args(std::unordered_map< const void *, const char * > &generated, std::unordered_map< const void *, const char * > &generated_all, cl::Kernel &kernel, int &arg_num) const
Sets kernel arguments for this and nested expressions.
std::pair< int, int > extreme_diagonals() const
Determine indices of extreme sub- and superdiagonals written.
int cols() const
Number of columns of a matrix that would be the result of evaluating this expression.
kernel_parts generate(const std::string &row_index_name, const std::string &col_index_name, const bool view_handled) const
Generates kernel code for this expression.
Represents a scalar in kernel generator expressions.
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.