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