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
a01e81c8
Commit
a01e81c8
authored
Jan 07, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added some performance tests
parent
1592234f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
1 deletion
+77
-1
perf_arithm.cpp
modules/core/perf/opencl/perf_arithm.cpp
+76
-0
mathfuncs.cpp
modules/core/src/mathfuncs.cpp
+1
-1
No files found.
modules/core/perf/opencl/perf_arithm.cpp
View file @
a01e81c8
...
...
@@ -814,6 +814,82 @@ OCL_PERF_TEST_P(NormalizeFixture, Normalize,
SANITY_CHECK
(
dst
,
5e-2
);
}
///////////// ConvertScaleAbs ////////////////////////
typedef
Size_MatType
ConvertScaleAbsFixture
;
OCL_PERF_TEST_P
(
ConvertScaleAbsFixture
,
ConvertScaleAbs
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
))
{
const
Size_MatType_t
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
cn
=
CV_MAT_CN
(
type
);
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
UMat
src
(
srcSize
,
type
),
dst
(
srcSize
,
CV_8UC
(
cn
));
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
OCL_TEST_CYCLE
()
cv
::
convertScaleAbs
(
src
,
dst
,
0.5
,
2
);
SANITY_CHECK
(
dst
);
}
///////////// PatchNaNs ////////////////////////
typedef
Size_MatType
PatchNaNsFixture
;
OCL_PERF_TEST_P
(
PatchNaNsFixture
,
PatchNaNs
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_PERF_ENUM
(
CV_32FC1
,
CV_32FC4
)))
{
const
Size_MatType_t
params
=
GetParam
();
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
cn
=
CV_MAT_CN
(
type
);
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
UMat
src
(
srcSize
,
type
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
src
);
// generating NaNs
{
Mat
src_
=
src
.
getMat
(
ACCESS_RW
);
srcSize
.
width
*=
cn
;
for
(
int
y
=
0
;
y
<
srcSize
.
height
;
++
y
)
{
float
*
const
ptr
=
src_
.
ptr
<
float
>
(
y
);
for
(
int
x
=
0
;
x
<
srcSize
.
width
;
++
x
)
ptr
[
x
]
=
(
x
+
y
)
%
2
==
0
?
std
::
numeric_limits
<
float
>::
quiet_NaN
()
:
ptr
[
x
];
}
}
OCL_TEST_CYCLE
()
cv
::
patchNaNs
(
src
,
17.7
);
SANITY_CHECK
(
src
);
}
///////////// ScaleAdd ////////////////////////
typedef
Size_MatType
ScaleAddFixture
;
OCL_PERF_TEST_P
(
ScaleAddFixture
,
ScaleAdd
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
))
{
const
Size_MatType_t
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
);
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
UMat
src1
(
srcSize
,
type
),
src2
(
srcSize
,
type
),
dst
(
srcSize
,
type
);
declare
.
in
(
src1
,
src2
,
WARMUP_RNG
).
out
(
dst
);
OCL_TEST_CYCLE
()
cv
::
scaleAdd
(
src1
,
0.6
,
src2
,
dst
);
SANITY_CHECK
(
dst
,
1e-6
);
}
}
}
// namespace cvtest::ocl
#endif // HAVE_OPENCL
modules/core/src/mathfuncs.cpp
View file @
a01e81c8
...
...
@@ -2375,7 +2375,7 @@ static bool ocl_patchNaNs( InputOutputArray _a, float value )
int
cn
=
a
.
channels
();
k
.
args
(
ocl
::
KernelArg
::
ReadOnlyNoSize
(
a
),
ocl
::
KernelArg
::
WriteOnly
(
a
),
(
float
)
value
);
ocl
::
KernelArg
::
WriteOnly
(
a
,
cn
),
(
float
)
value
);
size_t
globalsize
[
2
]
=
{
a
.
cols
*
cn
,
a
.
rows
};
return
k
.
run
(
2
,
globalsize
,
NULL
,
false
);
...
...
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