Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
65b8a1cb
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,发现更多精彩内容 >>
提交
65b8a1cb
编写于
10月 16, 2014
作者:
E
ElenaGvozdeva
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some small fixes
上级
c5a2879c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
14 deletion
+11
-14
modules/core/src/matmul.cpp
modules/core/src/matmul.cpp
+2
-5
modules/core/src/opencl/gemm.cl
modules/core/src/opencl/gemm.cl
+9
-9
未找到文件。
modules/core/src/matmul.cpp
浏览文件 @
65b8a1cb
...
...
@@ -788,7 +788,7 @@ static bool ocl_gemm( InputArray matA, InputArray matB, double alpha,
const
ocl
::
Device
&
dev
=
ocl
::
Device
::
getDefault
();
bool
doubleSupport
=
dev
.
doubleFPConfig
()
>
0
;
if
(
(
!
doubleSupport
&&
depth
==
CV_64F
)
)
if
(
!
doubleSupport
&&
depth
==
CV_64F
)
return
false
;
bool
haveC
=
matC
.
kind
()
!=
cv
::
_InputArray
::
NONE
;
...
...
@@ -804,7 +804,7 @@ static bool ocl_gemm( InputArray matA, InputArray matB, double alpha,
Size
sizeD
(
sizeB
.
width
,
sizeA
.
height
);
CV_Assert
(
matB
.
type
()
==
type
&&
(
!
haveC
||
matC
.
type
()
==
type
)
);
CV_Assert
(
!
haveC
||
matC
.
type
()
==
type
);
CV_Assert
(
sizeA
.
width
==
sizeB
.
height
&&
(
!
haveC
||
sizeC
==
sizeD
)
);
int
max_wg_size
=
(
int
)
dev
.
maxWorkGroupSize
();
...
...
@@ -822,11 +822,8 @@ static bool ocl_gemm( InputArray matA, InputArray matB, double alpha,
if
(
haveC
)
ctrans
?
transpose
(
matC
,
D
)
:
matC
.
copyTo
(
D
);
else
D
.
setTo
(
Scalar
::
all
(
0
));
int
vectorWidths
[]
=
{
4
,
4
,
2
,
2
,
1
,
4
,
cn
,
-
1
};
int
kercn
=
ocl
::
checkOptimalVectorWidth
(
vectorWidths
,
B
,
D
);
String
opts
=
format
(
"-D T=%s -D T1=%s -D WT=%s -D cn=%d -D kercn=%d -D LOCAL_SIZE=%d %s %s %s"
,
...
...
modules/core/src/opencl/gemm.cl
浏览文件 @
65b8a1cb
...
...
@@ -22,13 +22,13 @@
#
if
cn==2
#
if
kercn==2
#
define
MUL
(
i,
a,
b
)
\
#
define
MUL
(
a,
b
)
\
{
\
sum.x
+=
fma
(
a.x,
b.x,
-
a.y
*
b.y
)
;\
sum.y
+=
fma
(
a.x,
b.y,
a.y
*
b.x
)
;\
}
#
else
#
define
MUL
(
i,
a,
b
)
\
#
define
MUL
(
a,
b
)
\
{
\
sum.x
+=
fma
(
a.x,
b.x,
-
a.y
*
b.y
)
;\
sum.y
+=
fma
(
a.x,
b.y,
a.y
*
b.x
)
;\
...
...
@@ -37,7 +37,7 @@
}
#
endif
#
else
#
define
MUL
(
i,
a,
b
)
sum
=
fma
(
a,
b,
sum
)
;
#
define
MUL
(
a,
b
)
sum
=
fma
(
a,
b,
sum
)
;
#
endif
...
...
@@ -62,7 +62,7 @@ __kernel void gemm(__global const uchar * A_ptr, int A_step, int A_offset,
if
(
x
<
D_cols
&&
y
<
D_rows
)
{
for
(
int
i
=
0
; i < n; ++i)
MUL
(
i,
A[i],
B[i*STEP_B]
)
;
MUL
(
A[i],
B[i*STEP_B]
)
;
#
else
__local
T
a_local[LOCAL_SIZE*LOCAL_SIZE]
;
...
...
@@ -86,14 +86,14 @@ __kernel void gemm(__global const uchar * A_ptr, int A_step, int A_offset,
if
(
x
<
D_cols
&&
y
<
D_rows
)
{
for
(
int
i
=
0
; i < LOCAL_SIZE
#
if
NO_MULT
&&
p
*
LOCAL_SIZE
+
i
<
n
int
ie
=
min
(
LOCAL_SIZE,
n
-
p
*
LOCAL_SIZE
)
;
for
(
int
i
=
0
; i < ie; ++i)
#
else
for
(
int
i
=
0
; i < LOCAL_SIZE; ++i)
#
endif
; ++i)
MUL
(
i,
a_local[mad24
(
lidy,
LOCAL_SIZE,
i
)
],
b_local[mad24
(
i,
LOCAL_SIZE,
lidx
)
]
)
;
MUL
(
a_local[mad24
(
lidy,
LOCAL_SIZE,
i
)
],
b_local[mad24
(
i,
LOCAL_SIZE,
lidx
)
]
)
;
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录