| 26 | |
| 27 | template<typename T, af_op_t op, int dim, bool is_first> |
| 28 | void ireduce_dim_launcher(Param<T> out, uint *olptr, CParam<T> in, |
| 29 | const uint *ilptr, const uint threads_y, |
| 30 | const dim_t blocks_dim[4], CParam<uint> rlen) { |
| 31 | dim3 threads(THREADS_X, threads_y); |
| 32 | |
| 33 | dim3 blocks(blocks_dim[0] * blocks_dim[2], blocks_dim[1] * blocks_dim[3]); |
| 34 | |
| 35 | const int maxBlocksY = getDeviceProp(getActiveDeviceId()).maxGridSize[1]; |
| 36 | blocks.z = divup(blocks.y, maxBlocksY); |
| 37 | blocks.y = divup(blocks.y, blocks.z); |
| 38 | |
| 39 | auto ireduceDim = common::getKernel( |
| 40 | "arrayfire::cuda::ireduceDim", {{ireduce_cuh_src}}, |
| 41 | TemplateArgs(TemplateTypename<T>(), TemplateArg(op), TemplateArg(dim), |
| 42 | TemplateArg(is_first), TemplateArg(threads_y)), |
| 43 | {{DefineValue(THREADS_X)}}); |
| 44 | |
| 45 | EnqueueArgs qArgs(blocks, threads, getActiveStream()); |
| 46 | |
| 47 | ireduceDim(qArgs, out, olptr, in, ilptr, blocks_dim[0], blocks_dim[1], |
| 48 | blocks_dim[dim], rlen); |
| 49 | |
| 50 | POST_LAUNCH_CHECK(); |
| 51 | } |
| 52 | |
| 53 | template<typename T, af_op_t op, int dim> |
| 54 | void ireduce_dim(Param<T> out, uint *olptr, CParam<T> in, CParam<uint> rlen) { |
nothing calls this directly
no test coverage detected