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
44d9d59f
Commit
44d9d59f
authored
Dec 03, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ocl: stop using of OpenCL without explicit UMat arguments
parent
4a095e4d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
3 deletions
+19
-3
ocl.hpp
modules/core/include/opencv2/core/ocl.hpp
+3
-0
ocl.cpp
modules/core/src/ocl.cpp
+12
-0
orb.cpp
modules/features2d/src/orb.cpp
+1
-1
cascadedetect.cpp
modules/objdetect/src/cascadedetect.cpp
+3
-2
No files found.
modules/core/include/opencv2/core/ocl.hpp
View file @
44d9d59f
...
...
@@ -739,6 +739,9 @@ CV_EXPORTS MatAllocator* getOpenCLAllocator();
#ifdef __OPENCV_BUILD
namespace
internal
{
CV_EXPORTS
bool
isOpenCLForced
();
#define OCL_FORCE_CHECK(condition) (cv::ocl::internal::isOpenCLForced() || (condition))
CV_EXPORTS
bool
isPerformanceCheckBypassed
();
#define OCL_PERFORMANCE_CHECK(condition) (cv::ocl::internal::isPerformanceCheckBypassed() || (condition))
...
...
modules/core/src/ocl.cpp
View file @
44d9d59f
...
...
@@ -6073,6 +6073,18 @@ void* Image2D::ptr() const
return
p
?
p
->
handle
:
0
;
}
bool
internal
::
isOpenCLForced
()
{
static
bool
initialized
=
false
;
static
bool
value
=
false
;
if
(
!
initialized
)
{
value
=
getBoolParameter
(
"OPENCV_OPENCL_FORCE"
,
false
);
initialized
=
true
;
}
return
value
;
}
bool
internal
::
isPerformanceCheckBypassed
()
{
static
bool
initialized
=
false
;
...
...
modules/features2d/src/orb.cpp
View file @
44d9d59f
...
...
@@ -972,7 +972,7 @@ void ORB_Impl::detectAndCompute( InputArray _image, InputArray _mask,
int
halfPatchSize
=
patchSize
/
2
;
int
border
=
std
::
max
(
edgeThreshold
,
std
::
max
(
halfPatchSize
,
HARRIS_BLOCK_SIZE
/
2
))
+
1
;
bool
useOCL
=
ocl
::
useOpenCL
();
bool
useOCL
=
ocl
::
useOpenCL
()
&&
OCL_FORCE_CHECK
(
_image
.
isUMat
()
||
_descriptors
.
isUMat
())
;
Mat
image
=
_image
.
getMat
(),
mask
=
_mask
.
getMat
();
if
(
image
.
type
()
!=
CV_8UC1
)
...
...
modules/objdetect/src/cascadedetect.cpp
View file @
44d9d59f
...
...
@@ -1290,8 +1290,8 @@ void CascadeClassifierImpl::detectMultiScaleNoGrouping( InputArray _image, std::
#ifdef HAVE_OPENCL
bool
use_ocl
=
tryOpenCL
&&
ocl
::
useOpenCL
()
&&
OCL_FORCE_CHECK
(
_image
.
isUMat
())
&&
featureEvaluator
->
getLocalSize
().
area
()
>
0
&&
ocl
::
Device
::
getDefault
().
type
()
!=
ocl
::
Device
::
TYPE_CPU
&&
(
data
.
minNodesPerTree
==
data
.
maxNodesPerTree
)
&&
!
isOldFormatCascade
()
&&
maskGenerator
.
empty
()
&&
...
...
@@ -1316,7 +1316,8 @@ void CascadeClassifierImpl::detectMultiScaleNoGrouping( InputArray _image, std::
// OpenCL code
CV_OCL_RUN
(
use_ocl
,
ocl_detectMultiScaleNoGrouping
(
scales
,
candidates
))
tryOpenCL
=
false
;
if
(
use_ocl
)
tryOpenCL
=
false
;
#endif
// CPU code
...
...
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