Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
c94945f8
O
Opencv
项目概览
Greenplum
/
Opencv
10 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
c94945f8
编写于
7月 27, 2015
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4210 from wangyan42164:ocl_umat_convert
上级
6b8e13d0
132416eb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
3 deletion
+12
-3
modules/core/src/opencl/convert.cl
modules/core/src/opencl/convert.cl
+8
-1
modules/core/src/umatrix.cpp
modules/core/src/umatrix.cpp
+4
-2
未找到文件。
modules/core/src/opencl/convert.cl
浏览文件 @
c94945f8
...
...
@@ -53,7 +53,10 @@
__kernel
void
convertTo
(
__global
const
uchar
*
srcptr,
int
src_step,
int
src_offset,
__global
uchar
*
dstptr,
int
dst_step,
int
dst_offset,
int
dst_rows,
int
dst_cols,
WT
alpha,
WT
beta,
int
rowsPerWI
)
#
ifndef
NO_SCALE
WT
alpha,
WT
beta,
#
endif
int
rowsPerWI
)
{
int
x
=
get_global_id
(
0
)
;
int
y0
=
get_global_id
(
1
)
*
rowsPerWI
;
...
...
@@ -68,7 +71,11 @@ __kernel void convertTo(__global const uchar * srcptr, int src_step, int src_off
__global
const
srcT
*
src
=
(
__global
const
srcT
*
)(
srcptr
+
src_index
)
;
__global
dstT
*
dst
=
(
__global
dstT
*
)(
dstptr
+
dst_index
)
;
#
ifdef
NO_SCALE
dst[0]
=
convertToDT
(
src[0]
)
;
#
else
dst[0]
=
convertToDT
(
fma
(
convertToWT
(
src[0]
)
,
alpha,
beta
))
;
#
endif
}
}
}
modules/core/src/umatrix.cpp
浏览文件 @
c94945f8
...
...
@@ -746,7 +746,7 @@ void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) con
ocl
::
typeToStr
(
sdepth
),
ocl
::
typeToStr
(
wdepth
),
ocl
::
typeToStr
(
ddepth
),
ocl
::
convertTypeStr
(
sdepth
,
wdepth
,
1
,
cvt
[
0
]),
ocl
::
convertTypeStr
(
wdepth
,
ddepth
,
1
,
cvt
[
1
]),
doubleSupport
?
" -D DOUBLE_SUPPORT"
:
""
));
doubleSupport
?
" -D DOUBLE_SUPPORT"
:
""
,
noScale
?
" -D NO_SCALE"
:
""
));
if
(
!
k
.
empty
())
{
UMat
src
=
*
this
;
...
...
@@ -757,7 +757,9 @@ void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) con
ocl
::
KernelArg
srcarg
=
ocl
::
KernelArg
::
ReadOnlyNoSize
(
src
),
dstarg
=
ocl
::
KernelArg
::
WriteOnly
(
dst
,
cn
);
if
(
wdepth
==
CV_32F
)
if
(
noScale
)
k
.
args
(
srcarg
,
dstarg
,
rowsPerWI
);
else
if
(
wdepth
==
CV_32F
)
k
.
args
(
srcarg
,
dstarg
,
alphaf
,
betaf
,
rowsPerWI
);
else
k
.
args
(
srcarg
,
dstarg
,
alpha
,
beta
,
rowsPerWI
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录