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
cd5c7069
Commit
cd5c7069
authored
Jul 27, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ocl: add map tests
parent
b36f565d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
+28
-5
umatrix.cpp
modules/core/src/umatrix.cpp
+1
-1
test_umat.cpp
modules/core/test/test_umat.cpp
+27
-4
No files found.
modules/core/src/umatrix.cpp
View file @
cd5c7069
...
...
@@ -606,7 +606,7 @@ void* UMat::handle(int accessFlags) const
// check flags: if CPU copy is newer, copy it back to GPU.
if
(
u
->
deviceCopyObsolete
()
)
{
CV_Assert
(
u
->
refcount
==
0
);
CV_Assert
(
u
->
refcount
==
0
||
u
->
origdata
);
u
->
currAllocator
->
unmap
(
u
);
}
...
...
modules/core/test/test_umat.cpp
View file @
cd5c7069
...
...
@@ -935,9 +935,7 @@ TEST(UMat, DISABLED_synchronization_map_unmap)
}
}
}
}
// namespace cvtest::ocl
TEST
(
UMat
,
DISABLED_bug_with_unmap
)
TEST
(
UMat
,
async_unmap
)
{
for
(
int
i
=
0
;
i
<
20
;
i
++
)
{
...
...
@@ -963,7 +961,7 @@ TEST(UMat, DISABLED_bug_with_unmap)
}
}
TEST
(
UMat
,
DISABLED_bug_with_
unmap_in_class
)
TEST
(
UMat
,
unmap_in_class
)
{
class
Logic
{
...
...
@@ -1004,6 +1002,28 @@ TEST(UMat, DISABLED_bug_with_unmap_in_class)
}
}
TEST
(
UMat
,
map_unmap_counting
)
{
if
(
!
cv
::
ocl
::
useOpenCL
())
{
std
::
cout
<<
"OpenCL is not enabled. Skip test"
<<
std
::
endl
;
return
;
}
std
::
cout
<<
"Host memory: "
<<
cv
::
ocl
::
Device
::
getDefault
().
hostUnifiedMemory
()
<<
std
::
endl
;
Mat
m
(
Size
(
10
,
10
),
CV_8UC1
);
UMat
um
=
m
.
getUMat
(
ACCESS_RW
);
{
Mat
d
=
um
.
getMat
(
ACCESS_RW
);
d
.
release
();
}
void
*
h
=
NULL
;
EXPECT_NO_THROW
(
h
=
um
.
handle
(
ACCESS_RW
));
std
::
cout
<<
"Handle: "
<<
h
<<
std
::
endl
;
}
TEST
(
UMat
,
Test_same_behaviour_read_and_read
)
{
bool
exceptionDetected
=
false
;
...
...
@@ -1070,3 +1090,6 @@ TEST(UMat, DISABLED_Test_same_behaviour_write_and_write)
}
ASSERT_TRUE
(
exceptionDetected
);
// data race
}
}
}
// namespace cvtest::ocl
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