| 52 | |
| 53 | template<typename T> |
| 54 | static void diagExtract(Param out, Param in, int num) { |
| 55 | std::array<TemplateArg, 1> targs = { |
| 56 | TemplateTypename<T>(), |
| 57 | }; |
| 58 | std::array<std::string, 3> options = { |
| 59 | DefineKeyValue(T, dtype_traits<T>::getName()), |
| 60 | DefineKeyValue(ZERO, scalar_to_option(scalar<T>(0))), |
| 61 | getTypeBuildDefinition<T>()}; |
| 62 | |
| 63 | auto diagExtract = common::getKernel( |
| 64 | "diagExtractKernel", {{diag_extract_cl_src}}, targs, options); |
| 65 | |
| 66 | cl::NDRange local(256, 1); |
| 67 | int groups_x = divup(out.info.dims[0], local[0]); |
| 68 | int groups_z = out.info.dims[2]; |
| 69 | cl::NDRange global(groups_x * local[0], |
| 70 | groups_z * local[1] * out.info.dims[3]); |
| 71 | |
| 72 | diagExtract(cl::EnqueueArgs(getQueue(), global, local), *(out.data), |
| 73 | out.info, *(in.data), in.info, num, groups_z); |
| 74 | CL_DEBUG_FINISH(getQueue()); |
| 75 | } |
| 76 | |
| 77 | } // namespace kernel |
| 78 | } // namespace opencl |
nothing calls this directly
no test coverage detected