1#ifndef STAN_MATH_OPENCL_KERNELS_REP_MATRIX_HPP
2#define STAN_MATH_OPENCL_KERNELS_REP_MATRIX_HPP
12namespace opencl_kernels {
14static constexpr const char* rep_matrix_rev_kernel_code =
STRINGIFY(
26 unsigned int B_rows,
unsigned int B_cols,
27 unsigned int view_B) {
28 const int gid_i = get_global_id(0);
29 const int gid_j = get_global_id(1);
30 const int gsize_i = get_global_size(0);
31 const int gsize_j = get_global_size(1);
33 for (
int j = gid_j; j < B_cols; j += gsize_j) {
37 : ((j - gid_i + gsize_i - 1) / gsize_i) * gsize_i + gid_i;
39 for (
int i = i_start; i < i_end; i += gsize_i) {
40 tmp += B_adj[j * B_rows + i];
43 A_adj[gid_j * gsize_i + gid_i] += tmp;
52const kernel_cl<in_out_buffer, in_buffer, int, int, matrix_cl_view>
54 {view_kernel_helpers, rep_matrix_rev_kernel_code});
const kernel_cl< in_out_buffer, in_buffer, int, int, matrix_cl_view > rep_matrix_rev("rep_matrix_rev", {view_kernel_helpers, rep_matrix_rev_kernel_code})
See the docs for rep_matrix_rev() .
bool contains_nonzero(const matrix_cl_view view, const matrix_cl_view part)
Check whether a view contains certain nonzero part.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...