Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
318671d9
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
318671d9
编写于
2月 29, 2016
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6148 from Aravind-Suresh:cv-cuda-reduce-bug-fix
上级
7600757d
f4f15617
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
6 addition
and
19 deletion
+6
-19
modules/cudaarithm/perf/perf_reductions.cpp
modules/cudaarithm/perf/perf_reductions.cpp
+2
-0
modules/cudaarithm/src/cuda/reduce.cu
modules/cudaarithm/src/cuda/reduce.cu
+1
-1
modules/cudaarithm/test/test_reductions.cpp
modules/cudaarithm/test/test_reductions.cpp
+1
-4
modules/cudev/include/opencv2/cudev/grid/reduce_to_vec.hpp
modules/cudev/include/opencv2/cudev/grid/reduce_to_vec.hpp
+2
-2
modules/cudev/test/test_reduction.cu
modules/cudev/test/test_reduction.cu
+0
-12
未找到文件。
modules/cudaarithm/perf/perf_reductions.cpp
浏览文件 @
318671d9
...
...
@@ -368,6 +368,8 @@ PERF_TEST_P(Sz_Depth_Cn_Code_Dim, Reduce,
TEST_CYCLE
()
cv
::
cuda
::
reduce
(
d_src
,
dst
,
dim
,
reduceOp
,
CV_32F
);
dst
=
dst
.
reshape
(
dst
.
channels
(),
1
);
CUDA_SANITY_CHECK
(
dst
);
}
else
...
...
modules/cudaarithm/src/cuda/reduce.cu
浏览文件 @
318671d9
...
...
@@ -137,7 +137,7 @@ void cv::cuda::reduce(InputArray _src, OutputArray _dst, int dim, int reduceOp,
if
(
dtype
<
0
)
dtype
=
src
.
depth
();
GpuMat
dst
=
getOutputMat
(
_dst
,
1
,
dim
==
0
?
src
.
cols
:
src
.
rows
,
CV_MAKE_TYPE
(
CV_MAT_DEPTH
(
dtype
),
src
.
channels
()),
stream
);
GpuMat
dst
=
getOutputMat
(
_dst
,
dim
==
0
?
1
:
src
.
rows
,
dim
==
0
?
src
.
cols
:
1
,
CV_MAKE_TYPE
(
CV_MAT_DEPTH
(
dtype
),
src
.
channels
()),
stream
);
if
(
dim
==
0
)
{
...
...
modules/cudaarithm/test/test_reductions.cpp
浏览文件 @
318671d9
...
...
@@ -877,14 +877,11 @@ CUDA_TEST_P(Reduce, Cols)
{
cv
::
Mat
src
=
randomMat
(
size
,
type
);
cv
::
cuda
::
GpuMat
dst
=
createMat
(
cv
::
Size
(
src
.
rows
,
1
),
dst_type
,
useRoi
)
;
cv
::
cuda
::
GpuMat
dst
;
cv
::
cuda
::
reduce
(
loadMat
(
src
,
useRoi
),
dst
,
1
,
reduceOp
,
dst_depth
);
cv
::
Mat
dst_gold
;
cv
::
reduce
(
src
,
dst_gold
,
1
,
reduceOp
,
dst_depth
);
dst_gold
.
cols
=
dst_gold
.
rows
;
dst_gold
.
rows
=
1
;
dst_gold
.
step
=
dst_gold
.
cols
*
dst_gold
.
elemSize
();
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
dst_depth
<
CV_32F
?
0.0
:
0.02
);
}
...
...
modules/cudev/include/opencv2/cudev/grid/reduce_to_vec.hpp
浏览文件 @
318671d9
...
...
@@ -182,7 +182,7 @@ __host__ void gridReduceToColumn_(const SrcPtr& src, GpuMat_<ResType>& dst, cons
CV_Assert
(
getRows
(
mask
)
==
rows
&&
getCols
(
mask
)
==
cols
);
dst
.
create
(
1
,
rows
);
cuda
::
createContinuous
(
rows
,
1
,
dst
.
type
(),
dst
);
grid_reduce_to_vec_detail
::
reduceToColumn
<
Reductor
,
Policy
>
(
shrinkPtr
(
src
),
dst
[
0
],
...
...
@@ -197,7 +197,7 @@ __host__ void gridReduceToColumn_(const SrcPtr& src, GpuMat_<ResType>& dst, Stre
const
int
rows
=
getRows
(
src
);
const
int
cols
=
getCols
(
src
);
dst
.
create
(
1
,
rows
);
cuda
::
createContinuous
(
rows
,
1
,
dst
.
type
(),
dst
);
grid_reduce_to_vec_detail
::
reduceToColumn
<
Reductor
,
Policy
>
(
shrinkPtr
(
src
),
dst
[
0
],
...
...
modules/cudev/test/test_reduction.cu
浏览文件 @
318671d9
...
...
@@ -228,9 +228,6 @@ TEST(ReduceToColumn, Sum)
Mat
dst_gold
;
cv
::
reduce
(
src
,
dst_gold
,
1
,
REDUCE_SUM
,
CV_32S
);
dst_gold
.
cols
=
dst_gold
.
rows
;
dst_gold
.
rows
=
1
;
dst_gold
.
step
=
dst_gold
.
cols
*
dst_gold
.
elemSize
();
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
0.0
);
}
...
...
@@ -247,9 +244,6 @@ TEST(ReduceToColumn, Avg)
Mat
dst_gold
;
cv
::
reduce
(
src
,
dst_gold
,
1
,
REDUCE_AVG
,
CV_32F
);
dst_gold
.
cols
=
dst_gold
.
rows
;
dst_gold
.
rows
=
1
;
dst_gold
.
step
=
dst_gold
.
cols
*
dst_gold
.
elemSize
();
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
1e-4
);
}
...
...
@@ -266,9 +260,6 @@ TEST(ReduceToColumn, Min)
Mat
dst_gold
;
cv
::
reduce
(
src
,
dst_gold
,
1
,
REDUCE_MIN
);
dst_gold
.
cols
=
dst_gold
.
rows
;
dst_gold
.
rows
=
1
;
dst_gold
.
step
=
dst_gold
.
cols
*
dst_gold
.
elemSize
();
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
0.0
);
}
...
...
@@ -285,9 +276,6 @@ TEST(ReduceToColumn, Max)
Mat
dst_gold
;
cv
::
reduce
(
src
,
dst_gold
,
1
,
REDUCE_MAX
);
dst_gold
.
cols
=
dst_gold
.
rows
;
dst_gold
.
rows
=
1
;
dst_gold
.
step
=
dst_gold
.
cols
*
dst_gold
.
elemSize
();
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
0.0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录