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
6620c5c9
Commit
6620c5c9
authored
Jun 19, 2012
by
Marina Kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'work'
parent
18918a5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
warp_reduce.hpp
modules/gpu/src/opencv2/gpu/device/warp_reduce.hpp
+14
-14
No files found.
modules/gpu/src/opencv2/gpu/device/warp_reduce.hpp
View file @
6620c5c9
...
...
@@ -44,25 +44,25 @@
#ifndef OPENCV_GPU_WARP_REDUCE_HPP__
#define OPENCV_GPU_WARP_REDUCE_HPP__
namespace
cv
{
namespace
gpu
{
namespace
device
{
template
<
class
T
>
namespace
cv
{
namespace
gpu
{
namespace
device
{
template
<
class
T
>
__device__
__forceinline__
T
warp_reduce
(
volatile
T
*
ptr
,
const
unsigned
int
tid
=
threadIdx
.
x
)
{
const
unsigned
int
lane
=
tid
&
31
;
// index of thread in warp (0..31)
if
(
lane
<
16
)
{
T
partial
=
ptr
[
tid
];
ptr
[
tid
]
=
partial
=
partial
+
ptr
[
tid
+
16
];
ptr
[
tid
]
=
partial
=
partial
+
ptr
[
tid
+
8
];
ptr
[
tid
]
=
partial
=
partial
+
ptr
[
tid
+
4
];
ptr
[
tid
]
=
partial
=
partial
+
ptr
[
tid
+
2
];
ptr
[
tid
]
=
partial
=
partial
+
ptr
[
tid
+
1
];
}
if
(
lane
<
16
)
{
T
partial
=
ptr
[
tid
];
return
ptr
[
tid
-
lane
];
ptr
[
tid
]
=
partial
=
partial
+
ptr
[
tid
+
16
];
ptr
[
tid
]
=
partial
=
partial
+
ptr
[
tid
+
8
];
ptr
[
tid
]
=
partial
=
partial
+
ptr
[
tid
+
4
];
ptr
[
tid
]
=
partial
=
partial
+
ptr
[
tid
+
2
];
ptr
[
tid
]
=
partial
=
partial
+
ptr
[
tid
+
1
];
}
return
ptr
[
tid
-
lane
];
}
}}}
// namespace cv { namespace gpu { namespace device {
...
...
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