MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / suppressLeftOver

Function suppressLeftOver

src/backend/opencl/kernel/canny.hpp:99–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98template<typename T>
99void 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
130template<typename T>
131void edgeTrackingHysteresis(Param output, const Param strong,

Callers 1

edgeTrackingHysteresisFunction · 0.85

Calls 5

getNameFunction · 0.85
TemplateArgsFunction · 0.85
EnqueueArgsClass · 0.85
getKernelFunction · 0.50
getQueueFunction · 0.50

Tested by

no test coverage detected