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
a67248f3
Commit
a67248f3
authored
Nov 12, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15883 from cbachhuber:refactor-opencl-information
parents
ba58bba4
c638f085
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
opencl_info.hpp
modules/core/include/opencv2/core/opencl/opencl_info.hpp
+20
-10
No files found.
modules/core/include/opencv2/core/opencl/opencl_info.hpp
View file @
a67248f3
...
...
@@ -47,6 +47,23 @@ static std::string bytesToStringRepr(size_t value)
s
=
s
.
substr
(
0
,
s
.
size
()
-
1
);
return
s
;
}
static
String
getDeviceTypeString
(
const
cv
::
ocl
::
Device
&
device
)
{
if
(
device
.
type
()
==
cv
::
ocl
::
Device
::
TYPE_CPU
)
{
return
"CPU"
;
}
if
(
device
.
type
()
==
cv
::
ocl
::
Device
::
TYPE_GPU
)
{
if
(
device
.
hostUnifiedMemory
())
{
return
"iGPU"
;
}
else
{
return
"dGPU"
;
}
}
return
"unkown"
;
}
}
// namespace
static
void
dumpOpenCLInformation
()
...
...
@@ -80,12 +97,11 @@ static void dumpOpenCLInformation()
for
(
int
j
=
0
;
j
<
platform
->
deviceNumber
();
j
++
)
{
platform
->
getDevice
(
current_device
,
j
);
const
char
*
deviceTypeStr
=
(
current_device
.
type
()
==
Device
::
TYPE_CPU
)
?
"CPU"
:
(
current_device
.
type
()
==
Device
::
TYPE_GPU
?
current_device
.
hostUnifiedMemory
()
?
"iGPU"
:
"dGPU"
:
"unknown"
);
String
deviceTypeStr
=
getDeviceTypeString
(
current_device
);
DUMP_MESSAGE_STDOUT
(
" "
<<
deviceTypeStr
<<
": "
<<
current_device
.
name
()
<<
" ("
<<
current_device
.
version
()
<<
")"
);
DUMP_CONFIG_PROPERTY
(
cv
::
format
(
"cv_ocl_platform_%d_device_%d"
,
(
int
)
i
,
j
),
cv
::
format
(
"(Platform=%s)(Type=%s)(Name=%s)(Version=%s)"
,
platform
->
name
().
c_str
(),
deviceTypeStr
,
current_device
.
name
().
c_str
(),
current_device
.
version
().
c_str
())
);
platform
->
name
().
c_str
(),
deviceTypeStr
.
c_str
()
,
current_device
.
name
().
c_str
(),
current_device
.
version
().
c_str
())
);
}
}
const
Device
&
device
=
Device
::
getDefault
();
...
...
@@ -94,13 +110,7 @@ static void dumpOpenCLInformation()
DUMP_MESSAGE_STDOUT
(
"Current OpenCL device: "
);
#if 0
DUMP_MESSAGE_STDOUT(" Platform = " << device.getPlatform().name());
DUMP_CONFIG_PROPERTY("cv_ocl_current_platformName", device.getPlatform().name());
#endif
const
char
*
deviceTypeStr
=
(
device
.
type
()
==
Device
::
TYPE_CPU
)
?
"CPU"
:
(
device
.
type
()
==
Device
::
TYPE_GPU
?
device
.
hostUnifiedMemory
()
?
"iGPU"
:
"dGPU"
:
"unknown"
);
String
deviceTypeStr
=
getDeviceTypeString
(
device
);
DUMP_MESSAGE_STDOUT
(
" Type = "
<<
deviceTypeStr
);
DUMP_CONFIG_PROPERTY
(
"cv_ocl_current_deviceType"
,
deviceTypeStr
);
...
...
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