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
5304e9f2
Commit
5304e9f2
authored
Nov 06, 2013
by
Konstantin Matskevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extending openCL info dump
parent
be37d995
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
16 deletions
+57
-16
opencl_dumpinfo.hpp
modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp
+45
-16
main.cpp
modules/ocl/perf/main.cpp
+12
-0
No files found.
modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp
View file @
5304e9f2
...
...
@@ -39,7 +39,7 @@
//
//M*/
#if !defined(DUMP_INFO_STDOUT) && !defined(DUMP_INFO_XML)
#if !defined(DUMP_INFO_STDOUT) && !defined(DUMP_INFO_XML)
&& !defined(DUMP_DEVICES_INFO_STDOUT) && !defined(DUMP_DEVICES_INFO_XML)
#error Invalid usage
#endif
...
...
@@ -51,6 +51,14 @@
#define DUMP_INFO_XML(...)
#endif
#if !defined(DUMP_DEVICES_INFO_STDOUT)
#define DUMP_DEVICES_INFO_STDOUT(...)
#endif
#if !defined(DUMP_DEVICES_INFO_XML)
#define DUMP_DEVICES_INFO_XML(...)
#endif
#include <sstream>
static
std
::
string
bytesToStringRepr
(
size_t
value
)
...
...
@@ -85,43 +93,64 @@ static void dumpOpenCLDevice()
using
namespace
cv
::
ocl
;
try
{
const
cv
::
ocl
::
DeviceInfo
&
deviceInfo
=
cv
::
ocl
::
Context
::
getContext
()
->
getDeviceInfo
();
cv
::
ocl
::
PlatformsInfo
platforms
;
cv
::
ocl
::
getOpenCLPlatforms
(
platforms
);
DUMP_INFO_STDOUT
(
"OpenCL Platforms"
,
""
);
DUMP_INFO_XML
(
"OpenCL Platforms"
,
""
);
const
char
*
deviceTypeStr
;
for
(
unsigned
int
i
=
0
;
i
<
platforms
.
size
();
i
++
)
{
DUMP_INFO_STDOUT
(
" "
,
platforms
.
at
(
i
)
->
platformName
);
DUMP_INFO_XML
(
""
,
platforms
.
at
(
i
)
->
platformName
);
cv
::
ocl
::
DevicesInfo
devices
;
cv
::
ocl
::
getOpenCLDevices
(
devices
);
for
(
unsigned
int
j
=
0
;
j
<
devices
.
size
();
j
++
)
{
deviceTypeStr
=
devices
.
at
(
j
)
->
deviceType
==
CVCL_DEVICE_TYPE_CPU
?
(
"CPU"
)
:
(
devices
.
at
(
j
)
->
deviceType
==
CVCL_DEVICE_TYPE_GPU
?
"GPU"
:
"unknown"
);
DUMP_DEVICES_INFO_STDOUT
(
deviceTypeStr
,
j
,
devices
.
at
(
j
)
->
deviceName
,
devices
.
at
(
j
)
->
deviceVersion
);
DUMP_DEVICES_INFO_XML
(
deviceTypeStr
,
j
,
devices
.
at
(
j
)
->
deviceName
,
devices
.
at
(
j
)
->
deviceVersion
);
}
}
DUMP_INFO_STDOUT
(
"Current OpenCL device"
,
""
);
DUMP_INFO_XML
(
"Current OpenCL device"
,
""
);
const
char
*
deviceTypeStr
=
deviceInfo
.
deviceType
==
CVCL_DEVICE_TYPE_CPU
?
"CPU"
:
(
deviceInfo
.
deviceType
==
CVCL_DEVICE_TYPE_GPU
?
"GPU"
:
"unknown"
);
DUMP_INFO_STDOUT
(
"Device type"
,
deviceTypeStr
);
DUMP_INFO_XML
(
"cv_ocl_deviceType"
,
deviceTypeStr
);
const
cv
::
ocl
::
DeviceInfo
&
deviceInfo
=
cv
::
ocl
::
Context
::
getContext
()
->
getDeviceInfo
();
DUMP_INFO_STDOUT
(
"
Platform name
"
,
deviceInfo
.
platform
->
platformName
);
DUMP_INFO_STDOUT
(
"
Platform
"
,
deviceInfo
.
platform
->
platformName
);
DUMP_INFO_XML
(
"cv_ocl_platformName"
,
deviceInfo
.
platform
->
platformName
);
DUMP_INFO_STDOUT
(
"Device name"
,
deviceInfo
.
deviceName
);
deviceTypeStr
=
deviceInfo
.
deviceType
==
CVCL_DEVICE_TYPE_CPU
?
"CPU"
:
(
deviceInfo
.
deviceType
==
CVCL_DEVICE_TYPE_GPU
?
"GPU"
:
"unknown"
);
DUMP_INFO_STDOUT
(
" Type"
,
deviceTypeStr
);
DUMP_INFO_XML
(
"cv_ocl_deviceType"
,
deviceTypeStr
);
DUMP_INFO_STDOUT
(
" Name"
,
deviceInfo
.
deviceName
);
DUMP_INFO_XML
(
"cv_ocl_deviceName"
,
deviceInfo
.
deviceName
);
DUMP_INFO_STDOUT
(
"
Device v
ersion"
,
deviceInfo
.
deviceVersion
);
DUMP_INFO_STDOUT
(
"
V
ersion"
,
deviceInfo
.
deviceVersion
);
DUMP_INFO_XML
(
"cv_ocl_deviceVersion"
,
deviceInfo
.
deviceVersion
);
DUMP_INFO_STDOUT
(
"Compute units"
,
deviceInfo
.
maxComputeUnits
);
DUMP_INFO_STDOUT
(
"
Compute units"
,
deviceInfo
.
maxComputeUnits
);
DUMP_INFO_XML
(
"cv_ocl_maxComputeUnits"
,
deviceInfo
.
maxComputeUnits
);
DUMP_INFO_STDOUT
(
"Max work group size"
,
deviceInfo
.
maxWorkGroupSize
);
DUMP_INFO_STDOUT
(
"
Max work group size"
,
deviceInfo
.
maxWorkGroupSize
);
DUMP_INFO_XML
(
"cv_ocl_maxWorkGroupSize"
,
deviceInfo
.
maxWorkGroupSize
);
std
::
string
localMemorySizeStr
=
bytesToStringRepr
(
deviceInfo
.
localMemorySize
);
DUMP_INFO_STDOUT
(
"Local memory size"
,
localMemorySizeStr
.
c_str
());
DUMP_INFO_STDOUT
(
"
Local memory size"
,
localMemorySizeStr
.
c_str
());
DUMP_INFO_XML
(
"cv_ocl_localMemorySize"
,
deviceInfo
.
localMemorySize
);
std
::
string
maxMemAllocSizeStr
=
bytesToStringRepr
(
deviceInfo
.
maxMemAllocSize
);
DUMP_INFO_STDOUT
(
"Max memory allocation size"
,
maxMemAllocSizeStr
.
c_str
());
DUMP_INFO_STDOUT
(
"
Max memory allocation size"
,
maxMemAllocSizeStr
.
c_str
());
DUMP_INFO_XML
(
"cv_ocl_maxMemAllocSize"
,
deviceInfo
.
maxMemAllocSize
);
const
char
*
doubleSupportStr
=
deviceInfo
.
haveDoubleSupport
?
"Yes"
:
"No"
;
DUMP_INFO_STDOUT
(
"Double support"
,
doubleSupportStr
);
DUMP_INFO_STDOUT
(
"
Double support"
,
doubleSupportStr
);
DUMP_INFO_XML
(
"cv_ocl_haveDoubleSupport"
,
deviceInfo
.
haveDoubleSupport
);
const
char
*
isUnifiedMemoryStr
=
deviceInfo
.
isUnifiedMemory
?
"Yes"
:
"No"
;
DUMP_INFO_STDOUT
(
"Unified memory"
,
isUnifiedMemoryStr
);
DUMP_INFO_STDOUT
(
"
Unified memory"
,
isUnifiedMemoryStr
);
DUMP_INFO_XML
(
"cv_ocl_isUnifiedMemory"
,
deviceInfo
.
isUnifiedMemory
);
}
catch
(...)
...
...
modules/ocl/perf/main.cpp
View file @
5304e9f2
...
...
@@ -53,6 +53,18 @@
::testing::Test::RecordProperty((propertyXMLName), ss.str()); \
} while (false)
#define DUMP_DEVICES_INFO_STDOUT(deviceType, deviceIndex, deviceName, deviceVersion) \
do { \
std::cout << " " << (deviceType) << " " << (deviceIndex) << " : " << (deviceName) << " : " << deviceVersion << std::endl; \
} while (false)
#define DUMP_DEVICES_INFO_XML(deviceType, deviceIndex, deviceName, deviceVersion) \
do { \
std::stringstream ss; \
ss << ":" << deviceIndex << ":" << deviceName << ":" << deviceVersion; \
::testing::Test::RecordProperty((deviceType), ss.str()); \
} while (false)
#include "opencv2/ocl/private/opencl_dumpinfo.hpp"
static
const
char
*
impls
[]
=
...
...
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