| 23 | |
| 24 | template<typename Ti, typename To, af_op_t op> |
| 25 | static void scan_first_launcher(Param<To> out, Param<To> tmp, CParam<Ti> in, |
| 26 | const uint blocks_x, const uint blocks_y, |
| 27 | const uint threads_x, bool isFinalPass, |
| 28 | bool inclusive_scan) { |
| 29 | auto scan_first = common::getKernel( |
| 30 | "arrayfire::cuda::scan_first", {{scan_first_cuh_src}}, |
| 31 | TemplateArgs(TemplateTypename<Ti>(), TemplateTypename<To>(), |
| 32 | TemplateArg(op), TemplateArg(isFinalPass), |
| 33 | TemplateArg(threads_x), TemplateArg(inclusive_scan)), |
| 34 | {{DefineValue(THREADS_PER_BLOCK)}}); |
| 35 | |
| 36 | dim3 threads(threads_x, THREADS_PER_BLOCK / threads_x); |
| 37 | dim3 blocks(blocks_x * out.dims[2], blocks_y * out.dims[3]); |
| 38 | |
| 39 | const int maxBlocksY = getDeviceProp(getActiveDeviceId()).maxGridSize[1]; |
| 40 | blocks.z = divup(blocks.y, maxBlocksY); |
| 41 | blocks.y = divup(blocks.y, blocks.z); |
| 42 | |
| 43 | uint lim = divup(out.dims[0], (threads_x * blocks_x)); |
| 44 | |
| 45 | EnqueueArgs qArgs(blocks, threads, getActiveStream()); |
| 46 | scan_first(qArgs, out, tmp, in, blocks_x, blocks_y, lim); |
| 47 | POST_LAUNCH_CHECK(); |
| 48 | } |
| 49 | |
| 50 | template<typename To, af_op_t op> |
| 51 | static void bcast_first_launcher(Param<To> out, CParam<To> tmp, |
nothing calls this directly
no test coverage detected