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
0da71a01
Commit
0da71a01
authored
Jan 20, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed some GPU tests failing when compiled for 1.1(no doubles) and run on 1.3(with doubles)
parent
9e48f641
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
90 additions
and
30 deletions
+90
-30
initialization.cpp
modules/gpu/src/initialization.cpp
+1
-1
matrix_reductions.cpp
modules/gpu/src/matrix_reductions.cpp
+12
-3
split_merge.cpp
modules/gpu/src/split_merge.cpp
+8
-0
arithm.cpp
tests/gpu/src/arithm.cpp
+8
-10
bitwise_oper.cpp
tests/gpu/src/bitwise_oper.cpp
+6
-1
match_template.cpp
tests/gpu/src/match_template.cpp
+20
-0
split_merge.cpp
tests/gpu/src/split_merge.cpp
+35
-15
No files found.
modules/gpu/src/initialization.cpp
View file @
0da71a01
...
...
@@ -222,7 +222,7 @@ CV_EXPORTS bool cv::gpu::isCompatibleWith(int device)
if
(
hasLessOrEqualPtxVersion
(
major
,
minor
))
return
true
;
// Check CUBIN compatibilty
// Check CUBIN compatibil
i
ty
for
(
int
i
=
minor
;
i
>=
0
;
--
i
)
if
(
hasCubinVersion
(
major
,
i
))
return
true
;
...
...
modules/gpu/src/matrix_reductions.cpp
View file @
0da71a01
...
...
@@ -277,7 +277,10 @@ void cv::gpu::minMax(const GpuMat& src, double* minVal, double* maxVal, const Gp
CV_Assert
(
src
.
channels
()
==
1
);
CV_Assert
(
mask
.
empty
()
||
(
mask
.
type
()
==
CV_8U
&&
src
.
size
()
==
mask
.
size
()));
CV_Assert
(
src
.
type
()
!=
CV_64F
||
hasNativeDoubleSupport
(
getDevice
()));
bool
double_ok
=
hasGreaterOrEqualVersion
(
1
,
3
)
&&
hasNativeDoubleSupport
(
getDevice
());
CV_Assert
(
src
.
type
()
!=
CV_64F
||
double_ok
);
double
minVal_
;
if
(
!
minVal
)
minVal
=
&
minVal_
;
double
maxVal_
;
if
(
!
maxVal
)
maxVal
=
&
maxVal_
;
...
...
@@ -373,7 +376,10 @@ void cv::gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point
CV_Assert
(
src
.
channels
()
==
1
);
CV_Assert
(
mask
.
empty
()
||
(
mask
.
type
()
==
CV_8U
&&
src
.
size
()
==
mask
.
size
()));
CV_Assert
(
src
.
type
()
!=
CV_64F
||
hasNativeDoubleSupport
(
getDevice
()));
bool
double_ok
=
hasGreaterOrEqualVersion
(
1
,
3
)
&&
hasNativeDoubleSupport
(
getDevice
());
CV_Assert
(
src
.
type
()
!=
CV_64F
||
double_ok
);
double
minVal_
;
if
(
!
minVal
)
minVal
=
&
minVal_
;
double
maxVal_
;
if
(
!
maxVal
)
maxVal
=
&
maxVal_
;
...
...
@@ -452,7 +458,10 @@ int cv::gpu::countNonZero(const GpuMat& src, GpuMat& buf)
countNonZeroCaller
<
double
>
};
CV_Assert
(
src
.
channels
()
==
1
);
CV_Assert
(
src
.
type
()
!=
CV_64F
||
hasNativeDoubleSupport
(
getDevice
()));
bool
double_ok
=
hasGreaterOrEqualVersion
(
1
,
3
)
&&
hasNativeDoubleSupport
(
getDevice
());
CV_Assert
(
src
.
type
()
!=
CV_64F
||
double_ok
);
Size
buf_size
;
getBufSizeRequired
(
src
.
cols
,
src
.
rows
,
buf_size
.
width
,
buf_size
.
height
);
...
...
modules/gpu/src/split_merge.cpp
View file @
0da71a01
...
...
@@ -73,6 +73,10 @@ namespace cv { namespace gpu { namespace split_merge
CV_Assert
(
src
);
CV_Assert
(
n
>
0
);
bool
double_ok
=
hasGreaterOrEqualVersion
(
1
,
3
)
&&
hasNativeDoubleSupport
(
getDevice
());
CV_Assert
(
src
[
0
].
depth
()
!=
CV_64F
||
double_ok
);
int
depth
=
src
[
0
].
depth
();
Size
size
=
src
[
0
].
size
();
...
...
@@ -112,6 +116,10 @@ namespace cv { namespace gpu { namespace split_merge
{
CV_Assert
(
dst
);
bool
double_ok
=
hasGreaterOrEqualVersion
(
1
,
3
)
&&
hasNativeDoubleSupport
(
getDevice
());
CV_Assert
(
src
.
depth
()
!=
CV_64F
||
double_ok
);
int
depth
=
src
.
depth
();
int
num_channels
=
src
.
channels
();
Size
size
=
src
.
size
();
...
...
tests/gpu/src/arithm.cpp
View file @
0da71a01
...
...
@@ -659,11 +659,10 @@ struct CV_GpuMinMaxTest: public CvTest
{
try
{
int
depth_end
;
if
(
cv
::
gpu
::
hasNativeDoubleSupport
(
cv
::
gpu
::
getDevice
()))
depth_end
=
CV_64F
;
else
depth_end
=
CV_32F
;
bool
double_ok
=
gpu
::
hasGreaterOrEqualVersion
(
1
,
3
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
());
int
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
int
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
{
for
(
int
i
=
0
;
i
<
3
;
++
i
)
...
...
@@ -794,11 +793,10 @@ struct CV_GpuMinMaxLocTest: public CvTest
{
try
{
int
depth_end
;
if
(
cv
::
gpu
::
hasNativeDoubleSupport
(
cv
::
gpu
::
getDevice
()))
depth_end
=
CV_64F
;
else
depth_end
=
CV_32F
;
bool
double_ok
=
gpu
::
hasGreaterOrEqualVersion
(
1
,
3
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
());
int
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
int
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
{
int
rows
=
1
,
cols
=
3
;
...
...
tests/gpu/src/bitwise_oper.cpp
View file @
0da71a01
...
...
@@ -58,7 +58,12 @@ struct CV_GpuBitwiseTest: public CvTest
void
run
(
int
)
{
int
rows
,
cols
;
for
(
int
depth
=
CV_8U
;
depth
<=
CV_64F
;
++
depth
)
bool
double_ok
=
gpu
::
hasGreaterOrEqualVersion
(
1
,
3
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
());
int
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
int
depth
=
CV_8U
;
depth
<=
CV_32F
;
++
depth
)
for
(
int
cn
=
1
;
cn
<=
4
;
++
cn
)
for
(
int
attempt
=
0
;
attempt
<
3
;
++
attempt
)
{
...
...
tests/gpu/src/match_template.cpp
View file @
0da71a01
...
...
@@ -64,6 +64,16 @@ struct CV_GpuMatchTemplateTest: CvTest
{
try
{
bool
double_ok
=
gpu
::
hasGreaterOrEqualVersion
(
1
,
3
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
());
if
(
!
double_ok
)
{
// For sqrIntegral
ts
->
printf
(
CvTS
::
CONSOLE
,
"
\n
Code and device double support is required (CC >= 1.3)"
);
ts
->
set_failed_test_info
(
CvTS
::
FAIL_GENERIC
);
return
;
}
Mat
image
,
templ
;
Mat
dst_gold
;
gpu
::
GpuMat
dst
;
...
...
@@ -234,6 +244,16 @@ struct CV_GpuMatchTemplateFindPatternInBlackTest: CvTest
{
try
{
bool
double_ok
=
gpu
::
hasGreaterOrEqualVersion
(
1
,
3
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
());
if
(
!
double_ok
)
{
// For sqrIntegral
ts
->
printf
(
CvTS
::
CONSOLE
,
"
\n
Code and device double support is required (CC >= 1.3)"
);
ts
->
set_failed_test_info
(
CvTS
::
FAIL_GENERIC
);
return
;
}
Mat
image
=
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"matchtemplate/black.png"
);
if
(
image
.
empty
())
{
...
...
tests/gpu/src/split_merge.cpp
View file @
0da71a01
...
...
@@ -49,7 +49,7 @@
using
namespace
std
;
using
namespace
cv
;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Merge
struct
CV_MergeTest
:
public
CvTest
...
...
@@ -63,8 +63,12 @@ struct CV_MergeTest : public CvTest
void
CV_MergeTest
::
can_merge
(
size_t
rows
,
size_t
cols
)
{
bool
double_ok
=
gpu
::
hasGreaterOrEqualVersion
(
1
,
3
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
());
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
for
(
size_t
depth
=
CV_8U
;
depth
<=
CV_64F
;
++
depth
)
for
(
size_t
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
{
vector
<
Mat
>
src
;
for
(
size_t
i
=
0
;
i
<
num_channels
;
++
i
)
...
...
@@ -101,8 +105,12 @@ void CV_MergeTest::can_merge(size_t rows, size_t cols)
void
CV_MergeTest
::
can_merge_submatrixes
(
size_t
rows
,
size_t
cols
)
{
bool
double_ok
=
gpu
::
hasGreaterOrEqualVersion
(
1
,
3
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
());
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
for
(
size_t
depth
=
CV_8U
;
depth
<=
CV_64F
;
++
depth
)
for
(
size_t
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
{
vector
<
Mat
>
src
;
for
(
size_t
i
=
0
;
i
<
num_channels
;
++
i
)
...
...
@@ -158,7 +166,7 @@ void CV_MergeTest::run(int)
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Split
struct
CV_SplitTest
:
public
CvTest
...
...
@@ -171,8 +179,12 @@ struct CV_SplitTest : public CvTest
void
CV_SplitTest
::
can_split
(
size_t
rows
,
size_t
cols
)
{
bool
double_ok
=
gpu
::
hasGreaterOrEqualVersion
(
1
,
3
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
());
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
for
(
size_t
depth
=
CV_8U
;
depth
<=
CV_64F
;
++
depth
)
for
(
size_t
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
{
Mat
src
(
rows
,
cols
,
CV_MAKETYPE
(
depth
,
num_channels
),
Scalar
(
1.0
,
2.0
,
3.0
,
4.0
));
vector
<
Mat
>
dst
;
...
...
@@ -209,8 +221,12 @@ void CV_SplitTest::can_split(size_t rows, size_t cols)
void
CV_SplitTest
::
can_split_submatrix
(
size_t
rows
,
size_t
cols
)
{
bool
double_ok
=
gpu
::
hasGreaterOrEqualVersion
(
1
,
3
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
());
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
for
(
size_t
depth
=
CV_8U
;
depth
<=
CV_64F
;
++
depth
)
for
(
size_t
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
{
Mat
src_data
(
rows
*
2
,
cols
*
2
,
CV_MAKETYPE
(
depth
,
num_channels
),
Scalar
(
1.0
,
2.0
,
3.0
,
4.0
));
Mat
src
(
src_data
(
Range
(
rows
/
2
,
rows
/
2
+
rows
),
Range
(
cols
/
2
,
cols
/
2
+
cols
)));
...
...
@@ -264,8 +280,8 @@ void CV_SplitTest::run(int)
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Split and merge
struct
CV_SplitMergeTest
:
public
CvTest
...
...
@@ -276,8 +292,12 @@ struct CV_SplitMergeTest : public CvTest
};
void
CV_SplitMergeTest
::
can_split_merge
(
size_t
rows
,
size_t
cols
)
{
bool
double_ok
=
gpu
::
hasGreaterOrEqualVersion
(
1
,
3
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
());
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
for
(
size_t
depth
=
CV_8U
;
depth
<=
CV_64F
;
++
depth
)
for
(
size_t
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
{
Mat
orig
(
rows
,
cols
,
CV_MAKETYPE
(
depth
,
num_channels
),
Scalar
(
1.0
,
2.0
,
3.0
,
4.0
));
gpu
::
GpuMat
dev_orig
(
orig
);
...
...
@@ -318,12 +338,12 @@ void CV_SplitMergeTest::run(int)
}
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// If we comment some tests, we may foget/miss to uncomment it after.
// Placing all test definitions in one place
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// If we comment some tests, we may foget/miss to uncomment it after.
// Placing all test definitions in one place
// makes us know about what tests are commented.
...
...
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