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
2f2a9ad5
Commit
2f2a9ad5
authored
Jul 31, 2014
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3020 from vpisarev:ocl_disable_more_funcs
parents
1a1097ab
b0cd8229
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
18 deletions
+24
-18
arithm.cpp
modules/core/src/arithm.cpp
+3
-0
convert.cpp
modules/core/src/convert.cpp
+1
-1
copy.cpp
modules/core/src/copy.cpp
+6
-6
matrix.cpp
modules/core/src/matrix.cpp
+4
-1
stat.cpp
modules/core/src/stat.cpp
+6
-6
test_arithm.cpp
modules/core/test/ocl/test_arithm.cpp
+4
-4
No files found.
modules/core/src/arithm.cpp
View file @
2f2a9ad5
...
...
@@ -1491,6 +1491,9 @@ static bool ocl_arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
if
(
!
doubleSupport
&&
(
depth2
==
CV_64F
||
depth1
==
CV_64F
))
return
false
;
if
(
(
oclop
==
OCL_OP_MUL_SCALE
||
oclop
==
OCL_OP_DIV_SCALE
)
&&
(
depth1
>=
CV_32F
||
depth2
>=
CV_32F
||
ddepth
>=
CV_32F
)
)
return
false
;
int
kercn
=
haveMask
||
haveScalar
?
cn
:
ocl
::
predictOptimalVectorWidth
(
_src1
,
_src2
,
_dst
);
int
scalarcn
=
kercn
==
3
?
4
:
kercn
,
rowsPerWI
=
d
.
isIntel
()
?
4
:
1
;
...
...
modules/core/src/convert.cpp
View file @
2f2a9ad5
...
...
@@ -1541,7 +1541,7 @@ static bool ocl_convertScaleAbs( InputArray _src, OutputArray _dst, double alpha
kercn
=
ocl
::
predictOptimalVectorWidth
(
_src
,
_dst
),
rowsPerWI
=
d
.
isIntel
()
?
4
:
1
;
bool
doubleSupport
=
d
.
doubleFPConfig
()
>
0
;
if
(
!
doubleSupport
&&
depth
==
CV_64F
)
if
(
depth
==
CV_32F
||
depth
==
CV_64F
)
return
false
;
char
cvt
[
2
][
50
];
...
...
modules/core/src/copy.cpp
View file @
2f2a9ad5
...
...
@@ -432,7 +432,7 @@ Mat& Mat::setTo(InputArray _value, InputArray _mask)
IppStatus
status
=
(
IppStatus
)
-
1
;
IppiSize
roisize
=
{
cols
,
rows
};
int
mstep
=
(
int
)
mask
.
step
,
dstep
=
(
int
)
step
;
int
mstep
=
(
int
)
mask
.
step
[
0
],
dstep
=
(
int
)
step
[
0
]
;
if
(
isContinuous
()
&&
mask
.
isContinuous
())
{
...
...
@@ -618,7 +618,7 @@ static bool ocl_flip(InputArray _src, OutputArray _dst, int flipCode )
int
type
=
_src
.
type
(),
depth
=
CV_MAT_DEPTH
(
type
),
cn
=
CV_MAT_CN
(
type
),
flipType
,
kercn
=
std
::
min
(
ocl
::
predictOptimalVectorWidth
(
_src
,
_dst
),
4
);;
if
(
cn
>
4
)
if
(
cn
>
4
||
cn
==
3
)
return
false
;
const
char
*
kernelName
;
...
...
@@ -762,7 +762,7 @@ void flip( InputArray _src, OutputArray _dst, int flip_mode )
flipHoriz
(
dst
.
data
,
dst
.
step
,
dst
.
data
,
dst
.
step
,
dst
.
size
(),
esz
);
}
#ifdef HAVE_OPENCL
/*
#ifdef HAVE_OPENCL
static bool ocl_repeat(InputArray _src, int ny, int nx, OutputArray _dst)
{
...
...
@@ -790,7 +790,7 @@ static bool ocl_repeat(InputArray _src, int ny, int nx, OutputArray _dst)
return k.run(2, globalsize, NULL, false);
}
#endif
#endif
*/
void
repeat
(
InputArray
_src
,
int
ny
,
int
nx
,
OutputArray
_dst
)
{
...
...
@@ -800,8 +800,8 @@ void repeat(InputArray _src, int ny, int nx, OutputArray _dst)
Size
ssize
=
_src
.
size
();
_dst
.
create
(
ssize
.
height
*
ny
,
ssize
.
width
*
nx
,
_src
.
type
());
CV_OCL_RUN
(
_dst
.
isUMat
(),
ocl_repeat
(
_src
,
ny
,
nx
,
_dst
))
/*
CV_OCL_RUN(_dst.isUMat(),
ocl_repeat(_src, ny, nx, _dst))
*/
Mat
src
=
_src
.
getMat
(),
dst
=
_dst
.
getMat
();
Size
dsize
=
dst
.
size
();
...
...
modules/core/src/matrix.cpp
View file @
2f2a9ad5
...
...
@@ -3336,7 +3336,7 @@ static inline void reduceSumC_8u16u16s32f_64f(const cv::Mat& srcmat, cv::Mat& ds
stype
==
CV_32FC3
?
(
ippiSumHint
)
ippiSum_32f_C3R
:
stype
==
CV_32FC4
?
(
ippiSumHint
)
ippiSum_32f_C4R
:
0
;
func
=
sdepth
==
CV_8U
?
(
cv
::
ReduceFunc
)
cv
::
reduceC_
<
uchar
,
double
,
cv
::
OpAdd
<
double
>
>
:
sdepth
==
CV_8U
?
(
cv
::
ReduceFunc
)
cv
::
reduceC_
<
uchar
,
double
,
cv
::
OpAdd
<
double
>
>
:
sdepth
==
CV_16U
?
(
cv
::
ReduceFunc
)
cv
::
reduceC_
<
ushort
,
double
,
cv
::
OpAdd
<
double
>
>
:
sdepth
==
CV_16S
?
(
cv
::
ReduceFunc
)
cv
::
reduceC_
<
short
,
double
,
cv
::
OpAdd
<
double
>
>
:
sdepth
==
CV_32F
?
(
cv
::
ReduceFunc
)
cv
::
reduceC_
<
float
,
double
,
cv
::
OpAdd
<
double
>
>
:
0
;
...
...
@@ -3459,6 +3459,9 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst,
if
(
!
doubleSupport
&&
(
sdepth
==
CV_64F
||
ddepth
==
CV_64F
))
return
false
;
if
((
op
==
CV_REDUCE_SUM
&&
sdepth
==
CV_32F
)
||
op
==
CV_REDUCE_MIN
||
op
==
CV_REDUCE_MAX
)
return
false
;
if
(
op
==
CV_REDUCE_AVG
)
{
if
(
sdepth
<
CV_32S
&&
ddepth
<
CV_32S
)
...
...
modules/core/src/stat.cpp
View file @
2f2a9ad5
...
...
@@ -1452,7 +1452,7 @@ static bool ocl_minMaxIdx( InputArray _src, double* minVal, double* maxVal, int*
CV_Assert
(
!
haveSrc2
||
_src2
.
type
()
==
type
);
if
(
depth
==
CV_32S
||
depth
==
CV_32F
)
if
(
depth
==
CV_32S
||
depth
==
CV_32F
||
!
_mask
.
empty
()
)
return
false
;
if
((
depth
==
CV_64F
||
ddepth
==
CV_64F
)
&&
!
doubleSupport
)
...
...
@@ -2283,7 +2283,7 @@ double cv::norm( InputArray _src, int normType, InputArray _mask )
setIppErrorStatus
();
}
typedef
IppStatus
(
CV_STDCALL
*
ippiMaskNormFuncC3
)(
const
void
*
,
int
,
const
void
*
,
int
,
IppiSize
,
int
,
Ipp64f
*
);
/*
typedef IppStatus (CV_STDCALL* ippiMaskNormFuncC3)(const void *, int, const void *, int, IppiSize, int, Ipp64f *);
ippiMaskNormFuncC3 ippFuncC3 =
normType == NORM_INF ?
(type == CV_8UC3 ? (ippiMaskNormFuncC3)ippiNorm_Inf_8u_C3CMR :
...
...
@@ -2318,7 +2318,7 @@ double cv::norm( InputArray _src, int normType, InputArray _mask )
return normType == NORM_L2SQR ? (double)(norm * norm) : (double)norm;
}
setIppErrorStatus();
}
}
*/
}
else
{
...
...
@@ -2724,7 +2724,7 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
0
)
:
normType
==
NORM_L1
?
(
type
==
CV_8UC1
?
(
ippiMaskNormDiffFuncC1
)
ippiNormDiff_L1_8u_C1MR
:
type
==
CV_8SC1
?
(
ippiMaskNormDiffFuncC1
)
ippiNormDiff_L1_8s_C1MR
:
//
type == CV_8SC1 ? (ippiMaskNormDiffFuncC1)ippiNormDiff_L1_8s_C1MR :
type
==
CV_16UC1
?
(
ippiMaskNormDiffFuncC1
)
ippiNormDiff_L1_16u_C1MR
:
type
==
CV_32FC1
?
(
ippiMaskNormDiffFuncC1
)
ippiNormDiff_L1_32f_C1MR
:
0
)
:
...
...
@@ -2741,7 +2741,7 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
return
normType
==
NORM_L2SQR
?
(
double
)(
norm
*
norm
)
:
(
double
)
norm
;
setIppErrorStatus
();
}
typedef
IppStatus
(
CV_STDCALL
*
ippiMaskNormDiffFuncC3
)(
const
void
*
,
int
,
const
void
*
,
int
,
const
void
*
,
int
,
IppiSize
,
int
,
Ipp64f
*
);
/*
typedef IppStatus (CV_STDCALL* ippiMaskNormDiffFuncC3)(const void *, int, const void *, int, const void *, int, IppiSize, int, Ipp64f *);
ippiMaskNormDiffFuncC3 ippFuncC3 =
normType == NORM_INF ?
(type == CV_8UC3 ? (ippiMaskNormDiffFuncC3)ippiNormDiff_Inf_8u_C3CMR :
...
...
@@ -2776,7 +2776,7 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
return normType == NORM_L2SQR ? (double)(norm * norm) : (double)norm;
}
setIppErrorStatus();
}
}
*/
}
else
{
...
...
modules/core/test/ocl/test_arithm.cpp
View file @
2f2a9ad5
...
...
@@ -829,7 +829,7 @@ OCL_TEST_P(Pow, Mat)
{
static
const
double
pows
[]
=
{
-
4
,
-
1
,
-
2.5
,
0
,
1
,
2
,
3.7
,
4
};
for
(
int
j
=
0
;
j
<
test_loop_times
;
j
++
)
for
(
int
j
=
0
;
j
<
1
/*test_loop_times*/
;
j
++
)
for
(
int
k
=
0
,
size
=
sizeof
(
pows
)
/
sizeof
(
double
);
k
<
size
;
++
k
)
{
SCOPED_TRACE
(
pows
[
k
]);
...
...
@@ -1203,7 +1203,7 @@ OCL_TEST_P(MinMaxIdx_Mask, Mat)
static
bool
relativeError
(
double
actual
,
double
expected
,
double
eps
)
{
return
std
::
abs
(
actual
-
expected
)
/
actual
<
eps
;
return
std
::
abs
(
actual
-
expected
)
<
eps
*
(
1
+
std
::
abs
(
actual
))
;
}
typedef
ArithmTestBase
Norm
;
...
...
@@ -1230,7 +1230,7 @@ OCL_TEST_P(Norm, NORM_INF_1arg_mask)
OCL_OFF
(
const
double
cpuRes
=
cv
::
norm
(
src1_roi
,
NORM_INF
,
mask_roi
));
OCL_ON
(
const
double
gpuRes
=
cv
::
norm
(
usrc1_roi
,
NORM_INF
,
umask_roi
));
EXPECT_NEAR
(
cpuRes
,
gpuRes
,
0.
1
);
EXPECT_NEAR
(
cpuRes
,
gpuRes
,
0.
2
);
}
}
...
...
@@ -1302,7 +1302,7 @@ OCL_TEST_P(Norm, NORM_INF_2args)
OCL_OFF
(
const
double
cpuRes
=
cv
::
norm
(
src1_roi
,
src2_roi
,
type
));
OCL_ON
(
const
double
gpuRes
=
cv
::
norm
(
usrc1_roi
,
usrc2_roi
,
type
));
EXPECT_NEAR
(
cpuRes
,
gpuRes
,
0.
1
);
EXPECT_NEAR
(
cpuRes
,
gpuRes
,
0.
2
);
}
}
...
...
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