1 #ifndef STAN_MATH_OPENCL_KERNELS_ZEROS_HPP 2 #define STAN_MATH_OPENCL_KERNELS_ZEROS_HPP 10 namespace opencl_kernels {
12 static const char* zeros_kernel_code =
STRINGIFY(
31 __kernel
void zeros(__global
double* A,
unsigned int rows,
32 unsigned int cols,
unsigned int part) {
33 int i = get_global_id(0);
34 int j = get_global_id(1);
35 if (i < rows && j < cols) {
36 if (part == LOWER && j < i) {
38 }
else if (part == UPPER && j > i) {
40 }
else if (part == ENTIRE) {
int rows(const Eigen::Matrix< T, R, C > &m)
Return the number of rows in the specified matrix, vector, or row vector.
static const char * indexing_helpers
int cols(const Eigen::Matrix< T, R, C > &m)
Return the number of columns in the specified matrix, vector, or row vector.
Creates functor for kernels.
const kernel_cl< out_buffer, int, int, TriangularViewCL > zeros("zeros", {indexing_helpers, zeros_kernel_code})
See the docs for zeros() .