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
3a263c63
Commit
3a263c63
authored
Oct 23, 2014
by
Alexander Karsakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for Image2D
parent
e40567ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
ocl.cpp
modules/core/src/ocl.cpp
+3
-0
test_image2d.cpp
modules/core/test/ocl/test_image2d.cpp
+44
-0
No files found.
modules/core/src/ocl.cpp
View file @
3a263c63
...
...
@@ -4624,6 +4624,9 @@ struct Image2D::Impl
static
bool
isFormatSupported
(
cl_image_format
format
)
{
if
(
!
haveOpenCL
())
CV_Error
(
Error
::
OpenCLApiCallError
,
"OpenCL runtime not found!"
);
cl_context
context
=
(
cl_context
)
Context
::
getDefault
().
ptr
();
// Figure out how many formats are supported by this context.
cl_uint
numFormats
=
0
;
...
...
modules/core/test/ocl/test_image2d.cpp
0 → 100644
View file @
3a263c63
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// Copyright (C) 2014, Itseez, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL
namespace
cvtest
{
namespace
ocl
{
PARAM_TEST_CASE
(
Image2DBasicTest
,
int
,
int
)
{
int
depth
,
ch
;
};
TEST
(
Image2D
,
turnOffOpenCL
)
{
if
(
cv
::
ocl
::
haveOpenCL
())
{
// save the current state
bool
useOCL
=
cv
::
ocl
::
useOpenCL
();
cv
::
ocl
::
setUseOpenCL
(
true
);
UMat
um
(
128
,
128
,
CV_8UC1
);
cv
::
ocl
::
setUseOpenCL
(
false
);
cv
::
ocl
::
Image2D
image
(
um
);
// reset state to the previous one
cv
::
ocl
::
setUseOpenCL
(
useOCL
);
}
}
}
}
// namespace cvtest::ocl
#endif // HAVE_OPENCL
\ No newline at end of file
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