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
e1dd41d1
Commit
e1dd41d1
authored
Jul 08, 2011
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed SetTo tests for GPU (a problem in test code)
- minor refactoring
parent
0b1575c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
21 deletions
+22
-21
test_main.cpp
modules/gpu/test/test_main.cpp
+18
-19
test_matop.cpp
modules/gpu/test/test_matop.cpp
+4
-2
No files found.
modules/gpu/test/test_main.cpp
View file @
e1dd41d1
...
...
@@ -46,50 +46,49 @@
void
print_info
()
{
printf
(
"
\n
"
);
#if defined _WIN32
# if defined _WIN64
puts
(
"OS: Windows 64
\n
"
);
puts
(
"OS: Windows 64"
);
# else
puts
(
"OS: Windows 32
\n
"
);
puts
(
"OS: Windows 32"
);
# endif
#elif defined linux
# if defined _LP64
puts
(
"OS: Linux 64
\n
"
);
puts
(
"OS: Linux 64"
);
# else
puts
(
"OS: Linux 32
\n
"
);
puts
(
"OS: Linux 32"
);
# endif
#elif defined __APPLE__
# if defined _LP64
puts
(
"OS: Apple 64
\n
"
);
puts
(
"OS: Apple 64"
);
# else
puts
(
"OS: Apple 32
\n
"
);
puts
(
"OS: Apple 32"
);
# endif
#endif
printf
(
"CUDA version: %d
\n\n
"
,
CUDART_VERSION
);
int
deviceCount
=
cv
::
gpu
::
getCudaEnabledDeviceCount
();
printf
(
"
Found %d CUDA devices
\n\n
"
,
deviceCount
);
printf
(
"CUDA version: %d
\n
"
,
CUDART_VERSION
);
printf
(
"
CUDA device count: %d
\n\n
"
,
deviceCount
);
for
(
int
i
=
0
;
i
<
deviceCount
;
++
i
)
{
cv
::
gpu
::
DeviceInfo
info
(
i
);
printf
(
"Device %d:
\n
"
,
i
);
printf
(
"
\t
Name: %s
\n
"
,
info
.
name
().
c_str
());
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
Free
memory: %d Mb
\n
"
,
static_cast
<
int
>
(
static_cast
<
int
>
(
info
.
freeMemory
()
/
1024.0
)
/
1024.0
));
printf
(
"
Name: %s
\n
"
,
info
.
name
().
c_str
());
printf
(
"
Compute capability version: %d.%d
\n
"
,
info
.
majorVersion
(),
info
.
minorVersion
());
printf
(
"
Total memory: %d Mb
\n
"
,
static_cast
<
int
>
(
static_cast
<
int
>
(
info
.
totalMemory
()
/
1024.0
)
/
1024.0
));
printf
(
"
Free
memory: %d Mb
\n
"
,
static_cast
<
int
>
(
static_cast
<
int
>
(
info
.
freeMemory
()
/
1024.0
)
/
1024.0
));
if
(
info
.
isCompatible
())
puts
(
"
\t
This device is compatible with current GPU module build
\n
"
);
puts
(
"
This device is compatible with current GPU module build
\n
"
);
else
puts
(
"
\t
This device is NOT compatible with current GPU module build
\n
"
);
puts
(
"
This device is NOT compatible with current GPU module build
\n
"
);
}
puts
(
"GPU module was compiled for
next
GPU archs:"
);
printf
(
"
\t
BIN:
%s
\n
"
,
CUDA_ARCH_BIN
);
printf
(
"
\t
PTX:
%s
\n\n
"
,
CUDA_ARCH_PTX
);
puts
(
"GPU module was compiled for
the following
GPU archs:"
);
printf
(
"
BIN:
%s
\n
"
,
CUDA_ARCH_BIN
);
printf
(
"
PTX:
%s
\n\n
"
,
CUDA_ARCH_PTX
);
}
enum
OutputLevel
...
...
modules/gpu/test/test_matop.cpp
View file @
e1dd41d1
...
...
@@ -337,9 +337,11 @@ TEST_P(SetTo, Masked)
static
cv
::
Scalar
s
=
cv
::
Scalar
(
1
,
2
,
3
,
4
);
cv
::
Mat
mat
;
cv
::
RNG
&
rng
=
cvtest
::
TS
::
ptr
()
->
get_rng
();
cv
::
Mat
mask
=
cvtest
::
randomMat
(
rng
,
mat
.
size
(),
CV_8UC1
,
0.0
,
1.5
,
false
);
cv
::
Mat
mask
=
cvtest
::
randomMat
(
rng
,
mat_gold
.
size
(),
CV_8UC1
,
0.0
,
1.5
,
false
);
cv
::
Mat
mat
;
ASSERT_NO_THROW
(
cv
::
gpu
::
GpuMat
dev_mat
(
mat_gold
);
...
...
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