| 97 | |
| 98 | template<typename T> |
| 99 | void suppressLeftOver(Param output) { |
| 100 | using cl::EnqueueArgs; |
| 101 | using cl::NDRange; |
| 102 | using std::string; |
| 103 | using std::vector; |
| 104 | |
| 105 | vector<string> options = { |
| 106 | DefineKeyValue(T, dtype_traits<T>::getName()), |
| 107 | DefineKey(SUPPRESS_LEFT_OVER), |
| 108 | }; |
| 109 | options.emplace_back(getTypeBuildDefinition<T>()); |
| 110 | |
| 111 | auto finalOp = |
| 112 | common::getKernel("suppressLeftOverKernel", {{trace_edge_cl_src}}, |
| 113 | TemplateArgs(TemplateTypename<T>()), options); |
| 114 | |
| 115 | NDRange threads(kernel::THREADS_X, kernel::THREADS_Y, 1); |
| 116 | |
| 117 | // Launch only threads to process non-border pixels |
| 118 | int blk_x = divup(output.info.dims[0] - 2, threads[0]); |
| 119 | int blk_y = divup(output.info.dims[1] - 2, threads[1]); |
| 120 | |
| 121 | // launch batch * blk_x blocks along x dimension |
| 122 | NDRange global(blk_x * output.info.dims[2] * threads[0], |
| 123 | blk_y * output.info.dims[3] * threads[1], 1); |
| 124 | |
| 125 | finalOp(EnqueueArgs(getQueue(), global, threads), *output.data, output.info, |
| 126 | blk_x, blk_y); |
| 127 | CL_DEBUG_FINISH(getQueue()); |
| 128 | } |
| 129 | |
| 130 | template<typename T> |
| 131 | void edgeTrackingHysteresis(Param output, const Param strong, |
no test coverage detected