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
c9528b39
Commit
c9528b39
authored
Jun 09, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimized histogram merging
parent
eeaa4b36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
histogram.cl
modules/imgproc/src/opencl/histogram.cl
+16
-6
No files found.
modules/imgproc/src/opencl/histogram.cl
View file @
c9528b39
...
...
@@ -126,21 +126,31 @@ __kernel void merge_histogram(__global const int * ghist, __global uchar * histp
int
lid
=
get_local_id
(
0
)
;
__global
HT
*
hist
=
(
__global
HT
*
)(
histptr
+
hist_offset
)
;
#
if
WGS
>=
BINS
HT
res
=
(
HT
)(
0
)
;
#
else
#
pragma
unroll
for
(
int
i
=
lid
; i < BINS; i += WGS)
hist[i]
=
ghist[i]
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
hist[i]
=
(
HT
)(
0
)
;
#
endif
#
pragma
unroll
for
(
int
i
=
1
; i < HISTS_COUNT; ++i)
for
(
int
i
=
0
; i < HISTS_COUNT; ++i)
{
ghist
+=
BINS
;
#
pragma
unroll
for
(
int
j
=
lid
; j < BINS; j += WGS)
#
if
WGS
>=
BINS
res
+=
convertToHT
(
ghist[j]
)
;
#
else
hist[j]
+=
convertToHT
(
ghist[j]
)
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
#
endif
ghist
+=
BINS
;
}
#
if
WGS
>=
BINS
if
(
lid
<
BINS
)
*
(
__global
HT
*
)(
histptr
+
mad24
(
lid,
hist_step,
hist_offset
))
=
res
;
#
endif
}
__kernel
void
calcLUT
(
__global
uchar
*
dst,
__constant
int
*
hist,
int
total
)
...
...
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