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
52bdfbc7
Commit
52bdfbc7
authored
Jun 29, 2011
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added OS info to gpu tests
parent
e8d2dd21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
7 deletions
+28
-7
test_main.cpp
modules/gpu/test/test_main.cpp
+28
-7
No files found.
modules/gpu/test/test_main.cpp
View file @
52bdfbc7
...
@@ -44,9 +44,30 @@
...
@@ -44,9 +44,30 @@
#ifdef HAVE_CUDA
#ifdef HAVE_CUDA
void
print_info
()
void
print_info
()
{
{
#if defined _WIN32
# if define _WIN64
puts
(
"OS: Windows 64
\n
"
);
# else
puts
(
"OS: Windows 32
\n
"
);
# endif
#elif defined linux
# if defined _LP64
puts
(
"OS: Linux 64
\n
"
);
# else
puts
(
"OS: Linux 32
\n
"
);
# endif
#elif defined __APPLE__
# if defined _LP64
puts
(
"OS: Apple 64
\n
"
);
# else
puts
(
"OS: Apple 32
\n
"
);
# endif
#endif
int
deviceCount
=
cv
::
gpu
::
getCudaEnabledDeviceCount
();
int
deviceCount
=
cv
::
gpu
::
getCudaEnabledDeviceCount
();
printf
(
"Found %d CUDA devices
\n\n
"
,
deviceCount
);
printf
(
"Found %d CUDA devices
\n\n
"
,
deviceCount
);
for
(
int
i
=
0
;
i
<
deviceCount
;
++
i
)
for
(
int
i
=
0
;
i
<
deviceCount
;
++
i
)
...
@@ -57,12 +78,13 @@ void print_info()
...
@@ -57,12 +78,13 @@ void print_info()
printf
(
"
\t
Compute capability version: %d.%d
\n
"
,
info
.
majorVersion
(),
info
.
minorVersion
());
printf
(
"
\t
Compute capability version: %d.%d
\n
"
,
info
.
majorVersion
(),
info
.
minorVersion
());
printf
(
"
\t
Total memory: %d Mb
\n
"
,
static_cast
<
int
>
(
static_cast
<
int
>
(
info
.
totalMemory
()
/
1024.0
)
/
1024.0
));
printf
(
"
\t
Total memory: %d Mb
\n
"
,
static_cast
<
int
>
(
static_cast
<
int
>
(
info
.
totalMemory
()
/
1024.0
)
/
1024.0
));
printf
(
"
\t
Free memory: %d Mb
\n
"
,
static_cast
<
int
>
(
static_cast
<
int
>
(
info
.
freeMemory
()
/
1024.0
)
/
1024.0
));
printf
(
"
\t
Free memory: %d Mb
\n
"
,
static_cast
<
int
>
(
static_cast
<
int
>
(
info
.
freeMemory
()
/
1024.0
)
/
1024.0
));
if
(
!
info
.
isCompatible
())
if
(
info
.
isCompatible
())
printf
(
"
\t
This device is not compatible with current GPU module build
\n
"
);
puts
(
"
\t
This device is compatible with current GPU module build
\n
"
);
printf
(
"
\n
"
);
else
puts
(
"
\t
This device is NOT compatible with current GPU module build
\n
"
);
}
}
p
rintf
(
"GPU module was compiled for next GPU archs:
\n
"
);
p
uts
(
"GPU module was compiled for next GPU archs:
"
);
printf
(
"
\t
BIN:%s
\n
"
,
CUDA_ARCH_BIN
);
printf
(
"
\t
BIN:%s
\n
"
,
CUDA_ARCH_BIN
);
printf
(
"
\t
PTX:%s
\n\n
"
,
CUDA_ARCH_PTX
);
printf
(
"
\t
PTX:%s
\n\n
"
,
CUDA_ARCH_PTX
);
}
}
...
@@ -104,4 +126,4 @@ int main(int argc, char** argv)
...
@@ -104,4 +126,4 @@ int main(int argc, char** argv)
return
0
;
return
0
;
}
}
#endif // HAVE_CUDA
#endif // HAVE_CUDA
\ No newline at end of file
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