| 24 | namespace kernel { |
| 25 | template<typename T> |
| 26 | void reorder(Param out, const Param in, const dim_t* rdims) { |
| 27 | constexpr int TX = 32; |
| 28 | constexpr int TY = 8; |
| 29 | constexpr int TILEX = 512; |
| 30 | constexpr int TILEY = 32; |
| 31 | |
| 32 | std::array<TemplateArg, 1> targs = { |
| 33 | TemplateTypename<T>(), |
| 34 | }; |
| 35 | std::array<std::string, 2> options = { |
| 36 | DefineKeyValue(T, dtype_traits<T>::getName()), |
| 37 | getTypeBuildDefinition<T>()}; |
| 38 | |
| 39 | auto reorderOp = |
| 40 | common::getKernel("reorder_kernel", {{reorder_cl_src}}, targs, options); |
| 41 | |
| 42 | cl::NDRange local(TX, TY, 1); |
| 43 | |
| 44 | int blocksPerMatX = divup(out.info.dims[0], TILEX); |
| 45 | int blocksPerMatY = divup(out.info.dims[1], TILEY); |
| 46 | cl::NDRange global(local[0] * blocksPerMatX * out.info.dims[2], |
| 47 | local[1] * blocksPerMatY * out.info.dims[3], 1); |
| 48 | |
| 49 | reorderOp(cl::EnqueueArgs(getQueue(), global, local), *out.data, *in.data, |
| 50 | out.info, in.info, static_cast<int>(rdims[0]), |
| 51 | static_cast<int>(rdims[1]), static_cast<int>(rdims[2]), |
| 52 | static_cast<int>(rdims[3]), blocksPerMatX, blocksPerMatY); |
| 53 | CL_DEBUG_FINISH(getQueue()); |
| 54 | } |
| 55 | } // namespace kernel |
| 56 | } // namespace opencl |
| 57 | } // namespace arrayfire |
no test coverage detected