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
388d0ef1
Commit
388d0ef1
authored
Dec 18, 2013
by
Andrey Pavlenko
Committed by
OpenCV Buildbot
Dec 18, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2004 from ilya-lavrenov:tapi_umat_copyto
parents
bd91b395
ac030c16
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
6 deletions
+23
-6
matrix.cpp
modules/core/src/matrix.cpp
+3
-3
umatrix.cpp
modules/core/src/umatrix.cpp
+2
-3
test_matrix_operation.cpp
modules/core/test/ocl/test_matrix_operation.cpp
+18
-0
No files found.
modules/core/src/matrix.cpp
View file @
388d0ef1
...
...
@@ -134,11 +134,11 @@ void MatAllocator::copy(UMatData* usrc, UMatData* udst, int dims, const size_t s
{
CV_Assert
(
sz
[
i
]
<=
(
size_t
)
INT_MAX
);
if
(
sz
[
i
]
==
0
)
return
;
return
;
if
(
srcofs
)
srcptr
+=
srcofs
[
i
]
*
(
i
<=
dims
-
2
?
srcstep
[
i
]
:
1
);
srcptr
+=
srcofs
[
i
]
*
(
i
<=
dims
-
2
?
srcstep
[
i
]
:
1
);
if
(
dstofs
)
dstptr
+=
dstofs
[
i
]
*
(
i
<=
dims
-
2
?
dststep
[
i
]
:
1
);
dstptr
+=
dstofs
[
i
]
*
(
i
<=
dims
-
2
?
dststep
[
i
]
:
1
);
isz
[
i
]
=
(
int
)
sz
[
i
];
}
...
...
modules/core/src/umatrix.cpp
View file @
388d0ef1
...
...
@@ -643,11 +643,10 @@ void UMat::copyTo(OutputArray _dst) const
if
(
_dst
.
kind
()
==
_InputArray
::
UMAT
)
{
UMat
dst
=
_dst
.
getUMat
();
void
*
srchandle
=
handle
(
ACCESS_READ
);
void
*
dsthandle
=
dst
.
handle
(
ACCESS_WRITE
);
if
(
srchandle
==
dsthandle
&&
dst
.
offset
==
offset
)
if
(
u
==
dst
.
u
&&
dst
.
offset
==
offset
)
return
;
dst
.
ndoffset
(
dstofs
);
dstofs
[
dims
-
1
]
*=
esz
;
CV_Assert
(
u
->
currAllocator
==
dst
.
u
->
currAllocator
);
u
->
currAllocator
->
copy
(
u
,
dst
.
u
,
dims
,
sz
,
srcofs
,
step
.
p
,
dstofs
,
dst
.
step
.
p
,
false
);
}
...
...
modules/core/test/ocl/test_matrix_operation.cpp
View file @
388d0ef1
...
...
@@ -103,9 +103,27 @@ OCL_TEST_P(ConvertTo, Accuracy)
}
}
typedef
MatrixTestBase
CopyTo
;
OCL_TEST_P
(
CopyTo
,
Accuracy
)
{
for
(
int
j
=
0
;
j
<
test_loop_times
;
j
++
)
{
generateTestData
();
OCL_OFF
(
src_roi
.
copyTo
(
dst_roi
));
OCL_ON
(
usrc_roi
.
copyTo
(
udst_roi
));
OCL_EXPECT_MATS_NEAR
(
dst
,
0
);
}
}
OCL_INSTANTIATE_TEST_CASE_P
(
MatrixOperation
,
ConvertTo
,
Combine
(
OCL_ALL_DEPTHS
,
OCL_ALL_DEPTHS
,
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
MatrixOperation
,
CopyTo
,
Combine
(
OCL_ALL_DEPTHS
,
Values
((
MatDepth
)
0
),
OCL_ALL_CHANNELS
,
Bool
()));
}
}
// namespace cvtest::ocl
#endif
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