| 64 | |
| 65 | template<typename T> |
| 66 | void initEdgeOut(Param output, const Param strong, const Param weak) { |
| 67 | using cl::EnqueueArgs; |
| 68 | using cl::NDRange; |
| 69 | using std::string; |
| 70 | using std::vector; |
| 71 | |
| 72 | vector<string> options = { |
| 73 | DefineKeyValue(T, dtype_traits<T>::getName()), |
| 74 | DefineKey(INIT_EDGE_OUT), |
| 75 | }; |
| 76 | options.emplace_back(getTypeBuildDefinition<T>()); |
| 77 | |
| 78 | auto initOp = |
| 79 | common::getKernel("initEdgeOutKernel", {{trace_edge_cl_src}}, |
| 80 | TemplateArgs(TemplateTypename<T>()), options); |
| 81 | |
| 82 | NDRange threads(kernel::THREADS_X, kernel::THREADS_Y, 1); |
| 83 | |
| 84 | // Launch only threads to process non-border pixels |
| 85 | int blk_x = divup(strong.info.dims[0] - 2, threads[0]); |
| 86 | int blk_y = divup(strong.info.dims[1] - 2, threads[1]); |
| 87 | |
| 88 | // launch batch * blk_x blocks along x dimension |
| 89 | NDRange global(blk_x * strong.info.dims[2] * threads[0], |
| 90 | blk_y * strong.info.dims[3] * threads[1], 1); |
| 91 | |
| 92 | initOp(EnqueueArgs(getQueue(), global, threads), *output.data, output.info, |
| 93 | *strong.data, strong.info, *weak.data, weak.info, blk_x, blk_y); |
| 94 | |
| 95 | CL_DEBUG_FINISH(getQueue()); |
| 96 | } |
| 97 | |
| 98 | template<typename T> |
| 99 | void suppressLeftOver(Param output) { |
no test coverage detected