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
e9edfd1c
Commit
e9edfd1c
authored
Nov 06, 2013
by
Konstantin Matskevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
5304e9f2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
70 deletions
+53
-70
opencl_dumpinfo.hpp
modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp
+39
-49
main.cpp
modules/ocl/perf/main.cpp
+7
-16
main.cpp
modules/ocl/test/main.cpp
+7
-5
No files found.
modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp
View file @
e9edfd1c
...
...
@@ -39,24 +39,16 @@
//
//M*/
#if !defined(DUMP_
INFO_STDOUT) && !defined(DUMP_INFO_XML) && !defined(DUMP_DEVICES_INFO_STDOUT) && !defined(DUMP_DEVICES_INFO
_XML)
#if !defined(DUMP_
MESSAGE_STDOUT) && !defined(DUMP_PROPERTY
_XML)
#error Invalid usage
#endif
#if !defined(DUMP_
INFO_STDOUT
)
#define DUMP_
INFO_STDOUT
(...)
#if !defined(DUMP_
PROPERTY_XML
)
#define DUMP_
PROPERTY_XML
(...)
#endif
#if !defined(DUMP_INFO_XML)
#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(...)
#if !defined(DUMP_MESSAGE_STDOUT)
#define DUMP_MESSAGE_STDOUT(...)
#endif
#include <sstream>
...
...
@@ -95,70 +87,68 @@ static void dumpOpenCLDevice()
{
cv
::
ocl
::
PlatformsInfo
platforms
;
cv
::
ocl
::
getOpenCLPlatforms
(
platforms
);
DUMP_INFO_STDOUT
(
"OpenCL Platforms"
,
""
);
DUMP_INFO_XML
(
"OpenCL Platforms"
,
""
);
DUMP_MESSAGE_STDOUT
(
"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
);
DUMP_MESSAGE_STDOUT
(
" "
<<
platforms
.
at
(
i
)
->
platformName
);
const
cv
::
ocl
::
DevicesInfo
&
devices
=
platforms
.
at
(
i
)
->
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
);
const
cv
::
ocl
::
DeviceInfo
&
current_device
=
*
devices
.
at
(
j
);
deviceTypeStr
=
current_device
.
deviceType
==
CVCL_DEVICE_TYPE_CPU
?
(
"CPU"
)
:
(
current_device
.
deviceType
==
CVCL_DEVICE_TYPE_GPU
?
"GPU"
:
"unknown"
);
DUMP_MESSAGE_STDOUT
(
" "
<<
deviceTypeStr
<<
" : "
<<
current_device
.
deviceName
<<
" : "
<<
current_device
.
deviceVersion
);
DUMP_PROPERTY_XML
(
"cv_ocl_platform_"
<<
i
<<
"_device_"
<<
j
,
"(Platform="
<<
current_device
.
platform
->
platformName
<<
")(Type="
<<
deviceTypeStr
<<
")(Name="
<<
current_device
.
deviceName
<<
")(Version="
<<
current_device
.
deviceVersion
<<
")"
);
}
}
DUMP_INFO_STDOUT
(
"Current OpenCL device"
,
""
);
DUMP_INFO_XML
(
"Current OpenCL device"
,
""
);
DUMP_MESSAGE_STDOUT
(
"Current OpenCL device: "
);
const
cv
::
ocl
::
DeviceInfo
&
deviceInfo
=
cv
::
ocl
::
Context
::
getContext
()
->
getDeviceInfo
();
DUMP_
INFO_STDOUT
(
" Platform"
,
deviceInfo
.
platform
->
platformName
);
DUMP_
INFO_XML
(
"cv_ocl
_platformName"
,
deviceInfo
.
platform
->
platformName
);
DUMP_
MESSAGE_STDOUT
(
" Platform = "
<<
deviceInfo
.
platform
->
platformName
);
DUMP_
PROPERTY_XML
(
"cv_ocl_current
_platformName"
,
deviceInfo
.
platform
->
platformName
);
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_
MESSAGE_STDOUT
(
" Type = "
<<
deviceTypeStr
);
DUMP_
PROPERTY_XML
(
"cv_ocl_current
_deviceType"
,
deviceTypeStr
);
DUMP_
INFO_STDOUT
(
" Name"
,
deviceInfo
.
deviceName
);
DUMP_
INFO_XML
(
"cv_ocl
_deviceName"
,
deviceInfo
.
deviceName
);
DUMP_
MESSAGE_STDOUT
(
" Name = "
<<
deviceInfo
.
deviceName
);
DUMP_
PROPERTY_XML
(
"cv_ocl_current
_deviceName"
,
deviceInfo
.
deviceName
);
DUMP_
INFO_STDOUT
(
" Version"
,
deviceInfo
.
deviceVersion
);
DUMP_
INFO_XML
(
"cv_ocl
_deviceVersion"
,
deviceInfo
.
deviceVersion
);
DUMP_
MESSAGE_STDOUT
(
" Version = "
<<
deviceInfo
.
deviceVersion
);
DUMP_
PROPERTY_XML
(
"cv_ocl_current
_deviceVersion"
,
deviceInfo
.
deviceVersion
);
DUMP_
INFO_STDOUT
(
" Compute units"
,
deviceInfo
.
maxComputeUnits
);
DUMP_
INFO_XML
(
"cv_ocl
_maxComputeUnits"
,
deviceInfo
.
maxComputeUnits
);
DUMP_
MESSAGE_STDOUT
(
" Compute units = "
<<
deviceInfo
.
maxComputeUnits
);
DUMP_
PROPERTY_XML
(
"cv_ocl_current
_maxComputeUnits"
,
deviceInfo
.
maxComputeUnits
);
DUMP_
INFO_STDOUT
(
" Max work group size"
,
deviceInfo
.
maxWorkGroupSize
);
DUMP_
INFO_XML
(
"cv_ocl
_maxWorkGroupSize"
,
deviceInfo
.
maxWorkGroupSize
);
DUMP_
MESSAGE_STDOUT
(
" Max work group size = "
<<
deviceInfo
.
maxWorkGroupSize
);
DUMP_
PROPERTY_XML
(
"cv_ocl_current
_maxWorkGroupSize"
,
deviceInfo
.
maxWorkGroupSize
);
std
::
string
localMemorySizeStr
=
bytesToStringRepr
(
deviceInfo
.
localMemorySize
);
DUMP_
INFO_STDOUT
(
" Local memory size"
,
localMemorySizeStr
.
c_str
());
DUMP_
INFO_XML
(
"cv_ocl
_localMemorySize"
,
deviceInfo
.
localMemorySize
);
DUMP_
MESSAGE_STDOUT
(
" Local memory size = "
<<
localMemorySizeStr
.
c_str
());
DUMP_
PROPERTY_XML
(
"cv_ocl_current
_localMemorySize"
,
deviceInfo
.
localMemorySize
);
std
::
string
maxMemAllocSizeStr
=
bytesToStringRepr
(
deviceInfo
.
maxMemAllocSize
);
DUMP_
INFO_STDOUT
(
" Max memory allocation size"
,
maxMemAllocSizeStr
.
c_str
());
DUMP_
INFO_XML
(
"cv_ocl
_maxMemAllocSize"
,
deviceInfo
.
maxMemAllocSize
);
DUMP_
MESSAGE_STDOUT
(
" Max memory allocation size = "
<<
maxMemAllocSizeStr
.
c_str
());
DUMP_
PROPERTY_XML
(
"cv_ocl_current
_maxMemAllocSize"
,
deviceInfo
.
maxMemAllocSize
);
const
char
*
doubleSupportStr
=
deviceInfo
.
haveDoubleSupport
?
"Yes"
:
"No"
;
DUMP_
INFO_STDOUT
(
" Double support"
,
doubleSupportStr
);
DUMP_
INFO_XML
(
"cv_ocl
_haveDoubleSupport"
,
deviceInfo
.
haveDoubleSupport
);
DUMP_
MESSAGE_STDOUT
(
" Double support = "
<<
doubleSupportStr
);
DUMP_
PROPERTY_XML
(
"cv_ocl_current
_haveDoubleSupport"
,
deviceInfo
.
haveDoubleSupport
);
const
char
*
isUnifiedMemoryStr
=
deviceInfo
.
isUnifiedMemory
?
"Yes"
:
"No"
;
DUMP_
INFO_STDOUT
(
" Unified memory"
,
isUnifiedMemoryStr
);
DUMP_
INFO_XML
(
"cv_ocl
_isUnifiedMemory"
,
deviceInfo
.
isUnifiedMemory
);
DUMP_
MESSAGE_STDOUT
(
" Unified memory = "
<<
isUnifiedMemoryStr
);
DUMP_
PROPERTY_XML
(
"cv_ocl_current
_isUnifiedMemory"
,
deviceInfo
.
isUnifiedMemory
);
}
catch
(...)
{
DUMP_
INFO_STDOUT
(
"OpenCL device"
,
"
not available"
);
DUMP_
INFO
_XML
(
"cv_ocl"
,
"not available"
);
DUMP_
MESSAGE_STDOUT
(
"OpenCL device
not available"
);
DUMP_
PROPERTY
_XML
(
"cv_ocl"
,
"not available"
);
}
}
#undef DUMP_
INFO
_STDOUT
#undef DUMP_
INFO
_XML
#undef DUMP_
MESSAGE
_STDOUT
#undef DUMP_
PROPERTY
_XML
modules/ocl/perf/main.cpp
View file @
e9edfd1c
...
...
@@ -42,28 +42,19 @@
#include "perf_precomp.hpp"
#define DUMP_
INFO_STDOUT(propertyDispla
yName, propertyValue) \
#define DUMP_
PROPERTY_XML(propert
yName, propertyValue) \
do { \
std::cout << (propertyDisplayName) << ": " << (propertyValue) << std::endl; \
std::stringstream ssName, ssValue;\
ssName << propertyName;\
ssValue << propertyValue; \
::testing::Test::RecordProperty(ssName.str(), ssValue.str()); \
} while (false)
#define DUMP_
INFO_XML(propertyXMLName, propertyValue
) \
#define DUMP_
MESSAGE_STDOUT(msg
) \
do { \
std::stringstream ss; ss << propertyValue; \
::testing::Test::RecordProperty((propertyXMLName), ss.str()); \
std::cout << msg << std::endl; \
} 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"
...
...
modules/ocl/test/main.cpp
View file @
e9edfd1c
...
...
@@ -42,15 +42,17 @@
#include "test_precomp.hpp"
#define DUMP_
INFO_STDOUT(propertyDispla
yName, propertyValue) \
#define DUMP_
PROPERTY_XML(propert
yName, propertyValue) \
do { \
std::cout << (propertyDisplayName) << ": " << (propertyValue) << std::endl; \
std::stringstream ssName, ssValue;\
ssName << propertyName;\
ssValue << propertyValue; \
::testing::Test::RecordProperty(ssName.str(), ssValue.str()); \
} while (false)
#define DUMP_
INFO_XML(propertyXMLName, propertyValue
) \
#define DUMP_
MESSAGE_STDOUT(msg
) \
do { \
std::stringstream ss; ss << propertyValue; \
::testing::Test::RecordProperty((propertyXMLName), ss.str()); \
std::cout << msg << std::endl; \
} while (false)
#include "opencv2/ocl/private/opencl_dumpinfo.hpp"
...
...
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