Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
0f7de40e
Commit
0f7de40e
authored
May 26, 2015
by
Zhigang Gong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the race condition between inc and dec on the l_counter.
Signed-off-by:
Zhigang Gong
<
zhigang.gong@intel.com
>
parent
b1a8e4f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
canny.cl
modules/imgproc/src/opencl/canny.cl
+5
-5
No files found.
modules/imgproc/src/opencl/canny.cl
View file @
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)
{
{
...
@@ -496,4 +497,4 @@ __kernel void getEdges(__global const uchar *mapptr, int map_step, int map_offse
...
@@ -496,4 +497,4 @@ __kernel void getEdges(__global const uchar *mapptr, int map_step, int map_offse
}
}
}
}
#endif
#endif
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment