1#ifndef STAN_MATH_OPENCL_KERNELS_ADD_HPP
2#define STAN_MATH_OPENCL_KERNELS_ADD_HPP
12namespace opencl_kernels {
15static constexpr const char *add_batch_kernel_code =
STRINGIFY(
32 __kernel
void add_batch(__global
double *B, __global
double *A,
33 unsigned int rows,
unsigned int cols,
34 unsigned int batch_size) {
35 const int i = get_global_id(0);
36 const int j = get_global_id(1);
39 for (
int k = 0; k < batch_size; k++) {
40 temp += A_batch(i, j, k);
const kernel_cl< out_buffer, in_buffer, int, int, int > add_batch("add_batch", {indexing_helpers, add_batch_kernel_code})
See the docs for add_batch() .
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.
static const std::string indexing_helpers
Defines helper macros for common matrix indexing operations.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Creates functor for kernels.