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

Function initEdgeOut

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

Source from the content-addressed store, hash-verified

64
65template<typename T>
66void 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
98template<typename T>
99void suppressLeftOver(Param output) {

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