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
3aa53764
Commit
3aa53764
authored
Jan 11, 2012
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor refactoring of gpu performance sample
parent
4f44d9ea
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
21 deletions
+34
-21
performance.cpp
samples/gpu/performance/performance.cpp
+34
-21
tests.cpp
samples/gpu/performance/tests.cpp
+0
-0
No files found.
samples/gpu/performance/performance.cpp
View file @
3aa53764
...
...
@@ -12,6 +12,7 @@ void TestSystem::run()
{
for
(
vector
<
Runnable
*>::
iterator
it
=
tests_
.
begin
();
it
!=
tests_
.
end
();
++
it
)
cout
<<
(
*
it
)
->
name
()
<<
endl
;
return
;
}
...
...
@@ -142,31 +143,43 @@ int CV_CDECL cvErrorCallback(int /*status*/, const char* /*func_name*/,
}
int
main
(
int
argc
,
c
har
**
argv
)
int
main
(
int
argc
,
c
onst
char
*
argv
[]
)
{
// Parse command line arguments
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
redirectError
(
cvErrorCallback
);
const
char
*
keys
=
"{ h | help | false | print help message }"
"{ f | filter | | filter for test }"
"{ w | workdir | | set working directory }"
"{ l | list | false | show all tests }"
;
CommandLineParser
cmd
(
argc
,
argv
,
keys
);
if
(
cmd
.
get
<
bool
>
(
"help"
))
{
string
key
=
argv
[
i
];
if
(
key
==
"--help"
)
{
cout
<<
"Usage: performance_gpu [--ls] [--filter <test_filter>] [--workdir <working_dir_with_slash>]
\n
"
;
return
0
;
}
if
(
key
==
"--filter"
&&
i
+
1
<
argc
)
TestSystem
::
instance
().
setTestFilter
(
argv
[
++
i
]);
else
if
(
key
==
"--workdir"
&&
i
+
1
<
argc
)
TestSystem
::
instance
().
setWorkingDir
(
argv
[
++
i
]);
else
if
(
key
==
"--ls"
)
TestSystem
::
instance
().
setListMode
(
true
);
else
{
cout
<<
"Unknown parameter: '"
<<
key
<<
"'"
<<
endl
;
return
-
1
;
}
cout
<<
"Avaible options:"
<<
endl
;
cmd
.
printParams
();
return
0
;
}
redirectError
(
cvErrorCallback
);
string
filter
=
cmd
.
get
<
string
>
(
"filter"
);
string
workdir
=
cmd
.
get
<
string
>
(
"workdir"
);
bool
list
=
cmd
.
get
<
bool
>
(
"list"
);
if
(
!
filter
.
empty
())
TestSystem
::
instance
().
setTestFilter
(
filter
);
if
(
!
workdir
.
empty
())
{
if
(
workdir
[
workdir
.
size
()
-
1
]
!=
'/'
&&
workdir
[
workdir
.
size
()
-
1
]
!=
'\\'
)
workdir
+=
'/'
;
TestSystem
::
instance
().
setWorkingDir
(
workdir
);
}
if
(
list
)
TestSystem
::
instance
().
setListMode
(
true
);
TestSystem
::
instance
().
run
();
return
0
;
...
...
samples/gpu/performance/tests.cpp
View file @
3aa53764
This diff is collapsed.
Click to expand it.
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