1 #ifndef STAN_MATH_OPENCL_KERNELS_SUB_BLOCK_HPP 2 #define STAN_MATH_OPENCL_KERNELS_SUB_BLOCK_HPP 11 namespace opencl_kernels {
13 static const char *sub_block_kernel_code =
STRINGIFY(
45 __global
double *src, __global
double *dst,
unsigned int src_offset_i,
46 unsigned int src_offset_j,
unsigned int dst_offset_i,
47 unsigned int dst_offset_j,
unsigned int size_i,
unsigned int size_j,
48 unsigned int src_rows,
unsigned int src_cols,
unsigned int dst_rows,
49 unsigned int dst_cols,
unsigned int triangular_view) {
50 int i = get_global_id(0);
51 int j = get_global_id(1);
52 if ((i + src_offset_i) < src_rows && (j + src_offset_j) < src_cols
53 && (i + dst_offset_i) < dst_rows && (j + dst_offset_j) < dst_cols) {
54 if ((triangular_view == LOWER && i >= j)
55 || (triangular_view == UPPER && i <= j)
56 || triangular_view == ENTIRE) {
57 dst((dst_offset_i + i), (dst_offset_j + j))
58 = src((src_offset_i + i), (src_offset_j + j));
69 const kernel_cl<
in_buffer,
out_buffer, int, int, int, int, int, int, int, int,
static const char * indexing_helpers
const kernel_cl< in_buffer, out_buffer, int, int, int, int, int, int, int, int, int, int, TriangularViewCL > sub_block("sub_block", {indexing_helpers, sub_block_kernel_code})
See the docs for sub_block() .
Creates functor for kernels.