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
c1dad217
Commit
c1dad217
authored
Mar 05, 2014
by
Alexander Karsakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Device:: isAMD,isIntel,isNvidia methods.
parent
7ecbf457
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
7 deletions
+43
-7
ocl.hpp
modules/core/include/opencv2/core/ocl.hpp
+12
-0
ocl.cpp
modules/core/src/ocl.cpp
+29
-1
cascadedetect.cpp
modules/objdetect/src/cascadedetect.cpp
+2
-6
No files found.
modules/core/include/opencv2/core/ocl.hpp
View file @
c1dad217
...
...
@@ -161,6 +161,18 @@ public:
size_t
imageMaxBufferSize
()
const
;
size_t
imageMaxArraySize
()
const
;
enum
{
UNKNOWN_VENDOR
=
0
,
AMD
=
1
,
INTEL
=
2
,
NVIDIA
=
3
};
bool
isAMD
()
const
;
bool
isIntel
()
const
;
bool
isNvidia
()
const
;
int
maxClockFrequency
()
const
;
int
maxComputeUnits
()
const
;
int
maxConstantArgs
()
const
;
...
...
modules/core/src/ocl.cpp
View file @
c1dad217
...
...
@@ -1712,6 +1712,17 @@ struct Device::Impl
String
deviceVersion_
=
getStrProp
(
CL_DEVICE_VERSION
);
parseDeviceVersion
(
deviceVersion_
,
deviceVersionMajor_
,
deviceVersionMinor_
);
vendorName
=
getStrProp
(
CL_DEVICE_VENDOR
);
if
(
vendorName
==
"Advanced Micro Devices, Inc."
||
vendorName
==
"AMD"
)
vendor_
=
AMD
;
else
if
(
vendorName
==
"Intel(R) Corporation"
)
vendor_
=
INTEL
;
else
if
(
vendorName
==
"NVIDIA Corporation"
)
vendor_
=
NVIDIA
;
else
vendor_
=
UNKNOWN_VENDOR
;
}
template
<
typename
_TpCL
,
typename
_TpOut
>
...
...
@@ -1754,6 +1765,8 @@ struct Device::Impl
int
deviceVersionMajor_
;
int
deviceVersionMinor_
;
String
driverVersion_
;
String
vendorName
;
int
vendor_
;
};
...
...
@@ -1814,7 +1827,7 @@ String Device::version() const
{
return
p
?
p
->
version_
:
String
();
}
String
Device
::
vendor
()
const
{
return
p
?
p
->
getStrProp
(
CL_DEVICE_VENDOR
)
:
String
();
}
{
return
p
?
p
->
vendorName
:
String
();
}
String
Device
::
OpenCL_C_Version
()
const
{
return
p
?
p
->
getStrProp
(
CL_DEVICE_OPENCL_C_VERSION
)
:
String
();
}
...
...
@@ -1925,6 +1938,21 @@ size_t Device::imageMaxArraySize() const
{
CV_REQUIRE_OPENCL_1_2_ERROR
;
}
#endif
bool
Device
::
isAMD
()
const
{
return
p
->
vendor_
==
AMD
;
}
bool
Device
::
isIntel
()
const
{
return
p
->
vendor_
==
INTEL
;
}
bool
Device
::
isNvidia
()
const
{
return
p
->
vendor_
==
NVIDIA
;
}
int
Device
::
maxClockFrequency
()
const
{
return
p
?
p
->
getProp
<
cl_uint
,
int
>
(
CL_DEVICE_MAX_CLOCK_FREQUENCY
)
:
0
;
}
...
...
modules/objdetect/src/cascadedetect.cpp
View file @
c1dad217
...
...
@@ -583,9 +583,7 @@ bool HaarEvaluator::read(const FileNode& node, Size _origWinSize)
localSize
=
lbufSize
=
Size
(
0
,
0
);
if
(
ocl
::
haveOpenCL
())
{
String
vname
=
ocl
::
Device
::
getDefault
().
vendor
();
if
(
vname
==
"Advanced Micro Devices, Inc."
||
vname
==
"AMD"
)
if
(
ocl
::
Device
::
getDefault
().
isAMD
())
{
localSize
=
Size
(
8
,
8
);
lbufSize
=
Size
(
origWinSize
.
width
+
localSize
.
width
,
...
...
@@ -769,9 +767,7 @@ bool LBPEvaluator::read( const FileNode& node, Size _origWinSize )
if
(
ocl
::
haveOpenCL
())
{
const
ocl
::
Device
&
device
=
ocl
::
Device
::
getDefault
();
String
vname
=
device
.
vendor
();
if
((
vname
==
"Advanced Micro Devices, Inc."
||
vname
==
"AMD"
)
&&
!
device
.
hostUnifiedMemory
())
if
(
device
.
isAMD
()
&&
!
device
.
hostUnifiedMemory
())
localSize
=
Size
(
8
,
8
);
}
return
true
;
...
...
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