Stan Math Library
4.9.0
Automatic Differentiation
|
__kernel void stan::math::opencl_kernels::diag_inv | ( | __global double * | A, |
__global double * | tmp_inv, | ||
int | rows | ||
) |
Calculates inplace submatrix inversions along the matrix diagonal.
For a full guide to the inverse lower triangular kernels see the link here. In the special case that the thread block size is larger than the input matrix A then this kernel will perform the complete lower triangular of matrix A. More often, TB is smaller than A and A will have lower triangular inverses calculated on submatrices along the diagonal equal to the size of the thread block. Running this kernel on a matrix with N = 4
This kernel is run with threads organized in a single dimension. If we want to calculate N blocks of size TB across the diagonal we spawn N x TB threads with TB used as the thread block size.
[in,out] | A | The input matrix. |
[in,out] | tmp_inv | A matrix with batches of identities matrices along the diagonal. |
rows | The number of rows for A. |
const char*
held in diag_inv_kernel_code.
Used in math/opencl/tri_inverse.hpp. This kernel uses the helper macros available in helpers.cl. Definition at line 43 of file diag_inv.hpp.