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
d7c22343
Commit
d7c22343
authored
Dec 13, 2013
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added perf tests for T-API core functions
parent
06e981f1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
31 deletions
+36
-31
perf_arithm.cpp
modules/core/perf/opencl/perf_arithm.cpp
+0
-0
ocl_perf.hpp
modules/ts/include/opencv2/ts/ocl_perf.hpp
+10
-6
ocl_perf.cpp
modules/ts/src/ocl_perf.cpp
+7
-17
ts_perf.cpp
modules/ts/src/ts_perf.cpp
+19
-8
No files found.
modules/core/perf/opencl/perf_arithm.cpp
View file @
d7c22343
This diff is collapsed.
Click to expand it.
modules/ts/include/opencv2/ts/ocl_perf.hpp
View file @
d7c22343
...
...
@@ -52,6 +52,9 @@ namespace ocl {
using
namespace
perf
;
using
std
::
tr1
::
get
;
using
std
::
tr1
::
tuple
;
#define OCL_PERF_STRATEGY PERF_STRATEGY_SIMPLE
#define OCL_PERF_TEST_P(fixture, name, params) SIMPLE_PERF_TEST_P(fixture, name, params)
...
...
@@ -68,21 +71,22 @@ using namespace perf;
void OCL##_##fixture##_##name::PerfTestBody()
#define OCL_SIZE_1000 Size(1000, 1000)
#define OCL_SIZE_2000 Size(2000, 2000)
#define OCL_SIZE_4000 Size(4000, 4000)
#define OCL_SIZE_1 szVGA
#define OCL_SIZE_2 sz720p
#define OCL_SIZE_3 sz1080p
#define OCL_SIZE_4 sz2160p
#define OCL_TEST_SIZES ::testing::Values(OCL_SIZE_1
000, OCL_SIZE_2000, OCL_SIZE_4000
)
#define OCL_TEST_SIZES ::testing::Values(OCL_SIZE_1
, OCL_SIZE_2, OCL_SIZE_3, OCL_SIZE_4
)
#define OCL_TEST_TYPES ::testing::Values(CV_8UC1, CV_32FC1, CV_8UC4, CV_32FC4)
#define OCL_PERF_ENUM ::testing::Values
// TODO Replace finish call to dstUMat.wait()
#define OCL_TEST_CYCLE() \
for (; startTimer(), next(); cvtest::ocl::perf::safeFinish(), stopTimer())
for (
cvtest::ocl::perf::safeFinish()
; startTimer(), next(); cvtest::ocl::perf::safeFinish(), stopTimer())
#define OCL_TEST_CYCLE_MULTIRUN(runsNum) \
for (declare.runs(runsNum); startTimer(), next(); cvtest::ocl::perf::safeFinish(), stopTimer()) \
for (declare.runs(runsNum)
, cvtest::ocl::perf::safeFinish()
; startTimer(), next(); cvtest::ocl::perf::safeFinish(), stopTimer()) \
for (int r = 0; r < runsNum; cvtest::ocl::perf::safeFinish(), ++r)
namespace
perf
{
...
...
modules/ts/src/ocl_perf.cpp
View file @
d7c22343
...
...
@@ -53,41 +53,31 @@ namespace perf {
void
checkDeviceMaxMemoryAllocSize
(
const
Size
&
size
,
int
type
,
int
factor
)
{
assert
(
factor
>
0
);
if
(
!
cv
::
ocl
::
useOpenCL
())
return
;
int
cn
=
CV_MAT_CN
(
type
);
int
cn_ocl
=
cn
==
3
?
4
:
cn
;
int
type_ocl
=
CV_MAKE_TYPE
(
CV_MAT_DEPTH
(
type
),
cn_ocl
);
size_t
memSize
=
size
.
area
()
*
CV_ELEM_SIZE
(
type_ocl
);
size_t
memSize
=
size
.
area
()
*
CV_ELEM_SIZE
(
type
);
const
cv
::
ocl
::
Device
&
dev
=
cv
::
ocl
::
Device
::
getDefault
();
if
(
memSize
*
factor
>=
dev
.
maxMemAllocSize
())
{
throw
::
perf
::
TestBase
::
PerfSkipTestException
();
}
}
void
randu
(
InputOutputArray
dst
)
{
if
(
dst
.
depth
()
==
CV_8U
)
{
cv
::
randu
(
dst
,
0
,
256
);
}
else
if
(
dst
.
depth
()
==
CV_8S
)
{
cv
::
randu
(
dst
,
-
128
,
128
);
}
else
if
(
dst
.
depth
()
==
CV_16U
)
{
cv
::
randu
(
dst
,
0
,
1024
);
}
else
if
(
dst
.
depth
()
==
CV_32F
||
dst
.
depth
()
==
CV_64F
)
{
cv
::
randu
(
dst
,
-
1.0
,
1.0
);
}
else
// (dst.depth() == CV_16S || dst.depth() == CV_32S)
{
else
if
(
dst
.
depth
()
==
CV_16S
||
dst
.
depth
()
==
CV_32S
)
cv
::
randu
(
dst
,
-
4096
,
4096
);
}
else
CV_Error
(
Error
::
StsUnsupportedFormat
,
"Unsupported format"
);
}
}
// namespace perf
...
...
modules/ts/src/ts_perf.cpp
View file @
d7c22343
...
...
@@ -268,7 +268,8 @@ std::string Regression::getCurrentTestNodeName()
bool
Regression
::
isVector
(
cv
::
InputArray
a
)
{
return
a
.
kind
()
==
cv
::
_InputArray
::
STD_VECTOR_MAT
||
a
.
kind
()
==
cv
::
_InputArray
::
STD_VECTOR_VECTOR
;
return
a
.
kind
()
==
cv
::
_InputArray
::
STD_VECTOR_MAT
||
a
.
kind
()
==
cv
::
_InputArray
::
STD_VECTOR_VECTOR
||
a
.
kind
()
==
cv
::
_InputArray
::
STD_VECTOR_UMAT
;
}
double
Regression
::
getElem
(
cv
::
Mat
&
m
,
int
y
,
int
x
,
int
cn
)
...
...
@@ -866,17 +867,27 @@ void TestBase::declareArray(SizeVector& sizes, cv::InputOutputArray a, WarmUpTyp
void
TestBase
::
warmup
(
cv
::
InputOutputArray
a
,
WarmUpType
wtype
)
{
if
(
a
.
empty
())
{
return
;
}
else
if
(
a
.
isUMat
())
{
return
;
// TODO current warmup_impl is not useful for GPU-based data
else
if
(
a
.
isUMat
()
&&
wtype
!=
WARMUP_READ
)
{
int
depth
=
a
.
depth
();
if
(
depth
==
CV_8U
)
cv
::
randu
(
a
,
0
,
256
);
else
if
(
depth
==
CV_8S
)
cv
::
randu
(
a
,
-
128
,
128
);
else
if
(
depth
==
CV_16U
)
cv
::
randu
(
a
,
0
,
1024
);
else
if
(
depth
==
CV_32F
||
depth
==
CV_64F
)
cv
::
randu
(
a
,
-
1.0
,
1.0
);
else
if
(
depth
==
CV_16S
||
depth
==
CV_32S
)
cv
::
randu
(
a
,
-
4096
,
4096
);
else
CV_Error
(
cv
::
Error
::
StsUnsupportedFormat
,
"Unsupported format"
);
return
;
}
else
if
(
a
.
kind
()
!=
cv
::
_InputArray
::
STD_VECTOR_MAT
&&
a
.
kind
()
!=
cv
::
_InputArray
::
STD_VECTOR_VECTOR
)
{
warmup_impl
(
a
.
getMat
(),
wtype
);
}
else
{
size_t
total
=
a
.
total
();
...
...
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