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
5c3495a0
Commit
5c3495a0
authored
Feb 04, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added perf test for gpu::erode, fixed docs, refactored perf. sample
parent
da6aa774
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
29 deletions
+59
-29
gpu_initialization.tex
doc/gpu_initialization.tex
+2
-2
performance.h
samples/gpu/performance/performance.h
+0
-1
tests.cpp
samples/gpu/performance/tests.cpp
+54
-26
stereo_multi.cpp
samples/gpu/stereo_multi.cpp
+3
-0
No files found.
doc/gpu_initialization.tex
View file @
5c3495a0
...
@@ -113,7 +113,7 @@ Returns true if the device has the given GPU feature, otherwise false.
...
@@ -113,7 +113,7 @@ Returns true if the device has the given GPU feature, otherwise false.
\cvdefCpp
{
bool DeviceInfo::has(GpuFeature feature);
}
\cvdefCpp
{
bool DeviceInfo::has(GpuFeature feature);
}
\begin{description}
\begin{description}
\cvarg
{
feature
}{
Feature to be checked. See
\hyperref
[cpp.gpu.GpuFeature]
{
gpu::GpuFeature
}
.
}
\cvarg
{
feature
}{
Feature to be checked. See
\hyperref
[cpp.gpu.GpuFeature]
{
cv::
gpu::GpuFeature
}
.
}
\end{description}
\end{description}
...
@@ -131,7 +131,7 @@ This class provides functionality (as set of static methods) for checking which
...
@@ -131,7 +131,7 @@ This class provides functionality (as set of static methods) for checking which
The following method checks whether the module was built with the support of the given feature:
The following method checks whether the module was built with the support of the given feature:
\cvdefCpp
{
static bool builtWith(GpuFeature feature);
}
\cvdefCpp
{
static bool builtWith(GpuFeature feature);
}
\begin{description}
\begin{description}
\cvarg
{
feature
}{
Feature to be checked. See
\hyperref
[cpp.gpu.GpuFeature]
{
gpu::GpuFeature
}
.
}
\cvarg
{
feature
}{
Feature to be checked. See
\hyperref
[cpp.gpu.GpuFeature]
{
cv::
gpu::GpuFeature
}
.
}
\end{description}
\end{description}
There are a set of methods for checking whether the module contains intermediate (PTX) or binary GPU code for the given architecture(s):
There are a set of methods for checking whether the module contains intermediate (PTX) or binary GPU code for the given architecture(s):
...
...
samples/gpu/performance/performance.h
View file @
5c3495a0
...
@@ -125,7 +125,6 @@ private:
...
@@ -125,7 +125,6 @@ private:
void
name
##
_test
::
run
()
void
name
##
_test
::
run
()
#define SUBTEST TestSystem::instance().subtest()
#define SUBTEST TestSystem::instance().subtest()
#define DESCRIPTION TestSystem::instance().subtest()
#define CPU_ON TestSystem::instance().cpuOn()
#define CPU_ON TestSystem::instance().cpuOn()
#define GPU_ON TestSystem::instance().gpuOn()
#define GPU_ON TestSystem::instance().gpuOn()
#define CPU_OFF TestSystem::instance().cpuOff()
#define CPU_OFF TestSystem::instance().cpuOff()
...
...
samples/gpu/performance/tests.cpp
View file @
5c3495a0
...
@@ -167,32 +167,32 @@ TEST(cornerHarris)
...
@@ -167,32 +167,32 @@ TEST(cornerHarris)
}
}
//
TEST(integral)
TEST
(
integral
)
//
{
{
//
Mat src, sum;
Mat
src
,
sum
;
//
gpu::GpuMat d_src, d_sum, d_buf;
gpu
::
GpuMat
d_src
,
d_sum
,
d_buf
;
//
//
int size = 4000;
int
size
=
4000
;
//
//
gen(src, size, size, CV_8U, 0, 256);
gen
(
src
,
size
,
size
,
CV_8U
,
0
,
256
);
//
sum.create(size + 1, size + 1, CV_32S);
sum
.
create
(
size
+
1
,
size
+
1
,
CV_32S
);
//
//
d_src = src;
d_src
=
src
;
//
d_sum.create(size + 1, size + 1, CV_32S);
d_sum
.
create
(
size
+
1
,
size
+
1
,
CV_32S
);
//
//
for (int i = 0; i < 5; ++i)
for
(
int
i
=
0
;
i
<
5
;
++
i
)
//
{
{
//
SUBTEST << "size " << size << ", 8U";
SUBTEST
<<
"size "
<<
size
<<
", 8U"
;
//
//
CPU_ON;
CPU_ON
;
//
integral(src, sum);
integral
(
src
,
sum
);
//
CPU_OFF;
CPU_OFF
;
//
//
GPU_ON;
GPU_ON
;
//
gpu::integralBuffered(d_src, d_sum, d_buf);
gpu
::
integralBuffered
(
d_src
,
d_sum
,
d_buf
);
//
GPU_OFF;
GPU_OFF
;
//
}
}
//
}
}
TEST
(
norm
)
TEST
(
norm
)
...
@@ -653,4 +653,31 @@ TEST(cvtColor)
...
@@ -653,4 +653,31 @@ TEST(cvtColor)
cv
::
swap
(
src
,
dst
);
cv
::
swap
(
src
,
dst
);
d_src
.
swap
(
d_dst
);
d_src
.
swap
(
d_dst
);
}
TEST
(
erode
)
{
Mat
src
,
dst
,
ker
;
gpu
::
GpuMat
d_src
,
d_dst
;
for
(
int
size
=
2000
;
size
<=
4000
;
size
+=
1000
)
{
SUBTEST
<<
"size "
<<
size
;
gen
(
src
,
size
,
size
,
CV_8UC4
,
Scalar
::
all
(
0
),
Scalar
::
all
(
256
));
ker
=
getStructuringElement
(
MORPH_RECT
,
Size
(
3
,
3
));
dst
.
create
(
src
.
size
(),
src
.
type
());
CPU_ON
;
erode
(
src
,
dst
,
ker
);
CPU_OFF
;
d_src
=
src
;
d_dst
.
create
(
d_src
.
size
(),
d_src
.
type
());
GPU_ON
;
gpu
::
erode
(
d_src
,
d_dst
,
ker
);
GPU_OFF
;
}
}
}
\ No newline at end of file
samples/gpu/stereo_multi.cpp
View file @
5c3495a0
...
@@ -60,10 +60,13 @@ void inline contextOff()
...
@@ -60,10 +60,13 @@ void inline contextOff()
safeCall
(
cuCtxPopCurrent
(
&
prev_context
));
safeCall
(
cuCtxPopCurrent
(
&
prev_context
));
}
}
// GPUs data
GpuMat
d_left
[
2
];
GpuMat
d_left
[
2
];
GpuMat
d_right
[
2
];
GpuMat
d_right
[
2
];
StereoBM_GPU
*
bm
[
2
];
StereoBM_GPU
*
bm
[
2
];
GpuMat
d_result
[
2
];
GpuMat
d_result
[
2
];
// CPU result
Mat
result
;
Mat
result
;
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
...
...
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