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
10f10044
Commit
10f10044
authored
Oct 09, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move GPU utiluty functions in utility.cpp
parent
a9ab26f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
67 deletions
+71
-67
perf_main.cpp
modules/gpu/perf/perf_main.cpp
+2
-67
utility.cpp
modules/gpu/perf/utility.cpp
+65
-0
utility.hpp
modules/gpu/perf/utility.hpp
+4
-0
No files found.
modules/gpu/perf/perf_main.cpp
View file @
10f10044
...
...
@@ -6,71 +6,6 @@ using namespace cv::gpu;
using
namespace
cvtest
;
using
namespace
testing
;
void
printOsInfo
()
{
#if defined _WIN32
# if defined _WIN64
cout
<<
"OS: Windows x64
\n
"
<<
endl
;
# else
cout
<<
"OS: Windows x32
\n
"
<<
endl
;
# endif
#elif defined linux
# if defined _LP64
cout
<<
"OS: Linux x64
\n
"
<<
endl
;
# else
cout
<<
"OS: Linux x32
\n
"
<<
endl
;
# endif
#elif defined __APPLE__
# if defined _LP64
cout
<<
"OS: Apple x64
\n
"
<<
endl
;
# else
cout
<<
"OS: Apple x32
\n
"
<<
endl
;
# endif
#endif
}
void
printCudaInfo
()
{
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
cout
<<
"OpenCV was built without CUDA support
\n
"
<<
endl
;
#else
int
driver
;
cudaDriverGetVersion
(
&
driver
);
cout
<<
"CUDA Driver version: "
<<
driver
<<
'\n'
;
cout
<<
"CUDA Runtime version: "
<<
CUDART_VERSION
<<
'\n'
;
cout
<<
endl
;
cout
<<
"GPU module was compiled for the following GPU archs:"
<<
endl
;
cout
<<
" BIN: "
<<
CUDA_ARCH_BIN
<<
'\n'
;
cout
<<
" PTX: "
<<
CUDA_ARCH_PTX
<<
'\n'
;
cout
<<
endl
;
int
deviceCount
=
getCudaEnabledDeviceCount
();
cout
<<
"CUDA device count: "
<<
deviceCount
<<
'\n'
;
cout
<<
endl
;
for
(
int
i
=
0
;
i
<
deviceCount
;
++
i
)
{
DeviceInfo
info
(
i
);
cout
<<
"Device ["
<<
i
<<
"]
\n
"
;
cout
<<
"
\t
Name: "
<<
info
.
name
()
<<
'\n'
;
cout
<<
"
\t
Compute capability: "
<<
info
.
majorVersion
()
<<
'.'
<<
info
.
minorVersion
()
<<
'\n'
;
cout
<<
"
\t
Multi Processor Count: "
<<
info
.
multiProcessorCount
()
<<
'\n'
;
cout
<<
"
\t
Total memory: "
<<
static_cast
<
int
>
(
static_cast
<
int
>
(
info
.
totalMemory
()
/
1024.0
)
/
1024.0
)
<<
" Mb
\n
"
;
cout
<<
"
\t
Free memory: "
<<
static_cast
<
int
>
(
static_cast
<
int
>
(
info
.
freeMemory
()
/
1024.0
)
/
1024.0
)
<<
" Mb
\n
"
;
if
(
!
info
.
isCompatible
())
cout
<<
"
\t
!!! This device is NOT compatible with current GPU module build
\n
"
;
cout
<<
endl
;
}
#endif
}
int
main
(
int
argc
,
char
**
argv
)
{
const
std
::
string
keys
=
...
...
@@ -88,8 +23,8 @@ int main(int argc, char** argv)
return
0
;
}
printOsInfo
();
printCudaInfo
();
ts
::
printOsInfo
();
ts
::
printCudaInfo
();
if
(
cmd
.
has
(
"info"
))
...
...
modules/gpu/perf/utility.cpp
View file @
10f10044
...
...
@@ -191,3 +191,68 @@ void PrintTo(const CvtColorInfo& info, ostream* os)
*
os
<<
str
[
info
.
code
];
}
void
ts
::
printOsInfo
()
{
#if defined _WIN32
# if defined _WIN64
cout
<<
"OS: Windows x64
\n
"
<<
endl
;
# else
cout
<<
"OS: Windows x32
\n
"
<<
endl
;
# endif
#elif defined linux
# if defined _LP64
cout
<<
"OS: Linux x64
\n
"
<<
endl
;
# else
cout
<<
"OS: Linux x32
\n
"
<<
endl
;
# endif
#elif defined __APPLE__
# if defined _LP64
cout
<<
"OS: Apple x64
\n
"
<<
endl
;
# else
cout
<<
"OS: Apple x32
\n
"
<<
endl
;
# endif
#endif
}
void
ts
::
printCudaInfo
()
{
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
cout
<<
"OpenCV was built without CUDA support
\n
"
<<
endl
;
#else
int
driver
;
cudaDriverGetVersion
(
&
driver
);
cout
<<
"CUDA Driver version: "
<<
driver
<<
'\n'
;
cout
<<
"CUDA Runtime version: "
<<
CUDART_VERSION
<<
'\n'
;
cout
<<
endl
;
cout
<<
"GPU module was compiled for the following GPU archs:"
<<
endl
;
cout
<<
" BIN: "
<<
CUDA_ARCH_BIN
<<
'\n'
;
cout
<<
" PTX: "
<<
CUDA_ARCH_PTX
<<
'\n'
;
cout
<<
endl
;
int
deviceCount
=
getCudaEnabledDeviceCount
();
cout
<<
"CUDA device count: "
<<
deviceCount
<<
'\n'
;
cout
<<
endl
;
for
(
int
i
=
0
;
i
<
deviceCount
;
++
i
)
{
DeviceInfo
info
(
i
);
cout
<<
"Device ["
<<
i
<<
"]
\n
"
;
cout
<<
"
\t
Name: "
<<
info
.
name
()
<<
'\n'
;
cout
<<
"
\t
Compute capability: "
<<
info
.
majorVersion
()
<<
'.'
<<
info
.
minorVersion
()
<<
'\n'
;
cout
<<
"
\t
Multi Processor Count: "
<<
info
.
multiProcessorCount
()
<<
'\n'
;
cout
<<
"
\t
Total memory: "
<<
static_cast
<
int
>
(
static_cast
<
int
>
(
info
.
totalMemory
()
/
1024.0
)
/
1024.0
)
<<
" Mb
\n
"
;
cout
<<
"
\t
Free memory: "
<<
static_cast
<
int
>
(
static_cast
<
int
>
(
info
.
freeMemory
()
/
1024.0
)
/
1024.0
)
<<
" Mb
\n
"
;
if
(
!
info
.
isCompatible
())
cout
<<
"
\t
!!! This device is NOT compatible with current GPU module build
\n
"
;
cout
<<
endl
;
}
#endif
}
modules/gpu/perf/utility.hpp
View file @
10f10044
...
...
@@ -48,5 +48,9 @@ DEF_PARAM_TEST(Sz_Depth_Cn, cv::Size, MatDepth, MatCn);
#define GPU_TYPICAL_MAT_SIZES testing::Values(perf::sz720p, perf::szSXGA, perf::sz1080p)
namespace
ts
{
void
printOsInfo
();
void
printCudaInfo
();
}
#endif // __OPENCV_PERF_GPU_UTILITY_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