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
1d6715e5
Commit
1d6715e5
authored
Dec 12, 2013
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added cv::sqrt to T-API (using built-in sqrt OpenCL function)
parent
b43d6b68
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
mathfuncs.cpp
modules/core/src/mathfuncs.cpp
+5
-2
test_arithm.cpp
modules/core/test/ocl/test_arithm.cpp
+18
-0
No files found.
modules/core/src/mathfuncs.cpp
View file @
1d6715e5
...
...
@@ -2041,9 +2041,12 @@ static bool ocl_pow(InputArray _src, double power, OutputArray _dst)
(
depth
==
CV_64F
&&
!
doubleSupport
)
)
return
false
;
bool
issqrt
=
std
::
abs
(
power
-
0.5
)
<
DBL_EPSILON
;
const
char
*
const
op
=
issqrt
?
"OP_SQRT"
:
"OP_POW"
;
ocl
::
Kernel
k
(
"KF"
,
ocl
::
core
::
arithm_oclsrc
,
format
(
"-D dstT=%s -D
OP_POW
-D UNARY_OP%s"
,
ocl
::
typeToStr
(
CV_MAKE_TYPE
(
depth
,
1
)),
doubleSupport
?
" -D DOUBLE_SUPPORT"
:
""
));
format
(
"-D dstT=%s -D
%s
-D UNARY_OP%s"
,
ocl
::
typeToStr
(
CV_MAKE_TYPE
(
depth
,
1
)),
op
,
doubleSupport
?
" -D DOUBLE_SUPPORT"
:
""
));
if
(
k
.
empty
())
return
false
;
...
...
modules/core/test/ocl/test_arithm.cpp
View file @
1d6715e5
...
...
@@ -1102,6 +1102,23 @@ OCL_TEST_P(Norm, NORM_L2_2args)
}
}
//////////////////////////////// Sqrt ////////////////////////////////////////////////
typedef
ArithmTestBase
Sqrt
;
OCL_TEST_P
(
Sqrt
,
Mat
)
{
for
(
int
j
=
0
;
j
<
test_loop_times
;
j
++
)
{
generateTestData
();
OCL_OFF
(
cv
::
sqrt
(
src1_roi
,
dst1_roi
));
OCL_ON
(
cv
::
sqrt
(
usrc1_roi
,
udst1_roi
));
Near
(
1
);
}
}
//////////////////////////////////////// Instantiation /////////////////////////////////////////
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Lut
,
Combine
(
::
testing
::
Values
(
CV_8U
,
CV_8S
),
OCL_ALL_DEPTHS
,
OCL_ALL_CHANNELS
,
Bool
(),
Bool
()));
...
...
@@ -1133,6 +1150,7 @@ OCL_INSTANTIATE_TEST_CASE_P(Arithm, Phase, Combine(::testing::Values(CV_32F, CV_
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Magnitude
,
Combine
(
::
testing
::
Values
(
CV_32F
,
CV_64F
),
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Flip
,
Combine
(
OCL_ALL_DEPTHS
,
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Norm
,
Combine
(
OCL_ALL_DEPTHS
,
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Sqrt
,
Combine
(
::
testing
::
Values
(
CV_32F
,
CV_64F
),
OCL_ALL_CHANNELS
,
Bool
()));
}
}
// namespace cvtest::ocl
...
...
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