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
bbd519be
Commit
bbd519be
authored
Aug 26, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed warnings
parent
045a856c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
reduce.hpp
modules/cudev/include/opencv2/cudev/grid/detail/reduce.hpp
+7
-7
reduce.hpp
modules/cudev/include/opencv2/cudev/grid/reduce.hpp
+2
-2
No files found.
modules/cudev/include/opencv2/cudev/grid/detail/reduce.hpp
View file @
bbd519be
...
...
@@ -389,7 +389,7 @@ namespace grid_reduce_detail
// glob_reduce
template
<
class
Reductor
,
int
BLOCK_SIZE
,
int
PATCH_X
,
int
PATCH_Y
,
class
SrcPtr
,
typename
ResType
,
class
MaskPtr
>
__global__
void
glob_
reduce
(
const
SrcPtr
src
,
ResType
*
result
,
const
MaskPtr
mask
,
const
int
rows
,
const
int
cols
)
__global__
void
reduce
(
const
SrcPtr
src
,
ResType
*
result
,
const
MaskPtr
mask
,
const
int
rows
,
const
int
cols
)
{
const
int
x0
=
blockIdx
.
x
*
blockDim
.
x
*
PATCH_X
+
threadIdx
.
x
;
const
int
y0
=
blockIdx
.
y
*
blockDim
.
y
*
PATCH_Y
+
threadIdx
.
y
;
...
...
@@ -413,12 +413,12 @@ namespace grid_reduce_detail
}
template
<
class
Reductor
,
class
Policy
,
class
SrcPtr
,
typename
ResType
,
class
MaskPtr
>
__host__
void
glob_
reduce
(
const
SrcPtr
&
src
,
ResType
*
result
,
const
MaskPtr
&
mask
,
int
rows
,
int
cols
,
cudaStream_t
stream
)
__host__
void
reduce
(
const
SrcPtr
&
src
,
ResType
*
result
,
const
MaskPtr
&
mask
,
int
rows
,
int
cols
,
cudaStream_t
stream
)
{
const
dim3
block
(
Policy
::
block_size_x
,
Policy
::
block_size_y
);
const
dim3
grid
(
divUp
(
cols
,
block
.
x
*
Policy
::
patch_size_x
),
divUp
(
rows
,
block
.
y
*
Policy
::
patch_size_y
));
glob_
reduce
<
Reductor
,
Policy
::
block_size_x
*
Policy
::
block_size_y
,
Policy
::
patch_size_x
,
Policy
::
patch_size_y
><<<
grid
,
block
,
0
,
stream
>>>
(
src
,
result
,
mask
,
rows
,
cols
);
reduce
<
Reductor
,
Policy
::
block_size_x
*
Policy
::
block_size_y
,
Policy
::
patch_size_x
,
Policy
::
patch_size_y
><<<
grid
,
block
,
0
,
stream
>>>
(
src
,
result
,
mask
,
rows
,
cols
);
CV_CUDEV_SAFE_CALL
(
cudaGetLastError
()
);
if
(
stream
==
0
)
...
...
@@ -433,7 +433,7 @@ namespace grid_reduce_detail
typedef
typename
PtrTraits
<
SrcPtr
>::
value_type
src_type
;
typedef
typename
VecTraits
<
ResType
>::
elem_type
res_elem_type
;
glob_
reduce
<
SumReductor
<
src_type
,
ResType
>
,
Policy
>
(
src
,
(
res_elem_type
*
)
result
,
mask
,
rows
,
cols
,
stream
);
reduce
<
SumReductor
<
src_type
,
ResType
>
,
Policy
>
(
src
,
(
res_elem_type
*
)
result
,
mask
,
rows
,
cols
,
stream
);
}
template
<
class
Policy
,
class
SrcPtr
,
typename
ResType
,
class
MaskPtr
>
...
...
@@ -441,7 +441,7 @@ namespace grid_reduce_detail
{
typedef
typename
PtrTraits
<
SrcPtr
>::
value_type
src_type
;
glob_
reduce
<
MinMaxReductor
<
minop
<
ResType
>
,
src_type
,
ResType
>
,
Policy
>
(
src
,
result
,
mask
,
rows
,
cols
,
stream
);
reduce
<
MinMaxReductor
<
minop
<
ResType
>
,
src_type
,
ResType
>
,
Policy
>
(
src
,
result
,
mask
,
rows
,
cols
,
stream
);
}
template
<
class
Policy
,
class
SrcPtr
,
typename
ResType
,
class
MaskPtr
>
...
...
@@ -449,7 +449,7 @@ namespace grid_reduce_detail
{
typedef
typename
PtrTraits
<
SrcPtr
>::
value_type
src_type
;
glob_
reduce
<
MinMaxReductor
<
maxop
<
ResType
>
,
src_type
,
ResType
>
,
Policy
>
(
src
,
result
,
mask
,
rows
,
cols
,
stream
);
reduce
<
MinMaxReductor
<
maxop
<
ResType
>
,
src_type
,
ResType
>
,
Policy
>
(
src
,
result
,
mask
,
rows
,
cols
,
stream
);
}
template
<
class
Policy
,
class
SrcPtr
,
typename
ResType
,
class
MaskPtr
>
...
...
@@ -457,7 +457,7 @@ namespace grid_reduce_detail
{
typedef
typename
PtrTraits
<
SrcPtr
>::
value_type
src_type
;
glob_
reduce
<
MinMaxReductor
<
both
,
src_type
,
ResType
>
,
Policy
>
(
src
,
result
,
mask
,
rows
,
cols
,
stream
);
reduce
<
MinMaxReductor
<
both
,
src_type
,
ResType
>
,
Policy
>
(
src
,
result
,
mask
,
rows
,
cols
,
stream
);
}
}
...
...
modules/cudev/include/opencv2/cudev/grid/reduce.hpp
View file @
bbd519be
...
...
@@ -61,7 +61,7 @@ __host__ void gridCalcSum_(const SrcPtr& src, GpuMat_<ResType>& dst, const MaskP
{
typedef
typename
PtrTraits
<
SrcPtr
>::
value_type
src_type
;
CV_StaticAssert
(
VecTraits
<
src_type
>::
cn
==
VecTraits
<
ResType
>::
cn
,
""
);
CV_StaticAssert
(
unsigned
(
VecTraits
<
src_type
>::
cn
)
==
unsigned
(
VecTraits
<
ResType
>::
cn
)
,
""
);
dst
.
create
(
1
,
1
);
dst
.
setTo
(
0
,
stream
);
...
...
@@ -83,7 +83,7 @@ __host__ void gridCalcSum_(const SrcPtr& src, GpuMat_<ResType>& dst, Stream& str
{
typedef
typename
PtrTraits
<
SrcPtr
>::
value_type
src_type
;
CV_StaticAssert
(
VecTraits
<
src_type
>::
cn
==
VecTraits
<
ResType
>::
cn
,
""
);
CV_StaticAssert
(
unsigned
(
VecTraits
<
src_type
>::
cn
)
==
unsigned
(
VecTraits
<
ResType
>::
cn
)
,
""
);
dst
.
create
(
1
,
1
);
dst
.
setTo
(
0
,
stream
);
...
...
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