1#ifndef STAN_MATH_OPENCL_KERNEL_GENERATOR_CONSTANT_HPP
2#define STAN_MATH_OPENCL_KERNEL_GENERATOR_CONSTANT_HPP
35 static_assert(std::is_arithmetic<T>::value,
36 "class constant_<T>: std::is_arithmetic<T> must be true!");
66 const std::string& col_index_name,
67 const bool view_handled)
const {
84 std::unordered_map<const void*, const char*>& generated,
85 std::unordered_map<const void*, const char*>& generated_all,
86 cl::Kernel& kernel,
int& arg_num)
const {
87 if (generated.count(
this) == 0) {
89 kernel.setArg(arg_num++,
a_);
112 return {std::numeric_limits<int>::min(), std::numeric_limits<int>::max()};
129template <
typename T,
typename = require_arithmetic_t<T>>
std::pair< int, int > extreme_diagonals() const
Determine indices of extreme sub- and superdiagonals written.
int rows() const
Number of rows of a matrix that would be the result of evaluating this expression.
int cols() const
Number of columns of a matrix that would be the result of evaluating this expression.
constant_< T > deep_copy() const
Creates a deep copy of this expression.
constant_(const T a, int rows, int cols)
Constructor.
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.
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 matrix of single repeated value in kernel generator expressions.
Base for all kernel generator operations.
auto constant(const T a, int rows, int cols)
Matrix of repeated values in kernel generator expressions.
int64_t cols(const T_x &x)
Returns the number of columns in the specified kernel generator expression.
int64_t rows(const T_x &x)
Returns the number of rows in the specified kernel generator expression.
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.