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

Function load_shared_image

src/backend/cuda/kernel/fast.hpp:173–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171
172template<typename T>
173__device__ void load_shared_image(CParam<T> in, T *local_image, unsigned ix,
174 unsigned iy, unsigned bx, unsigned by,
175 unsigned x, unsigned y, unsigned lx,
176 unsigned ly, const unsigned edge) {
177 // Copy an image patch to shared memory, with a 3-pixel edge
178 if (ix < lx && iy < ly && x - 3 < in.dims[0] && y - 3 < in.dims[1]) {
179 local_image[(ix) + (bx + 6) * (iy)] =
180 in.ptr[(x - 3) + in.dims[0] * (y - 3)];
181 if (x + lx - 3 < in.dims[0])
182 local_image[(ix + lx) + (bx + 6) * (iy)] =
183 in.ptr[(x + lx - 3) + in.dims[0] * (y - 3)];
184 if (y + ly - 3 < in.dims[1])
185 local_image[(ix) + (bx + 6) * (iy + ly)] =
186 in.ptr[(x - 3) + in.dims[0] * (y + ly - 3)];
187 if (x + lx - 3 < in.dims[0] && y + ly - 3 < in.dims[1])
188 local_image[(ix + lx) + (bx + 6) * (iy + ly)] =
189 in.ptr[(x + lx - 3) + in.dims[0] * (y + ly - 3)];
190 }
191}
192
193template<typename T, int arc_length>
194__global__ void locate_features(CParam<T> in, float *score, const float thr,

Callers 1

locate_featuresFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected