mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
new reduce and reduceKeyVal implementation
This commit is contained in:
@@ -109,9 +109,9 @@ namespace cv { namespace gpu { namespace device
|
||||
c += Ix * Iy;
|
||||
}
|
||||
|
||||
reduce<32>(srow, a, threadIdx.x, plus<volatile int>());
|
||||
reduce<32>(srow, b, threadIdx.x, plus<volatile int>());
|
||||
reduce<32>(srow, c, threadIdx.x, plus<volatile int>());
|
||||
reduce_old<32>(srow, a, threadIdx.x, plus<volatile int>());
|
||||
reduce_old<32>(srow, b, threadIdx.x, plus<volatile int>());
|
||||
reduce_old<32>(srow, c, threadIdx.x, plus<volatile int>());
|
||||
|
||||
if (threadIdx.x == 0)
|
||||
{
|
||||
@@ -167,7 +167,7 @@ namespace cv { namespace gpu { namespace device
|
||||
for (int u = threadIdx.x - half_k; u <= half_k; u += blockDim.x)
|
||||
m_10 += u * image(loc.y, loc.x + u);
|
||||
|
||||
reduce<32>(srow, m_10, threadIdx.x, plus<volatile int>());
|
||||
reduce_old<32>(srow, m_10, threadIdx.x, plus<volatile int>());
|
||||
|
||||
for (int v = 1; v <= half_k; ++v)
|
||||
{
|
||||
@@ -185,8 +185,8 @@ namespace cv { namespace gpu { namespace device
|
||||
m_sum += u * (val_plus + val_minus);
|
||||
}
|
||||
|
||||
reduce<32>(srow, v_sum, threadIdx.x, plus<volatile int>());
|
||||
reduce<32>(srow, m_sum, threadIdx.x, plus<volatile int>());
|
||||
reduce_old<32>(srow, v_sum, threadIdx.x, plus<volatile int>());
|
||||
reduce_old<32>(srow, m_sum, threadIdx.x, plus<volatile int>());
|
||||
|
||||
m_10 += m_sum;
|
||||
m_01 += v * v_sum;
|
||||
@@ -419,4 +419,4 @@ namespace cv { namespace gpu { namespace device
|
||||
}
|
||||
}}}
|
||||
|
||||
#endif /* CUDA_DISABLER */
|
||||
#endif /* CUDA_DISABLER */
|
||||
|
||||
@@ -599,8 +599,8 @@ namespace cv { namespace gpu { namespace device
|
||||
sumy += s_Y[threadIdx.x + 96];
|
||||
}
|
||||
|
||||
device::reduce<32>(s_sumx + threadIdx.y * 32, sumx, threadIdx.x, plus<volatile float>());
|
||||
device::reduce<32>(s_sumy + threadIdx.y * 32, sumy, threadIdx.x, plus<volatile float>());
|
||||
device::reduce_old<32>(s_sumx + threadIdx.y * 32, sumx, threadIdx.x, plus<volatile float>());
|
||||
device::reduce_old<32>(s_sumy + threadIdx.y * 32, sumy, threadIdx.x, plus<volatile float>());
|
||||
|
||||
const float temp_mod = sumx * sumx + sumy * sumy;
|
||||
if (temp_mod > best_mod)
|
||||
|
||||
Reference in New Issue
Block a user