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
be22891f
Commit
be22891f
authored
Dec 25, 2012
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added GPU_PERF_TESTP_P but haven't switched test to it (only perf4au app)
parent
3882bbbf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
36 deletions
+50
-36
main.cpp
modules/gpu/app/nv_perf_test/main.cpp
+30
-31
optflowbm.cu
modules/gpu/src/cuda/optflowbm.cu
+5
-5
ts_perf.hpp
modules/ts/include/opencv2/ts/ts_perf.hpp
+15
-0
No files found.
modules/gpu/app/nv_perf_test/main.cpp
View file @
be22891f
...
...
@@ -75,8 +75,7 @@ int main(int argc, char* argv[])
DEF_PARAM_TEST_1
(
Image
,
std
::
string
);
PERF_TEST_P
(
Image
,
HoughLinesP
,
testing
::
Values
(
std
::
string
(
"im1_1280x800.jpg"
)))
GPU_PERF_TEST_P
(
Image
,
HoughLinesP
,
testing
::
Values
(
std
::
string
(
"im1_1280x800.jpg"
)))
{
declare
.
time
(
30.0
);
...
...
@@ -125,8 +124,8 @@ PERF_TEST_P(Image, HoughLinesP,
DEF_PARAM_TEST
(
Image_Depth
,
std
::
string
,
perf
::
MatDepth
);
PERF_TEST_P
(
Image_Depth
,
GoodFeaturesToTrack
,
testing
::
Combine
(
GPU_
PERF_TEST_P
(
Image_Depth
,
GoodFeaturesToTrack
,
testing
::
Combine
(
testing
::
Values
(
std
::
string
(
"im1_1280x800.jpg"
)),
testing
::
Values
(
CV_8U
,
CV_16U
)
))
...
...
@@ -193,12 +192,12 @@ typedef std::pair<std::string, std::string> string_pair;
DEF_PARAM_TEST
(
ImagePair_Depth_GraySource
,
string_pair
,
perf
::
MatDepth
,
bool
);
PERF_TEST_P
(
ImagePair_Depth_GraySource
,
OpticalFlowPyrLKSparse
,
testing
::
Combine
(
testing
::
Values
(
string_pair
(
"im1_1280x800.jpg"
,
"im2_1280x800.jpg"
)),
testing
::
Values
(
CV_8U
,
CV_16U
),
testing
::
Bool
()
))
GPU_
PERF_TEST_P
(
ImagePair_Depth_GraySource
,
OpticalFlowPyrLKSparse
,
testing
::
Combine
(
testing
::
Values
(
string_pair
(
"im1_1280x800.jpg"
,
"im2_1280x800.jpg"
)),
testing
::
Values
(
CV_8U
,
CV_16U
),
testing
::
Bool
()
))
{
declare
.
time
(
60
);
...
...
@@ -287,11 +286,11 @@ PERF_TEST_P(ImagePair_Depth_GraySource, OpticalFlowPyrLKSparse,
DEF_PARAM_TEST
(
ImagePair_Depth
,
string_pair
,
perf
::
MatDepth
);
PERF_TEST_P
(
ImagePair_Depth
,
OpticalFlowFarneback
,
testing
::
Combine
(
testing
::
Values
(
string_pair
(
"im1_1280x800.jpg"
,
"im2_1280x800.jpg"
)),
testing
::
Values
(
CV_8U
,
CV_16U
)
))
GPU_
PERF_TEST_P
(
ImagePair_Depth
,
OpticalFlowFarneback
,
testing
::
Combine
(
testing
::
Values
(
string_pair
(
"im1_1280x800.jpg"
,
"im2_1280x800.jpg"
)),
testing
::
Values
(
CV_8U
,
CV_16U
)
))
{
declare
.
time
(
500
);
...
...
@@ -384,15 +383,15 @@ void calcOpticalFlowBM(const cv::Mat& prev, const cv::Mat& curr,
DEF_PARAM_TEST
(
ImagePair_BlockSize_ShiftSize_MaxRange
,
string_pair
,
cv
::
Size
,
cv
::
Size
,
cv
::
Size
);
PERF_TEST_P
(
ImagePair_BlockSize_ShiftSize_MaxRange
,
OpticalFlowBM
,
testing
::
Combine
(
testing
::
Values
(
string_pair
(
"im1_1280x800.jpg"
,
"im2_1280x800.jpg"
)),
testing
::
Values
(
cv
::
Size
(
16
,
16
)),
testing
::
Values
(
cv
::
Size
(
2
,
2
)),
testing
::
Values
(
cv
::
Size
(
16
,
16
))
))
GPU_
PERF_TEST_P
(
ImagePair_BlockSize_ShiftSize_MaxRange
,
OpticalFlowBM
,
testing
::
Combine
(
testing
::
Values
(
string_pair
(
"im1_1280x800.jpg"
,
"im2_1280x800.jpg"
)),
testing
::
Values
(
cv
::
Size
(
16
,
16
)),
testing
::
Values
(
cv
::
Size
(
2
,
2
)),
testing
::
Values
(
cv
::
Size
(
16
,
16
))
))
{
declare
.
time
(
1
000
);
declare
.
time
(
3
000
);
const
string_pair
fileNames
=
std
::
tr1
::
get
<
0
>
(
GetParam
());
const
cv
::
Size
block_size
=
std
::
tr1
::
get
<
1
>
(
GetParam
());
...
...
@@ -435,15 +434,15 @@ PERF_TEST_P(ImagePair_BlockSize_ShiftSize_MaxRange, OpticalFlowBM,
SANITY_CHECK
(
0
);
}
PERF_TEST_P
(
ImagePair_BlockSize_ShiftSize_MaxRange
,
FastOpticalFlowBM
,
testing
::
Combine
(
testing
::
Values
(
string_pair
(
"im1_1280x800.jpg"
,
"im2_1280x800.jpg"
)),
testing
::
Values
(
cv
::
Size
(
16
,
16
)),
testing
::
Values
(
cv
::
Size
(
1
,
1
)),
testing
::
Values
(
cv
::
Size
(
16
,
16
))
))
GPU_
PERF_TEST_P
(
ImagePair_BlockSize_ShiftSize_MaxRange
,
FastOpticalFlowBM
,
testing
::
Combine
(
testing
::
Values
(
string_pair
(
"im1_1280x800.jpg"
,
"im2_1280x800.jpg"
)),
testing
::
Values
(
cv
::
Size
(
16
,
16
)),
testing
::
Values
(
cv
::
Size
(
1
,
1
)),
testing
::
Values
(
cv
::
Size
(
16
,
16
))
))
{
declare
.
time
(
1
000
);
declare
.
time
(
3
000
);
const
string_pair
fileNames
=
std
::
tr1
::
get
<
0
>
(
GetParam
());
const
cv
::
Size
block_size
=
std
::
tr1
::
get
<
1
>
(
GetParam
());
...
...
modules/gpu/src/cuda/optflowbm.cu
View file @
be22891f
...
...
@@ -210,7 +210,7 @@ namespace optflowbm_fast
{
}
__device__ void initSums_BruteForce(int i, int j, int* dist_sums, PtrStepi& col_sums, PtrStepi& up_col_sums) const
__device__
__forceinline__
void initSums_BruteForce(int i, int j, int* dist_sums, PtrStepi& col_sums, PtrStepi& up_col_sums) const
{
for (int index = threadIdx.x; index < search_window * search_window; index += STRIDE)
{
...
...
@@ -246,7 +246,7 @@ namespace optflowbm_fast
}
}
__device__ void shiftRight_FirstRow(int i, int j, int first, int* dist_sums, PtrStepi& col_sums, PtrStepi& up_col_sums) const
__device__
__forceinline__
void shiftRight_FirstRow(int i, int j, int first, int* dist_sums, PtrStepi& col_sums, PtrStepi& up_col_sums) const
{
for (int index = threadIdx.x; index < search_window * search_window; index += STRIDE)
{
...
...
@@ -271,7 +271,7 @@ namespace optflowbm_fast
}
}
__device__ void shiftRight_UpSums(int i, int j, int first, int* dist_sums, PtrStepi& col_sums, PtrStepi& up_col_sums) const
__device__
__forceinline__
void shiftRight_UpSums(int i, int j, int first, int* dist_sums, PtrStepi& col_sums, PtrStepi& up_col_sums) const
{
int ay = i;
int ax = j + block_radius;
...
...
@@ -298,7 +298,7 @@ namespace optflowbm_fast
}
}
__device__ void convolve_window(int i, int j, const int* dist_sums, float& velx, float& vely) const
__device__
__forceinline__
void convolve_window(int i, int j, const int* dist_sums, float& velx, float& vely) const
{
int bestDist = numeric_limits<int>::max();
int bestInd = -1;
...
...
@@ -328,7 +328,7 @@ namespace optflowbm_fast
}
}
__device__ void operator()(PtrStepf velx, PtrStepf vely) const
__device__
__forceinline__
void operator()(PtrStepf velx, PtrStepf vely) const
{
int tbx = blockIdx.x * TILE_COLS;
int tby = blockIdx.y * TILE_ROWS;
...
...
modules/ts/include/opencv2/ts/ts_perf.hpp
View file @
be22891f
...
...
@@ -474,6 +474,21 @@ CV_EXPORTS void PrintTo(const Size& sz, ::std::ostream* os);
INSTANTIATE_TEST_CASE_P(
/*none*/
, fixture##_##name, params);\
void fixture##_##name::PerfTestBody()
#define GPU_PERF_TEST_P(fixture, name, params) \
class fixture##_##name : public fixture {\
public:\
fixture##_##name() {}\
protected:\
virtual void PerfTestBody();\
};\
TEST_P(fixture##_##name, name
/*perf*/
) \
{ \
try { RunPerfTestBody(); } \
catch (...) { cv::gpu::resetDevice(); throw; } \
} \
INSTANTIATE_TEST_CASE_P(
/*none*/
, fixture##_##name, params);\
void fixture##_##name::PerfTestBody()
#define CV_PERF_TEST_MAIN(testsuitname, ...) \
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