Commit 85c08dd1 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #4065 from gongzg:master

parents 8bc21fc2 0f7de40e
...@@ -431,10 +431,8 @@ __kernel void stage2_hysteresis(__global uchar *map_ptr, int map_step, int map_o ...@@ -431,10 +431,8 @@ __kernel void stage2_hysteresis(__global uchar *map_ptr, int map_step, int map_o
for (int i = 0; i < pix_per_thr; ++i) for (int i = 0; i < pix_per_thr; ++i)
{ {
int index = atomic_dec(&l_counter) - 1; int index = atomic_dec(&l_counter) - 1;
if (index < 0) { if (index < 0)
atomic_inc(&l_counter);
continue; continue;
}
ushort2 pos = l_stack[ index ]; ushort2 pos = l_stack[ index ];
#pragma unroll #pragma unroll
...@@ -454,6 +452,9 @@ __kernel void stage2_hysteresis(__global uchar *map_ptr, int map_step, int map_o ...@@ -454,6 +452,9 @@ __kernel void stage2_hysteresis(__global uchar *map_ptr, int map_step, int map_o
} }
} }
barrier(CLK_LOCAL_MEM_FENCE); barrier(CLK_LOCAL_MEM_FENCE);
if (l_counter < 0)
l_counter = 0;
barrier(CLK_LOCAL_MEM_FENCE);
while (p_counter > 0) while (p_counter > 0)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment