1 #ifndef STAN_MATH_OPENCL_KERNELS_SCALAR_MUL_HPP 2 #define STAN_MATH_OPENCL_KERNELS_SCALAR_MUL_HPP 10 namespace opencl_kernels {
12 static const char *scalar_mul_kernel_code =
STRINGIFY(
23 __kernel
void scalar_mul(__global
double *A,
const __global
double *B,
24 const double scalar,
const unsigned int rows,
25 const unsigned int cols) {
26 int i = get_global_id(0);
27 int j = get_global_id(1);
28 if (i < rows && j < cols) {
29 A(i, j) = B(i, j) * scalar;
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
const kernel_cl< out_buffer, in_buffer, double, int, int > scalar_mul("scalar_mul", {indexing_helpers, scalar_mul_kernel_code})
See the docs for add() .
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.