Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
d7f4a223
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
d7f4a223
编写于
12月 01, 2013
作者:
V
Vadim Pisarevsky
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed several compile errors/warnings; reacted on the PR comments
上级
6da5d213
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
19 addition
and
22 deletion
+19
-22
modules/core/src/matrix.cpp
modules/core/src/matrix.cpp
+1
-1
modules/core/src/ocl.cpp
modules/core/src/ocl.cpp
+11
-14
modules/core/test/test_umat.cpp
modules/core/test/test_umat.cpp
+2
-2
modules/imgproc/src/opencl/cvtcolor.cl
modules/imgproc/src/opencl/cvtcolor.cl
+5
-4
modules/ocl/test/test_api.cpp
modules/ocl/test/test_api.cpp
+0
-1
未找到文件。
modules/core/src/matrix.cpp
浏览文件 @
d7f4a223
...
@@ -126,7 +126,7 @@ void MatAllocator::upload(UMatData* u, const void* srcptr, int dims, const size_
...
@@ -126,7 +126,7 @@ void MatAllocator::upload(UMatData* u, const void* srcptr, int dims, const size_
void
MatAllocator
::
copy
(
UMatData
*
usrc
,
UMatData
*
udst
,
int
dims
,
const
size_t
sz
[],
void
MatAllocator
::
copy
(
UMatData
*
usrc
,
UMatData
*
udst
,
int
dims
,
const
size_t
sz
[],
const
size_t
srcofs
[],
const
size_t
srcstep
[],
const
size_t
srcofs
[],
const
size_t
srcstep
[],
const
size_t
dstofs
[],
const
size_t
dststep
[],
bool
sync
)
const
const
size_t
dstofs
[],
const
size_t
dststep
[],
bool
/*sync*/
)
const
{
{
if
(
!
usrc
||
!
udst
)
if
(
!
usrc
||
!
udst
)
return
;
return
;
...
...
modules/core/src/ocl.cpp
浏览文件 @
d7f4a223
...
@@ -2258,25 +2258,21 @@ bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[],
...
@@ -2258,25 +2258,21 @@ bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[],
return
false
;
return
false
;
cl_command_queue
qq
=
getQueue
(
q
);
cl_command_queue
qq
=
getQueue
(
q
);
size_t
offset
[
CV_MAX_DIM
]
=
{
0
},
globalsize
[
CV_MAX_DIM
]
=
{
1
,
1
,
1
}
,
localsize
[
CV_MAX_DIM
]
=
{
1
,
1
,
1
}
;
size_t
offset
[
CV_MAX_DIM
]
=
{
0
},
globalsize
[
CV_MAX_DIM
]
=
{
1
,
1
,
1
};
size_t
total
=
1
;
size_t
total
=
1
;
CV_Assert
(
_globalsize
!=
0
);
for
(
int
i
=
0
;
i
<
dims
;
i
++
)
for
(
int
i
=
0
;
i
<
dims
;
i
++
)
{
{
size_t
val0
=
_localsize
?
_localsize
[
i
]
:
size_t
val
=
_localsize
?
_localsize
[
i
]
:
dims
==
1
?
64
:
dims
==
2
?
16
>>
i
:
dims
==
3
?
8
>>
(
i
>
0
)
:
1
;
dims
==
1
?
64
:
dims
==
2
?
(
16
>>
i
)
:
dims
==
3
?
(
8
>>
(
int
)(
i
>
0
))
:
1
;
size_t
val
=
1
;
CV_Assert
(
val
>
0
);
while
(
val
*
2
<
val0
)
val
*=
2
;
if
(
_localsize
)
localsize
[
i
]
=
val
;
CV_Assert
(
_globalsize
&&
_globalsize
[
i
]
>=
0
);
total
*=
_globalsize
[
i
];
total
*=
_globalsize
[
i
];
globalsize
[
i
]
=
((
_globalsize
[
i
]
+
val
-
1
)
/
val
)
*
val
;
globalsize
[
i
]
=
((
_globalsize
[
i
]
+
val
-
1
)
/
val
)
*
val
;
}
}
if
(
total
==
0
)
if
(
total
==
0
)
return
true
;
return
true
;
cl_int
retval
=
clEnqueueNDRangeKernel
(
qq
,
p
->
handle
,
(
cl_uint
)
dims
,
cl_int
retval
=
clEnqueueNDRangeKernel
(
qq
,
p
->
handle
,
(
cl_uint
)
dims
,
offset
,
globalsize
,
_localsize
?
localsize
:
0
,
0
,
0
,
offset
,
globalsize
,
_localsize
,
0
,
0
,
sync
?
0
:
&
p
->
e
);
sync
?
0
:
&
p
->
e
);
if
(
sync
||
retval
<
0
)
if
(
sync
||
retval
<
0
)
{
{
...
@@ -2976,7 +2972,7 @@ public:
...
@@ -2976,7 +2972,7 @@ public:
return
;
return
;
// there should be no user-visible CPU copies of the UMat which we are going to copy to
// there should be no user-visible CPU copies of the UMat which we are going to copy to
CV_Assert
(
u
->
refcount
==
0
);
CV_Assert
(
u
->
refcount
==
0
||
u
->
tempUMat
()
);
size_t
total
=
0
,
new_sz
[]
=
{
0
,
0
,
0
};
size_t
total
=
0
,
new_sz
[]
=
{
0
,
0
,
0
};
size_t
srcrawofs
=
0
,
new_srcofs
[]
=
{
0
,
0
,
0
},
new_srcstep
[]
=
{
0
,
0
,
0
};
size_t
srcrawofs
=
0
,
new_srcofs
[]
=
{
0
,
0
,
0
},
new_srcstep
[]
=
{
0
,
0
,
0
};
...
@@ -3028,7 +3024,7 @@ public:
...
@@ -3028,7 +3024,7 @@ public:
void
copy
(
UMatData
*
src
,
UMatData
*
dst
,
int
dims
,
const
size_t
sz
[],
void
copy
(
UMatData
*
src
,
UMatData
*
dst
,
int
dims
,
const
size_t
sz
[],
const
size_t
srcofs
[],
const
size_t
srcstep
[],
const
size_t
srcofs
[],
const
size_t
srcstep
[],
const
size_t
dstofs
[],
const
size_t
dststep
[],
bool
sync
)
const
const
size_t
dstofs
[],
const
size_t
dststep
[],
bool
_
sync
)
const
{
{
if
(
!
src
||
!
dst
)
if
(
!
src
||
!
dst
)
return
;
return
;
...
@@ -3072,14 +3068,15 @@ public:
...
@@ -3072,14 +3068,15 @@ public:
cl_int
retval
;
cl_int
retval
;
CV_Assert
(
(
retval
=
clEnqueueCopyBufferRect
(
q
,
(
cl_mem
)
src
->
handle
,
(
cl_mem
)
dst
->
handle
,
CV_Assert
(
(
retval
=
clEnqueueCopyBufferRect
(
q
,
(
cl_mem
)
src
->
handle
,
(
cl_mem
)
dst
->
handle
,
new_srcofs
,
new_dstofs
,
new_sz
,
new_srcofs
,
new_dstofs
,
new_sz
,
new_srcstep
[
0
],
new_srcstep
[
1
],
new_dststep
[
0
],
new_dststep
[
1
],
new_srcstep
[
0
],
new_srcstep
[
1
],
new_dststep
[
0
],
new_dststep
[
1
],
0
,
0
,
0
))
>=
0
);
0
,
0
,
0
))
>=
0
);
}
}
dst
->
markHostCopyObsolete
(
true
);
dst
->
markHostCopyObsolete
(
true
);
dst
->
markDeviceCopyObsolete
(
false
);
dst
->
markDeviceCopyObsolete
(
false
);
if
(
sync
)
if
(
_
sync
)
clFinish
(
q
);
clFinish
(
q
);
}
}
...
...
modules/core/test/test_umat.cpp
浏览文件 @
d7f4a223
...
@@ -201,7 +201,7 @@ void CV_UMatTest::run( int /* start_from */)
...
@@ -201,7 +201,7 @@ void CV_UMatTest::run( int /* start_from */)
TEST
(
Core_UMat
,
base
)
{
CV_UMatTest
test
;
test
.
safe_run
();
}
TEST
(
Core_UMat
,
base
)
{
CV_UMatTest
test
;
test
.
safe_run
();
}
TEST
(
Core_UMat
,
simple
)
TEST
(
Core_UMat
,
getUMat
)
{
{
{
{
int
a
[
3
]
=
{
1
,
2
,
3
};
int
a
[
3
]
=
{
1
,
2
,
3
};
...
@@ -216,7 +216,7 @@ TEST(Core_UMat, simple)
...
@@ -216,7 +216,7 @@ TEST(Core_UMat, simple)
{
{
uchar
*
const
ptr
=
m
.
ptr
<
uchar
>
(
y
);
uchar
*
const
ptr
=
m
.
ptr
<
uchar
>
(
y
);
for
(
int
x
=
0
;
x
<
m
.
cols
;
++
x
)
for
(
int
x
=
0
;
x
<
m
.
cols
;
++
x
)
ptr
[
x
]
=
x
+
y
*
2
;
ptr
[
x
]
=
(
uchar
)(
x
+
y
*
2
)
;
}
}
ref
=
m
.
clone
();
ref
=
m
.
clone
();
...
...
modules/imgproc/src/opencl/cvtcolor.cl
浏览文件 @
d7f4a223
...
@@ -124,16 +124,17 @@ __kernel void RGB2Gray(__global const uchar* srcptr, int srcstep, int srcoffset,
...
@@ -124,16 +124,17 @@ __kernel void RGB2Gray(__global const uchar* srcptr, int srcstep, int srcoffset,
#
endif
#
endif
}
}
#
else
#
else
const
int
x
0
=
get_global_id
(
0
)
*STRIPE_SIZE
;
const
int
x
_min
=
get_global_id
(
0
)
*STRIPE_SIZE
;
const
int
x
1
=
min
(
x0
+
STRIPE_SIZE,
cols
)
;
const
int
x
_max
=
min
(
x_min
+
STRIPE_SIZE,
cols
)
;
const
int
y
=
get_global_id
(
1
)
;
const
int
y
=
get_global_id
(
1
)
;
if
(
y
<
rows
)
if
(
y
<
rows
)
{
{
__global
const
DATA_TYPE*
src
=
(
__global
const
DATA_TYPE*
)(
srcptr
+
mad24
(
y,
srcstep,
srcoffset
))
+
x0*scn
;
__global
const
DATA_TYPE*
src
=
(
__global
const
DATA_TYPE*
)(
srcptr
+
mad24
(
y,
srcstep,
srcoffset
))
+
x_min*scn
;
__global
DATA_TYPE*
dst
=
(
__global
DATA_TYPE*
)(
dstptr
+
mad24
(
y,
dststep,
dstoffset
))
;
__global
DATA_TYPE*
dst
=
(
__global
DATA_TYPE*
)(
dstptr
+
mad24
(
y,
dststep,
dstoffset
))
;
int
x
;
int
x
;
for
(
x
=
x
0
; x < x1
; x++, src += scn )
for
(
x
=
x
_min
; x < x_max
; x++, src += scn )
#
ifdef
DEPTH_5
#
ifdef
DEPTH_5
dst[x]
=
src[bidx]
*
0.114f
+
src[1]
*
0.587f
+
src[
(
bidx^2
)
]
*
0.299f
;
dst[x]
=
src[bidx]
*
0.114f
+
src[1]
*
0.587f
+
src[
(
bidx^2
)
]
*
0.299f
;
#
else
#
else
...
...
modules/ocl/test/test_api.cpp
浏览文件 @
d7f4a223
...
@@ -136,4 +136,3 @@ TEST(OCL_TestTAPI, performance)
...
@@ -136,4 +136,3 @@ TEST(OCL_TestTAPI, performance)
cv::destroyWindow("result0");
cv::destroyWindow("result0");
cv::destroyWindow("result1");*/
cv::destroyWindow("result1");*/
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录