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

Function block_reduce_sum

src/backend/cuda/kernel/orb.hpp:50–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50inline __device__ float block_reduce_sum(float val) {
51 __shared__ float data[THREADS_X * THREADS_Y];
52
53 unsigned idx = threadIdx.x * blockDim.x + threadIdx.y;
54
55 data[idx] = val;
56 __syncthreads();
57
58 for (unsigned i = blockDim.y / 2; i > 0; i >>= 1) {
59 if (threadIdx.y < i) { data[idx] += data[idx + i]; }
60
61 __syncthreads();
62 }
63
64 return data[threadIdx.x * blockDim.x];
65}
66
67template<typename T>
68__global__ void keep_features(float* x_out, float* y_out, float* score_out,

Callers 2

harris_responseFunction · 0.85
centroid_angleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected