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
58101835
Commit
58101835
authored
Jan 24, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring of gpu perf. tests
parent
b9ed1489
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
+9
-18
performance.cpp
samples/gpu/performance/performance.cpp
+1
-12
performance.h
samples/gpu/performance/performance.h
+8
-6
No files found.
samples/gpu/performance/performance.cpp
View file @
58101835
...
...
@@ -4,20 +4,9 @@
using
namespace
std
;
using
namespace
cv
;
void
Test
::
gen
(
Mat
&
mat
,
int
rows
,
int
cols
,
int
type
,
Scalar
low
,
Scalar
high
)
{
mat
.
create
(
rows
,
cols
,
type
);
RNG
rng
(
0
);
rng
.
fill
(
mat
,
RNG
::
UNIFORM
,
low
,
high
);
}
void
Test
::
gen
(
Mat
&
mat
,
int
rows
,
int
cols
,
int
type
)
{
mat
.
create
(
rows
,
cols
,
type
);
Mat
mat8u
(
rows
,
cols
*
mat
.
elemSize
(),
CV_8U
,
mat
.
data
,
mat
.
step
);
RNG
rng
(
0
);
...
...
@@ -35,7 +24,6 @@ void TestSystem::run()
vector
<
Test
*>::
iterator
it
=
tests_
.
begin
();
for
(;
it
!=
tests_
.
end
();
++
it
)
{
can_flush_
=
false
;
Test
*
test
=
*
it
;
cout
<<
endl
<<
test
->
name
()
<<
":
\n
"
;
...
...
@@ -82,6 +70,7 @@ void TestSystem::flush()
description_
.
str
(
""
);
cout
<<
resetiosflags
(
ios_base
::
fixed
|
ios_base
::
left
)
<<
endl
;
can_flush_
=
false
;
}
...
...
samples/gpu/performance/performance.h
View file @
58101835
#ifndef OPENCV_GPU_SAMPLE_PERFORMANCE_H_
#define OPENCV_GPU_SAMPLE_PERFORMANCE_H_
#include <iostream>
#include <cstdio>
#include <vector>
...
...
@@ -7,13 +10,10 @@
class
Test
{
public
:
Test
(
const
std
::
string
&
name
)
:
name_
(
name
)
{}
explicit
Test
(
const
std
::
string
&
name
)
:
name_
(
name
)
{}
const
std
::
string
&
name
()
const
{
return
name_
;
}
void
gen
(
cv
::
Mat
&
mat
,
int
rows
,
int
cols
,
int
type
,
cv
::
Scalar
low
,
cv
::
Scalar
high
);
void
gen
(
cv
::
Mat
&
mat
,
int
rows
,
int
cols
,
int
type
);
virtual
void
run
()
=
0
;
...
...
@@ -96,4 +96,6 @@ private:
#define CPU_OFF TestSystem::instance()->cpuOff()
#define GPU_OFF TestSystem::instance()->gpuOff()
#define SUBTEST TestSystem::instance()->subtest()
#define DESCRIPTION TestSystem::instance()->subtest()
\ No newline at end of file
#define DESCRIPTION TestSystem::instance()->subtest()
#endif // OPENCV_GPU_SAMPLE_PERFORMANCE_H_
\ 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