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
660d23aa
Commit
660d23aa
authored
Dec 19, 2012
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added cv::gpu::resetDevice to RunPerfTestBody
parent
1a76242d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
+14
-11
perf_softcascade.cpp
modules/gpu/perf/perf_softcascade.cpp
+5
-10
ts.hpp
modules/ts/include/opencv2/ts/ts.hpp
+1
-1
ts_perf.cpp
modules/ts/src/ts_perf.cpp
+8
-0
No files found.
modules/gpu/perf/perf_softcascade.cpp
View file @
660d23aa
...
...
@@ -9,9 +9,9 @@
virtual void __gpu();\
virtual void PerfTestBody();\
};\
TEST_P(fixture##_##name, name
/*perf*/
){ RunPerfTestBody();
if (PERF_RUN_GPU()) __gpu(); else __cpu();
}\
TEST_P(fixture##_##name, name
/*perf*/
){ RunPerfTestBody(); }\
INSTANTIATE_TEST_CASE_P(
/*none*/
, fixture##_##name, params);\
void fixture##_##name::PerfTestBody()
void fixture##_##name::PerfTestBody()
{ if (PERF_RUN_GPU()) __gpu(); else __cpu(); }
#define RUN_CPU(fixture, name)\
void fixture##_##name::__cpu()
...
...
@@ -56,7 +56,6 @@ GPU_PERF_TEST_P(SCascadeTest, detect,
testing
::
Combine
(
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml"
)),
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/bahnhof/image_00000000_0.png"
))))
{
}
RUN_GPU
(
SCascadeTest
,
detect
)
{
...
...
@@ -114,7 +113,6 @@ GPU_PERF_TEST_P(SCascadeTestRoi, detectInRoi,
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml"
)),
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/bahnhof/image_00000000_0.png"
)),
testing
::
Range
(
0
,
5
)))
{}
RUN_GPU
(
SCascadeTestRoi
,
detectInRoi
)
{
...
...
@@ -159,7 +157,6 @@ GPU_PERF_TEST_P(SCascadeTestRoi, detectEachRoi,
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml"
)),
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/bahnhof/image_00000000_0.png"
)),
testing
::
Range
(
0
,
10
)))
{}
RUN_GPU
(
SCascadeTestRoi
,
detectEachRoi
)
{
...
...
@@ -198,14 +195,13 @@ GPU_PERF_TEST_P(SCascadeTest, detectOnIntegral,
testing
::
Combine
(
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml"
)),
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/integrals.xml"
))))
{
}
static
std
::
string
itoa
(
long
i
)
{
static
std
::
string
itoa
(
long
i
)
{
static
char
s
[
65
];
sprintf
(
s
,
"%ld"
,
i
);
return
std
::
string
(
s
);
}
}
RUN_GPU
(
SCascadeTest
,
detectOnIntegral
)
{
...
...
@@ -247,7 +243,6 @@ GPU_PERF_TEST_P(SCascadeTest, detectStream,
testing
::
Combine
(
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml"
)),
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/bahnhof/image_00000000_0.png"
))))
{
}
RUN_GPU
(
SCascadeTest
,
detectStream
)
{
...
...
modules/ts/include/opencv2/ts/ts.hpp
View file @
660d23aa
#ifndef __OPENCV_GTESTCV_HPP__
#define __OPENCV_GTESTCV_HPP__
#if HAVE_CVCONFIG_H
#if
def
HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
#ifndef GTEST_CREATE_SHARED_LIBRARY
...
...
modules/ts/src/ts_perf.cpp
View file @
660d23aa
#include "precomp.hpp"
#ifdef HAVE_CUDA
#include "opencv2/core/gpumat.hpp"
#endif
#ifdef ANDROID
# include <sys/time.h>
#endif
...
...
@@ -1145,6 +1149,10 @@ void TestBase::RunPerfTestBody()
catch
(
cv
::
Exception
e
)
{
metrics
.
terminationReason
=
performance_metrics
::
TERM_EXCEPTION
;
#ifdef HAVE_CUDA
if
(
e
.
code
==
CV_GpuApiCallError
)
cv
::
gpu
::
resetDevice
();
#endif
FAIL
()
<<
"Expected: PerfTestBody() doesn't throw an exception.
\n
Actual: it throws:
\n
"
<<
e
.
what
();
}
catch
(...)
...
...
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