1#ifndef STAN_MATH_OPENCL_KERNELS_HELPERS_HPP
2#define STAN_MATH_OPENCL_KERNELS_HELPERS_HPP
9namespace opencl_kernels {
16 // Matrix access helpers
18 #define A_batch(i,j,k) A[(k) * cols * rows + (j) * rows + (i)]
21 #define A(i,j) A[(j) * rows + (i)]
24 #define B(i,j) B[(j) * rows + (i)]
27 #define C(i,j) C[(j) * rows + (i)]
31 #define BT(i,j) B[(j) * cols + (i)]
34 #define AT(i,j) A[(j) * cols + (i)]
36 // Moving between two buffers
38 #define src(i,j) src[(j) * src_rows + (i)]
41 #define dst(i,j) dst[(j) * dst_rows + (i)]
50 // The local memory column for each thread block
51 #define THREAD_BLOCK_SIZE_COL (THREAD_BLOCK_SIZE/WORK_PER_THREAD)
static const std::string indexing_helpers
Defines helper macros for common matrix indexing operations.
static const std::string thread_block_helpers
Defines a helper macro for kernels with 2D local size.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...