1 #ifndef STAN_MATH_OPENCL_KERNELS_CHECK_NAN_HPP 2 #define STAN_MATH_OPENCL_KERNELS_CHECK_NAN_HPP 10 namespace opencl_kernels {
12 static const char *is_nan_kernel_code =
STRINGIFY(
26 __kernel
void is_nan(__global
double *A, __global
int *flag,
27 unsigned int rows,
unsigned int cols) {
28 const int i = get_global_id(0);
29 const int j = get_global_id(1);
30 if (i < rows && j < cols) {
int rows(const Eigen::Matrix< T, R, C > &m)
Return the number of rows in the specified matrix, vector, or row vector.
__kernel void is_nan(__global double *A, __global int *flag, unsigned int rows, unsigned int cols)
Check if the matrix_cl has NaN values.
static const char * indexing_helpers
int isnan(const stan::math::var &a)
Checks if the given number is NaN.
const kernel_cl< in_buffer, out_buffer, int, int > check_nan("is_nan", {indexing_helpers, is_nan_kernel_code})
See the docs for is_nan() .
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.