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
50f28c9e
Commit
50f28c9e
authored
Feb 13, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added Warp::reduce function
parent
36e42084
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
warp.hpp
modules/gpu/include/opencv2/gpu/device/warp.hpp
+19
-0
No files found.
modules/gpu/include/opencv2/gpu/device/warp.hpp
View file @
50f28c9e
...
...
@@ -97,6 +97,25 @@ namespace cv { namespace gpu { namespace device
return
out
;
}
template
<
class
T
,
class
BinOp
>
static
__device__
__forceinline__
T
reduce
(
volatile
T
*
ptr
,
BinOp
op
)
{
const
unsigned
int
lane
=
laneId
();
if
(
lane
<
16
)
{
T
partial
=
ptr
[
lane
];
ptr
[
lane
]
=
partial
=
op
(
partial
,
ptr
[
lane
+
16
]);
ptr
[
lane
]
=
partial
=
op
(
partial
,
ptr
[
lane
+
8
]);
ptr
[
lane
]
=
partial
=
op
(
partial
,
ptr
[
lane
+
4
]);
ptr
[
lane
]
=
partial
=
op
(
partial
,
ptr
[
lane
+
2
]);
ptr
[
lane
]
=
partial
=
op
(
partial
,
ptr
[
lane
+
1
]);
}
return
*
ptr
;
}
template
<
typename
OutIt
,
typename
T
>
static
__device__
__forceinline__
void
yota
(
OutIt
beg
,
OutIt
end
,
T
value
)
{
...
...
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