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
161c3b71
Commit
161c3b71
authored
Dec 02, 2013
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hopefully, now opencv_test_imgproc should pass
parent
5fea17ff
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
21 deletions
+6
-21
mat.hpp
modules/core/include/opencv2/core/mat.hpp
+0
-1
matrix.cpp
modules/core/src/matrix.cpp
+0
-4
ocl.cpp
modules/core/src/ocl.cpp
+6
-5
umatrix.cpp
modules/core/src/umatrix.cpp
+0
-2
test_api.cpp
modules/ocl/test/test_api.cpp
+0
-9
No files found.
modules/core/include/opencv2/core/mat.hpp
View file @
161c3b71
...
...
@@ -283,7 +283,6 @@ public:
void
*
data
,
size_t
*
step
,
int
flags
)
const
=
0
;
virtual
bool
allocate
(
UMatData
*
data
,
int
accessflags
)
const
=
0
;
virtual
void
deallocate
(
UMatData
*
data
)
const
=
0
;
virtual
void
sync
(
UMatData
*
u
)
const
;
virtual
void
map
(
UMatData
*
data
,
int
accessflags
)
const
;
virtual
void
unmap
(
UMatData
*
data
)
const
;
virtual
void
download
(
UMatData
*
data
,
void
*
dst
,
int
dims
,
const
size_t
sz
[],
...
...
modules/core/src/matrix.cpp
View file @
161c3b71
...
...
@@ -48,10 +48,6 @@
namespace
cv
{
void
MatAllocator
::
sync
(
UMatData
*
)
const
{
}
void
MatAllocator
::
map
(
UMatData
*
,
int
)
const
{
}
...
...
modules/core/src/ocl.cpp
View file @
161c3b71
...
...
@@ -2268,8 +2268,8 @@ bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[],
CV_Assert
(
_globalsize
!=
0
);
for
(
int
i
=
0
;
i
<
dims
;
i
++
)
{
size_t
val
=
_localsize
?
_localsize
[
i
]
:
1
;
//
dims == 1 ? 64 : dims == 2 ? (16>>i) : dims == 3 ? (8>>(int)(i>0)) : 1;
size_t
val
=
_localsize
?
_localsize
[
i
]
:
dims
==
1
?
64
:
dims
==
2
?
(
16
>>
i
)
:
dims
==
3
?
(
8
>>
(
int
)(
i
>
0
))
:
1
;
CV_Assert
(
val
>
0
);
total
*=
_globalsize
[
i
];
globalsize
[
i
]
=
((
_globalsize
[
i
]
+
val
-
1
)
/
val
)
*
val
;
...
...
@@ -2721,7 +2721,7 @@ public:
return
true
;
}
void
sync
(
UMatData
*
u
)
const
/*
void sync(UMatData* u) const
{
cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr();
UMatDataAutoLock lock(u);
...
...
@@ -2749,19 +2749,19 @@ public:
clEnqueueWriteBuffer(q, (cl_mem)u->handle, CL_TRUE, 0,
u->size, u->data, 0, 0, 0);
}
}
}
*/
void
deallocate
(
UMatData
*
u
)
const
{
if
(
!
u
)
return
;
UMatDataAutoLock
lock
(
u
);
// TODO: !!! when we add Shared Virtual Memory Support,
// this function (as well as the others) should be corrected
CV_Assert
(
u
->
handle
!=
0
&&
u
->
urefcount
==
0
);
if
(
u
->
tempUMat
())
{
UMatDataAutoLock
lock
(
u
);
if
(
u
->
hostCopyObsolete
()
&&
u
->
refcount
>
0
)
{
cl_command_queue
q
=
(
cl_command_queue
)
Queue
::
getDefault
().
ptr
();
...
...
@@ -2792,6 +2792,7 @@ public:
}
else
{
CV_Assert
(
u
->
refcount
==
0
);
if
(
u
->
data
&&
u
->
copyOnMap
()
&&
!
(
u
->
flags
&
UMatData
::
USER_ALLOCATED
))
{
fastFree
(
u
->
data
);
...
...
modules/core/src/umatrix.cpp
View file @
161c3b71
...
...
@@ -286,8 +286,6 @@ void UMat::copySize(const UMat& m)
UMat
::~
UMat
()
{
//if( u && u->refcount > 0 )
// u->currAllocator->sync(u);
release
();
if
(
step
.
p
!=
step
.
buf
)
fastFree
(
step
.
p
);
...
...
modules/ocl/test/test_api.cpp
View file @
161c3b71
...
...
@@ -83,12 +83,8 @@ TEST(TestAPI, openCLExecuteKernelInterop)
TEST
(
OCL_TestTAPI
,
performance
)
{
cv
::
RNG
rng
;
#if 1
cv
::
Mat
src
(
1280
,
768
,
CV_8UC4
),
dst
;
rng
.
fill
(
src
,
RNG
::
UNIFORM
,
0
,
255
);
#else
cv
::
Mat
src
=
cv
::
imread
(
"/Users/vp/work/opencv/samples/c/lena.jpg"
,
1
),
dst
;
#endif
cv
::
UMat
usrc
,
udst
;
src
.
copyTo
(
usrc
);
...
...
@@ -130,9 +126,4 @@ TEST(OCL_TestTAPI, performance)
}
t
=
(
double
)
cv
::
getTickCount
()
-
t
;
printf
(
"cpu exec time = %gms per iter
\n
"
,
t
*
1000.
/
niters
/
cv
::
getTickFrequency
());
/*cv::imshow("result0", dst);
cv::imshow("result1", udst);
cv::waitKey();
cv::destroyWindow("result0");
cv::destroyWindow("result1");*/
}
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