| 28 | |
| 29 | template<typename T> |
| 30 | static void diagCreate(Param out, Param in, int num) { |
| 31 | std::array<TemplateArg, 1> targs = { |
| 32 | TemplateTypename<T>(), |
| 33 | }; |
| 34 | std::array<std::string, 3> options = { |
| 35 | DefineKeyValue(T, dtype_traits<T>::getName()), |
| 36 | DefineKeyValue(ZERO, scalar_to_option(scalar<T>(0))), |
| 37 | getTypeBuildDefinition<T>()}; |
| 38 | |
| 39 | auto diagCreate = common::getKernel("diagCreateKernel", |
| 40 | {{diag_create_cl_src}}, targs, options); |
| 41 | |
| 42 | cl::NDRange local(32, 8); |
| 43 | int groups_x = divup(out.info.dims[0], local[0]); |
| 44 | int groups_y = divup(out.info.dims[1], local[1]); |
| 45 | cl::NDRange global(groups_x * local[0] * out.info.dims[2], |
| 46 | groups_y * local[1]); |
| 47 | |
| 48 | diagCreate(cl::EnqueueArgs(getQueue(), global, local), *(out.data), |
| 49 | out.info, *(in.data), in.info, num, groups_x); |
| 50 | CL_DEBUG_FINISH(getQueue()); |
| 51 | } |
| 52 | |
| 53 | template<typename T> |
| 54 | static void diagExtract(Param out, Param in, int num) { |
nothing calls this directly
no test coverage detected