| 58 | |
| 59 | template<typename T> |
| 60 | void select_scalar(Param<T> out, CParam<char> cond, CParam<T> a, const T b, |
| 61 | int ndims, bool flip) { |
| 62 | auto selectScalar = common::getKernel( |
| 63 | "arrayfire::cuda::selectScalar", {{select_cuh_src}}, |
| 64 | TemplateArgs(TemplateTypename<T>(), TemplateArg(flip))); |
| 65 | |
| 66 | dim3 threads(DIMX, DIMY); |
| 67 | |
| 68 | if (ndims == 1) { |
| 69 | threads.x *= threads.y; |
| 70 | threads.y = 1; |
| 71 | } |
| 72 | |
| 73 | int blk_x = divup(out.dims[0], REPEAT * threads.x); |
| 74 | int blk_y = divup(out.dims[1], threads.y); |
| 75 | |
| 76 | dim3 blocks(blk_x * out.dims[2], blk_y * out.dims[3]); |
| 77 | |
| 78 | EnqueueArgs qArgs(blocks, threads, getActiveStream()); |
| 79 | |
| 80 | selectScalar(qArgs, out, cond, a, b, blk_x, blk_y); |
| 81 | POST_LAUNCH_CHECK(); |
| 82 | } |
| 83 | |
| 84 | } // namespace kernel |
| 85 | } // namespace cuda |
nothing calls this directly
no test coverage detected