1#ifndef STAN_MATH_OPENCL_KERNELS_IDENTITY_HPP
2#define STAN_MATH_OPENCL_KERNELS_IDENTITY_HPP
11namespace opencl_kernels {
13static constexpr const char* batch_identity_kernel_code =
STRINGIFY(
43 int batch_id = get_global_id(0);
45 int batch_row = get_global_id(1);
46 int batch_col = get_global_id(2);
47 int index = batch_id * batch_rows * batch_rows + batch_col * batch_rows
51 if (batch_row == batch_col) {
const kernel_cl< out_buffer, int, int > batch_identity("batch_identity", {indexing_helpers, batch_identity_kernel_code})
See the docs for batch_identity() .
int64_t size(const T &m)
Returns the size (number of the elements) of a matrix_cl or var_value<matrix_cl<T>>.
static const std::string indexing_helpers
Defines helper macros for common matrix indexing operations.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Creates functor for kernels.