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
c8930cc2
Commit
c8930cc2
authored
Jan 27, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opencv_version: dump detected HW features
parent
01f4a173
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
opencv_version.cpp
apps/version/opencv_version.cpp
+22
-0
utility.hpp
modules/core/include/opencv2/core/utility.hpp
+6
-0
system.cpp
modules/core/src/system.cpp
+5
-0
No files found.
apps/version/opencv_version.cpp
View file @
c8930cc2
...
...
@@ -20,6 +20,7 @@ int main(int argc, const char** argv)
"{ help h usage ? | | show this help message }"
"{ verbose v | | show build configuration log }"
"{ opencl | | show information about OpenCL (available platforms/devices, default selected device) }"
"{ hw | | show detected HW features (see cv::checkHardwareSupport() function). Use --hw=0 to show available features only }"
);
if
(
parser
.
has
(
"help"
))
...
...
@@ -42,5 +43,26 @@ int main(int argc, const char** argv)
cv
::
dumpOpenCLInformation
();
}
if
(
parser
.
has
(
"hw"
))
{
bool
showAll
=
parser
.
get
<
bool
>
(
"hw"
);
std
::
cout
<<
"OpenCV's HW features list:"
<<
std
::
endl
;
int
count
=
0
;
for
(
int
i
=
0
;
i
<
CV_HARDWARE_MAX_FEATURE
;
i
++
)
{
cv
::
String
name
=
cv
::
getHardwareFeatureName
(
i
);
if
(
name
.
empty
())
continue
;
bool
enabled
=
cv
::
checkHardwareSupport
(
i
);
if
(
enabled
)
count
++
;
if
(
enabled
||
showAll
)
{
printf
(
" ID=%3d (%s) -> %s
\n
"
,
i
,
name
.
c_str
(),
enabled
?
"ON"
:
"N/A"
);
}
}
std
::
cout
<<
"Total available: "
<<
count
<<
std
::
endl
;
}
return
0
;
}
modules/core/include/opencv2/core/utility.hpp
View file @
c8930cc2
...
...
@@ -427,6 +427,12 @@ in OpenCV.
*/
CV_EXPORTS_W
bool
checkHardwareSupport
(
int
feature
);
/** @brief Returns feature name by ID
Returns empty string if feature is not defined
*/
CV_EXPORTS_W
String
getHardwareFeatureName
(
int
feature
);
/** @brief Returns the number of logical CPUs available for the process.
*/
CV_EXPORTS_W
int
getNumberOfCPUs
();
...
...
modules/core/src/system.cpp
View file @
c8930cc2
...
...
@@ -663,6 +663,11 @@ bool checkHardwareSupport(int feature)
return
currentFeatures
->
have
[
feature
];
}
String
getHardwareFeatureName
(
int
feature
)
{
const
char
*
name
=
getHWFeatureName
(
feature
);
return
name
?
String
(
name
)
:
String
();
}
volatile
bool
useOptimizedFlag
=
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