Stan Math Library
4.9.0
Automatic Differentiation
|
__kernel void stan::math::opencl_kernels::indexing_rev | ( | __global double * | adj, |
const __global int * | index, | ||
const __global double * | res, | ||
__local double * | adj_loc, | ||
int | index_size, | ||
int | adj_size | ||
) |
Increments adjoint of the indexing operation argument given the indices and adjoints of the indexing result.
This kernel uses local atomics and is the fastest for medium sizes of the indexed matrix (and will not work for large sizes).
[in,out] | adj | adjoint to increment |
index | ||
res | adjoint of the result of indexing | |
batch_size | Number of matrices in the batch. |
const char*
held in add_batch_kernel_code.
This kernel makes each thread build its own copy of the adjoints before combining them. It is the fastest (and only works for) small size of the indexed matrix.
[in,out] | adj | adjoint to increment |
index | int array index | |
res | adjoint of the result of indexing | |
adj_loc | ||
index_size | number of elements in index | |
adj_size |
const char*
held in add_batch_kernel_code.
Definition at line 71 of file indexing_rev.hpp.