1 #ifndef STAN_MATH_OPENCL_KERNELS_COPY_TRIANGULAR_HPP 2 #define STAN_MATH_OPENCL_KERNELS_COPY_TRIANGULAR_HPP 10 namespace opencl_kernels {
12 static const char *copy_triangular_kernel_code =
STRINGIFY(
34 unsigned int rows,
unsigned int cols,
35 unsigned int lower_upper) {
36 int i = get_global_id(0);
37 int j = get_global_id(1);
38 if (i < rows && j < cols) {
39 if (!lower_upper && j <= i) {
41 }
else if (!lower_upper) {
43 }
else if (lower_upper && j >= i) {
45 }
else if (lower_upper && j < i) {
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, int, int, TriangularViewCL > copy_triangular("copy_triangular", {indexing_helpers, copy_triangular_kernel_code})
See the docs for copy_triangular() .
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.