Automatic Differentiation
 
Loading...
Searching...
No Matches
divide_columns.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_KERNELS_DIVIDE_COLUMNS_HPP
2#define STAN_MATH_OPENCL_KERNELS_DIVIDE_COLUMNS_HPP
3#ifdef STAN_OPENCL
4
7#include <string>
8
9namespace stan {
10namespace math {
11namespace opencl_kernels {
12// \cond
13static constexpr const char *divide_columns_kernel_code = STRINGIFY(
14 // \endcond
24 __kernel void divide_columns_vec(__global double *A, __global double *vec,
25 int vec_size) {
26 const int i = get_global_id(0);
27 A[i] /= vec[i % vec_size];
28 }
29 // \cond
30);
31// \endcond
37 "divide_columns_vec", {indexing_helpers, divide_columns_kernel_code});
38
39} // namespace opencl_kernels
40} // namespace math
41} // namespace stan
42#endif
43#endif
const kernel_cl< out_buffer, in_buffer, int > divide_columns_vec("divide_columns_vec", {indexing_helpers, divide_columns_kernel_code})
See the docs for divide_columns_vec() .
static const std::string indexing_helpers
Defines helper macros for common matrix indexing operations.
Definition helpers.hpp:14
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
#define STRINGIFY(...)
Definition stringify.hpp:9
Creates functor for kernels.