| 51 | |
| 52 | template<typename T> |
| 53 | void finalizeOutput(Param out, const T newValue) { |
| 54 | std::array<std::string, 5> options = { |
| 55 | DefineKeyValue(T, dtype_traits<T>::getName()), DefineValue(VALID), |
| 56 | DefineValue(ZERO), DefineKey(FINALIZE_OUTPUT), |
| 57 | getTypeBuildDefinition<T>()}; |
| 58 | |
| 59 | auto finalizeOut = |
| 60 | common::getKernel("finalize_output", {{flood_fill_cl_src}}, |
| 61 | TemplateArgs(TemplateTypename<T>()), options); |
| 62 | cl::NDRange local(kernel::THREADS_X, kernel::THREADS_Y, 1); |
| 63 | cl::NDRange global(divup(out.info.dims[0], local[0]) * local[0], |
| 64 | divup(out.info.dims[1], local[1]) * local[1], 1); |
| 65 | finalizeOut(cl::EnqueueArgs(getQueue(), global, local), *out.data, out.info, |
| 66 | newValue); |
| 67 | CL_DEBUG_FINISH(getQueue()); |
| 68 | } |
| 69 | |
| 70 | template<typename T> |
| 71 | void floodFill(Param out, const Param image, const Param seedsx, |
no test coverage detected