| 21 | |
| 22 | template<typename T> |
| 23 | void reorder(Param<T> out, CParam<T> in, const dim_t *rdims) { |
| 24 | constexpr unsigned TX = 32; |
| 25 | constexpr unsigned TY = 8; |
| 26 | constexpr unsigned TILEX = 512; |
| 27 | constexpr unsigned TILEY = 32; |
| 28 | |
| 29 | auto reorder = |
| 30 | common::getKernel("arrayfire::cuda::reorder", {{reorder_cuh_src}}, |
| 31 | TemplateArgs(TemplateTypename<T>())); |
| 32 | |
| 33 | dim3 threads(TX, TY, 1); |
| 34 | |
| 35 | int blocksPerMatX = divup(out.dims[0], TILEX); |
| 36 | int blocksPerMatY = divup(out.dims[1], TILEY); |
| 37 | dim3 blocks(blocksPerMatX * out.dims[2], blocksPerMatY * out.dims[3], 1); |
| 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 | EnqueueArgs qArgs(blocks, threads, getActiveStream()); |
| 44 | |
| 45 | reorder(qArgs, out, in, rdims[0], rdims[1], rdims[2], rdims[3], |
| 46 | blocksPerMatX, blocksPerMatY); |
| 47 | POST_LAUNCH_CHECK(); |
| 48 | } |
| 49 | |
| 50 | } // namespace kernel |
| 51 | } // namespace cuda |
nothing calls this directly
no test coverage detected