Automatic Differentiation
 
Loading...
Searching...
No Matches
fill_strict_tri.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_KERNELS_FILL_STRICT_TRI_HPP
2#define STAN_MATH_OPENCL_KERNELS_FILL_STRICT_TRI_HPP
3#ifdef STAN_OPENCL
4
8#include <string>
9
10namespace stan {
11namespace math {
12namespace opencl_kernels {
13// \cond
14static constexpr const char* fill_strict_tri_kernel_code = STRINGIFY(
15 // \endcond
32 __kernel void fill_strict_tri(__global double* A, double val,
33 unsigned int rows, unsigned int cols,
34 unsigned int view_A) {
35 const int i = get_global_id(0);
36 const int j = get_global_id(1);
37 if (i < rows && j < cols) {
38 if ((view_A == LOWER && j < i) || (view_A == UPPER && j > i)
39 || view_A == ENTIRE) {
40 A(i, j) = val;
41 }
42 }
43 }
44 // \cond
45);
46// \endcond
47
53 "fill_strict_tri",
54 {indexing_helpers, view_kernel_helpers, fill_strict_tri_kernel_code});
55
56} // namespace opencl_kernels
57} // namespace math
58} // namespace stan
59#endif
60#endif
const kernel_cl< out_buffer, double, int, int, matrix_cl_view > fill_strict_tri("fill_strict_tri", {indexing_helpers, view_kernel_helpers, fill_strict_tri_kernel_code})
See the docs for fill_strict_tri_kernel_code() .
int64_t cols(const T_x &x)
Returns the number of columns in the specified kernel generator expression.
Definition cols.hpp:21
int64_t rows(const T_x &x)
Returns the number of rows in the specified kernel generator expression.
Definition rows.hpp:22
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.