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
fbdb4f4a
Commit
fbdb4f4a
authored
Nov 26, 2010
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1) gpu test refactoring.
2) fixed gpu bm test fail 3) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
parent
7e2cc1be
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
105 additions
and
96 deletions
+105
-96
FindNPP.cmake
modules/gpu/FindNPP.cmake
+50
-51
arithm.cpp
tests/gpu/src/arithm.cpp
+20
-20
filters.cpp
tests/gpu/src/filters.cpp
+2
-2
gputest_main.cpp
tests/gpu/src/gputest_main.cpp
+1
-1
imgproc_gpu.cpp
tests/gpu/src/imgproc_gpu.cpp
+11
-11
operator_async_call.cpp
tests/gpu/src/operator_async_call.cpp
+7
-7
stereo_bm.cpp
tests/gpu/src/stereo_bm.cpp
+10
-0
stereo_bm_async.cpp
tests/gpu/src/stereo_bm_async.cpp
+4
-4
No files found.
modules/gpu/FindNPP.cmake
View file @
fbdb4f4a
...
...
@@ -7,8 +7,8 @@
# CUDA_NPP_LIBRARIES -- NPP libraries.
# NPP_VERSION -- NPP version in format "major.minor.build".
#
# If not found automatically, please set CUDA_NPP_LIBRARY_ROOT_DIR
or
# set enviroment varivabe $CUDA_NPP_ROOT
# If not found automatically, please set CUDA_NPP_LIBRARY_ROOT_DIR
#
in CMake or
set enviroment varivabe $CUDA_NPP_ROOT
#
# Author: Anatoly Baksheev, Itseez Ltd.
#
...
...
@@ -35,89 +35,88 @@
#
###############################################################################
# We need to have at least this version to support the VERSION_LESS argument to 'if' (2.6.2) and unset (2.6.3)
cmake_policy
(
PUSH
)
cmake_minimum_required
(
VERSION 2.
6
.3
)
cmake_minimum_required
(
VERSION 2.
8
.3
)
cmake_policy
(
POP
)
if
(
NOT
"
${
CUDA_NPP_LIBRARY_ROOT_DIR
}
"
STREQUAL
"
${
CUDA_NPP_LIBRARY_ROOT_DIR_INTERNAL
}
"
)
unset
(
CUDA_NPP_INCLUDES CACHE
)
unset
(
CUDA_NPP_LIBRARIES CACHE
)
unset
(
CUDA_NPP_INCLUDES CACHE
)
unset
(
CUDA_NPP_LIBRARIES CACHE
)
endif
()
if
(
CMAKE_SIZEOF_VOID_P EQUAL 4
)
if
(
UNIX OR APPLE
)
set
(
NPP_SUFFIX
"32"
)
else
()
set
(
NPP_SUFFIX
"-mt"
)
endif
()
if
(
UNIX OR APPLE
)
set
(
NPP_SUFFIX
"32"
)
else
()
set
(
NPP_SUFFIX
"-mt"
)
endif
()
else
(
CMAKE_SIZEOF_VOID_P EQUAL 4
)
if
(
UNIX OR APPLE
)
set
(
NPP_SUFFIX
"64"
)
else
()
set
(
NPP_SUFFIX
"-mt-x64"
)
endif
()
if
(
UNIX OR APPLE
)
set
(
NPP_SUFFIX
"64"
)
else
()
set
(
NPP_SUFFIX
"-mt-x64"
)
endif
()
endif
(
CMAKE_SIZEOF_VOID_P EQUAL 4
)
if
(
NOT CUDA_NPP_LIBRARY_ROOT_DIR OR CUDA_NPP_LIBRARY_ROOT_DIR STREQUAL
""
)
unset
(
CUDA_NPP_LIBRARY_ROOT_DIR CACHE
)
find_path
(
CUDA_NPP_LIBRARY_ROOT_DIR
"common/npp/include/npp.h"
PATHS ENV CUDA_NPP_ROOT DOC
"NPP root directory."
)
MESSAGE
(
STATUS
"NPP root directory: "
${
CUDA_NPP_LIBRARY_ROOT_DIR
}
)
unset
(
CUDA_NPP_LIBRARY_ROOT_DIR CACHE
)
find_path
(
CUDA_NPP_LIBRARY_ROOT_DIR
"common/npp/include/npp.h"
PATHS ENV CUDA_NPP_ROOT DOC
"NPP root directory."
)
MESSAGE
(
STATUS
"NPP root directory: "
${
CUDA_NPP_LIBRARY_ROOT_DIR
}
)
endif
()
# Search includes in our own paths.
find_path
(
CUDA_NPP_INCLUDES npp.h PATHS
"
${
CUDA_NPP_LIBRARY_ROOT_DIR
}
/common/npp/include"
)
# Search default search paths, after we search our own set of paths.
find_path
(
CUDA_NPP_INCLUDES device_functions.h
)
mark_as_advanced
(
CUDA_NPP_INCLUDES
)
mark_as_advanced
(
CUDA_NPP_INCLUDES
)
# Find NPP library
find_library
(
CUDA_NPP_LIBRARIES
NAMES
"npp"
"npp
${
NPP_SUFFIX
}
"
"libnpp
${
NPP_SUFFIX
}
"
PATHS
"
${
CUDA_NPP_LIBRARY_ROOT_DIR
}
"
PATH_SUFFIXES
"common/lib"
"common/npp/lib"
DOC
"NPP library"
)
NAMES
"npp"
"npp
${
NPP_SUFFIX
}
"
"libnpp
${
NPP_SUFFIX
}
"
PATHS
"
${
CUDA_NPP_LIBRARY_ROOT_DIR
}
"
PATH_SUFFIXES
"common/lib"
"common/npp/lib"
DOC
"NPP library"
)
# Search default search paths, after we search our own set of paths.
find_library
(
CUDA_NPP_LIBRARIES NAMES npp
${
NPP_SUFFIX
}
libnpp
${
NPP_SUFFIX
}
DOC
"NPP library"
)
mark_as_advanced
(
CUDA_NPP_LIBRARIES
)
if
(
EXISTS
${
CUDA_NPP_INCLUDES
}
/nppversion.h
)
file
(
STRINGS
${
CUDA_NPP_INCLUDES
}
/nppversion.h npp_major REGEX
"#define NPP_VERSION_MAJOR.*"
)
file
(
STRINGS
${
CUDA_NPP_INCLUDES
}
/nppversion.h npp_minor REGEX
"#define NPP_VERSION_MINOR.*"
)
file
(
STRINGS
${
CUDA_NPP_INCLUDES
}
/nppversion.h npp_build REGEX
"#define NPP_VERSION_BUILD.*"
)
string
(
REGEX REPLACE
"#define NPP_VERSION_MAJOR[
\t
]+|//.*"
""
npp_major
${
npp_major
}
)
string
(
REGEX REPLACE
"#define NPP_VERSION_MINOR[
\t
]+|//.*"
""
npp_minor
${
npp_minor
}
)
string
(
REGEX REPLACE
"#define NPP_VERSION_BUILD[
\t
]+|//.*"
""
npp_build
${
npp_build
}
)
string
(
REGEX MATCH
"[0-9]+"
npp_major
${
npp_major
}
)
string
(
REGEX MATCH
"[0-9]+"
npp_minor
${
npp_minor
}
)
string
(
REGEX MATCH
"[0-9]+"
npp_build
${
npp_build
}
)
set
(
NPP_VERSION
"
${
npp_major
}
.
${
npp_minor
}
.
${
npp_build
}
"
)
file
(
STRINGS
${
CUDA_NPP_INCLUDES
}
/nppversion.h npp_major REGEX
"#define NPP_VERSION_MAJOR.*"
)
file
(
STRINGS
${
CUDA_NPP_INCLUDES
}
/nppversion.h npp_minor REGEX
"#define NPP_VERSION_MINOR.*"
)
file
(
STRINGS
${
CUDA_NPP_INCLUDES
}
/nppversion.h npp_build REGEX
"#define NPP_VERSION_BUILD.*"
)
string
(
REGEX REPLACE
"#define NPP_VERSION_MAJOR[
\t
]+|//.*"
""
npp_major
${
npp_major
}
)
string
(
REGEX REPLACE
"#define NPP_VERSION_MINOR[
\t
]+|//.*"
""
npp_minor
${
npp_minor
}
)
string
(
REGEX REPLACE
"#define NPP_VERSION_BUILD[
\t
]+|//.*"
""
npp_build
${
npp_build
}
)
string
(
REGEX MATCH
"[0-9]+"
npp_major
${
npp_major
}
)
string
(
REGEX MATCH
"[0-9]+"
npp_minor
${
npp_minor
}
)
string
(
REGEX MATCH
"[0-9]+"
npp_build
${
npp_build
}
)
set
(
NPP_VERSION
"
${
npp_major
}
.
${
npp_minor
}
.
${
npp_build
}
"
)
endif
()
if
(
NOT EXISTS
${
CUDA_NPP_LIBRARIES
}
OR NOT EXISTS
${
CUDA_NPP_INCLUDES
}
/npp.h
)
set
(
CUDA_NPP_FOUND FALSE
)
message
(
FATAL_ERROR
"NPP headers/libraries are not found. Please specify CUDA_NPP_LIBRARY_ROOT_DIR in CMake or set $NPP_ROOT_DIR."
)
set
(
CUDA_NPP_FOUND FALSE
)
message
(
FATAL_ERROR
"NPP headers/libraries are not found. Please specify CUDA_NPP_LIBRARY_ROOT_DIR in CMake or set $NPP_ROOT_DIR."
)
endif
()
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
NPP
REQUIRED_VARS
CUDA_NPP_INCLUDES
CUDA_NPP_LIBRARIES
# Don't remove!!! Please update your CMake.
VERSION_VAR
NPP_VERSION
)
REQUIRED_VARS
CUDA_NPP_INCLUDES
CUDA_NPP_LIBRARIES
# Don't remove!!! Please update your CMake.
VERSION_VAR
NPP_VERSION
)
if
(
APPLE
)
# We need to add the path to cudart to the linker using rpath, since the library name for the cuda libraries is prepended with @rpath.
get_filename_component
(
_cuda_path_to_npp
"
${
CUDA_NPP_LIBRARIES
}
"
PATH
)
if
(
_cuda_path_to_npp
)
list
(
APPEND CUDA_NPP_LIBRARIES -Wl,-rpath
"-Wl,
${
_cuda_path_to_npp
}
"
)
endif
()
# We need to add the path to cudart to the linker using rpath, since the library name for the cuda libraries is prepended with @rpath.
get_filename_component
(
_cuda_path_to_npp
"
${
CUDA_NPP_LIBRARIES
}
"
PATH
)
if
(
_cuda_path_to_npp
)
list
(
APPEND CUDA_NPP_LIBRARIES -Wl,-rpath
"-Wl,
${
_cuda_path_to_npp
}
"
)
endif
()
endif
()
set
(
CUDA_NPP_FOUND TRUE
)
...
...
tests/gpu/src/arithm.cpp
View file @
fbdb4f4a
...
...
@@ -117,13 +117,13 @@ void CV_GpuArithmTest::run( int )
try
{
const
int
types
[]
=
{
CV_8UC1
,
CV_8UC3
,
CV_8UC4
,
CV_32FC1
};
const
char
*
type_names
[]
=
{
"CV_8UC1
"
,
"CV_8UC3"
,
"CV_8UC4
"
,
"CV_32FC1"
};
const
char
*
type_names
[]
=
{
"CV_8UC1
"
,
"CV_8UC3 "
,
"CV_8UC4
"
,
"CV_32FC1"
};
const
int
type_count
=
sizeof
(
types
)
/
sizeof
(
types
[
0
]);
//run tests
for
(
int
t
=
0
;
t
<
type_count
;
++
t
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
========Start test %s========
\n
"
,
type_names
[
t
]);
ts
->
printf
(
CvTS
::
LOG
,
"
Start testing %s
"
,
type_names
[
t
]);
if
(
CvTS
::
OK
==
test
(
types
[
t
]))
ts
->
printf
(
CvTS
::
LOG
,
"SUCCESS
\n
"
);
...
...
@@ -155,7 +155,7 @@ struct CV_GpuNppImageAddTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC4
&&
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -181,7 +181,7 @@ struct CV_GpuNppImageSubtractTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC4
&&
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -207,7 +207,7 @@ struct CV_GpuNppImageMultiplyTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC4
&&
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -233,7 +233,7 @@ struct CV_GpuNppImageDivideTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC4
&&
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -259,7 +259,7 @@ struct CV_GpuNppImageTransposeTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_8UC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -284,7 +284,7 @@ struct CV_GpuNppImageAbsdiffTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC4
&&
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -310,7 +310,7 @@ struct CV_GpuNppImageCompareTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -350,7 +350,7 @@ struct CV_GpuNppImageMeanStdDevTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_8UC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -391,7 +391,7 @@ struct CV_GpuNppImageNormTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_8UC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -429,7 +429,7 @@ struct CV_GpuNppImageFlipTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC4
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -468,7 +468,7 @@ struct CV_GpuNppImageSumTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC4
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -491,7 +491,7 @@ struct CV_GpuNppImageLUTTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC3
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -519,7 +519,7 @@ struct CV_GpuNppImageExpTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -544,7 +544,7 @@ struct CV_GpuNppImageLogTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -569,7 +569,7 @@ struct CV_GpuNppImageMagnitudeTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -595,7 +595,7 @@ struct CV_GpuNppImagePhaseTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -621,7 +621,7 @@ struct CV_GpuNppImageCartToPolarTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
@@ -650,7 +650,7 @@ struct CV_GpuNppImagePolarToCartTest : public CV_GpuArithmTest
{
if
(
mat1
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\
n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\
t
Unsupported type
\t
"
);
return
CvTS
::
OK
;
}
...
...
tests/gpu/src/filters.cpp
View file @
fbdb4f4a
...
...
@@ -83,7 +83,7 @@ protected:
if
(
res
<=
1
)
return
CvTS
::
OK
;
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Norm: %f
\n
"
,
res
);
ts
->
printf
(
CvTS
::
LOG
,
"Norm: %f
\n
"
,
res
);
return
CvTS
::
FAIL_GENERIC
;
}
};
...
...
@@ -244,7 +244,7 @@ struct CV_GpuNppImageGaussianBlurTest : public CV_GpuNppFilterTest
{
cv
::
Size
ksize
(
ksizes
[
i
],
ksizes
[
j
]);
ts
->
printf
(
CvTS
::
LOG
,
"
\n
ksize = (%dx%d)
\n
"
,
ksizes
[
i
],
ksizes
[
j
]);
ts
->
printf
(
CvTS
::
LOG
,
"
ksize = (%dx%d)
\t
"
,
ksizes
[
i
],
ksizes
[
j
]);
Mat
cpudst
;
cv
::
GaussianBlur
(
img
,
cpudst
,
ksize
,
sigma1
);
...
...
tests/gpu/src/gputest_main.cpp
View file @
fbdb4f4a
...
...
@@ -45,7 +45,7 @@ CvTS test_system("gpu");
const
char
*
blacklist
[]
=
{
"GPU-
MatOperatorAsyncCall
"
,
// crash
"GPU-
AsyncGpuMatOperator
"
,
// crash
"GPU-NppImageSum"
,
// crash, probably npp bug
...
...
tests/gpu/src/imgproc_gpu.cpp
View file @
fbdb4f4a
...
...
@@ -112,7 +112,7 @@ int CV_GpuImageProcTest::CheckNorm(const Mat& m1, const Mat& m2)
}
else
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Norm: %f
\n
"
,
ret
);
ts
->
printf
(
CvTS
::
LOG
,
"Norm: %f
\n
"
,
ret
);
return
CvTS
::
FAIL_GENERIC
;
}
}
...
...
@@ -134,37 +134,37 @@ void CV_GpuImageProcTest::run( int )
//run tests
ts
->
printf
(
CvTS
::
LOG
,
"
\n
========Start test 8UC1========
\n
"
);
if
(
test8UC1
(
img
)
==
CvTS
::
OK
)
ts
->
printf
(
CvTS
::
LOG
,
"
\n
SUCCESS
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"SUCCESS
\n
"
);
else
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
FAIL
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"FAIL
\n
"
);
testResult
=
CvTS
::
FAIL_GENERIC
;
}
ts
->
printf
(
CvTS
::
LOG
,
"
\n
========Start test 8UC4========
\n
"
);
if
(
test8UC4
(
img
)
==
CvTS
::
OK
)
ts
->
printf
(
CvTS
::
LOG
,
"
\n
SUCCESS
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"SUCCESS
\n
"
);
else
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
FAIL
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"FAIL
\n
"
);
testResult
=
CvTS
::
FAIL_GENERIC
;
}
ts
->
printf
(
CvTS
::
LOG
,
"
\n
========Start test 32SC1========
\n
"
);
if
(
test32SC1
(
img
)
==
CvTS
::
OK
)
ts
->
printf
(
CvTS
::
LOG
,
"
\n
SUCCESS
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"SUCCESS
\n
"
);
else
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
FAIL
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"FAIL
\n
"
);
testResult
=
CvTS
::
FAIL_GENERIC
;
}
ts
->
printf
(
CvTS
::
LOG
,
"
\n
========Start test 32FC1========
\n
"
);
if
(
test32FC1
(
img
)
==
CvTS
::
OK
)
ts
->
printf
(
CvTS
::
LOG
,
"
\n
SUCCESS
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"SUCCESS
\n
"
);
else
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
FAIL
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"FAIL
\n
"
);
testResult
=
CvTS
::
FAIL_GENERIC
;
}
}
...
...
@@ -216,7 +216,7 @@ struct CV_GpuNppImageResizeTest : public CV_GpuImageProcTest
{
if
(
img
.
type
()
!=
CV_8UC1
&&
img
.
type
()
!=
CV_8UC4
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Unsupported type
\n
"
);
ts
->
printf
(
CvTS
::
LOG
,
"Unsupported type
\n
"
);
return
CvTS
::
OK
;
}
...
...
@@ -228,7 +228,7 @@ struct CV_GpuNppImageResizeTest : public CV_GpuImageProcTest
for
(
int
i
=
0
;
i
<
interpolations_num
;
++
i
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Interpolation type
: %s
\n
"
,
interpolations_str
[
i
]);
ts
->
printf
(
CvTS
::
LOG
,
"
Interpolation
: %s
\n
"
,
interpolations_str
[
i
]);
Mat
cpu_res
;
cv
::
resize
(
img
,
cpu_res
,
Size
(),
0.5
,
0.5
,
interpolations
[
i
]);
...
...
tests/gpu/src/operator_async_call.cpp
View file @
fbdb4f4a
...
...
@@ -52,16 +52,16 @@ using namespace cv;
using
namespace
std
;
using
namespace
gpu
;
class
CV_
GpuMatAsyncCall
Test
:
public
CvTest
class
CV_
AsyncGpuMat
Test
:
public
CvTest
{
public
:
CV_
GpuMatAsyncCallTest
()
:
CvTest
(
"GPU-MatOperatorAsyncCall
"
,
"async"
)
CV_
AsyncGpuMatTest
()
:
CvTest
(
"GPU-AsyncGpuMatOperator
"
,
"async"
)
{
rows
=
234
;
cols
=
123
;
}
~
CV_
GpuMatAsyncCall
Test
()
{}
~
CV_
AsyncGpuMat
Test
()
{}
protected
:
void
run
(
int
);
...
...
@@ -75,9 +75,9 @@ class CV_GpuMatAsyncCallTest : public CvTest
};
template
<
typename
T
>
void
CV_
GpuMatAsyncCall
Test
::
print_mat
(
const
T
&
mat
,
const
std
::
string
&
name
)
const
{
cv
::
imshow
(
name
,
mat
);
}
void
CV_
AsyncGpuMat
Test
::
print_mat
(
const
T
&
mat
,
const
std
::
string
&
name
)
const
{
cv
::
imshow
(
name
,
mat
);
}
bool
CV_
GpuMatAsyncCall
Test
::
compare_matrix
(
cv
::
Mat
&
cpumat
)
bool
CV_
AsyncGpuMat
Test
::
compare_matrix
(
cv
::
Mat
&
cpumat
)
{
Mat
cmat
(
cpumat
.
size
(),
cpumat
.
type
(),
Scalar
::
all
(
0
));
GpuMat
gmat0
(
cmat
);
...
...
@@ -125,7 +125,7 @@ bool CV_GpuMatAsyncCallTest::compare_matrix(cv::Mat & cpumat)
}
}
void
CV_
GpuMatAsyncCall
Test
::
run
(
int
/* start_from */
)
void
CV_
AsyncGpuMat
Test
::
run
(
int
/* start_from */
)
{
bool
is_test_good
=
true
;
...
...
@@ -155,4 +155,4 @@ void CV_GpuMatAsyncCallTest::run( int /* start_from */)
/////////////////////////////////////////////////////////////////////////////
CV_
GpuMatAsyncCallTest
CV_GpuMatAsyncCall
_test
;
CV_
AsyncGpuMatTest
CV_AsyncGpuMatTest
_test
;
tests/gpu/src/stereo_bm.cpp
View file @
fbdb4f4a
...
...
@@ -43,6 +43,7 @@
#include <iostream>
#include <string>
#include "opencv2/highgui/highgui.hpp"
struct
CV_GpuStereoBMTest
:
public
CvTest
{
...
...
@@ -70,6 +71,15 @@ struct CV_GpuStereoBMTest : public CvTest
disp
.
convertTo
(
disp
,
img_reference
.
type
());
double
norm
=
cv
::
norm
(
disp
,
img_reference
,
cv
::
NORM_INF
);
//cv::imwrite(std::string(ts->get_data_path()) + "stereobm/aloe-disp.png", disp);
/*cv::imshow("disp", disp);
cv::imshow("img_reference", img_reference);
cv::Mat diff = (cv::Mat)disp - (cv::Mat)img_reference;
cv::imshow("diff", diff);
cv::waitKey();*/
if
(
norm
>=
100
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
StereoBM norm = %f
\n
"
,
norm
);
...
...
tests/gpu/src/stereo_bm_async.cpp
View file @
fbdb4f4a
...
...
@@ -44,11 +44,11 @@
using
namespace
cv
;
using
namespace
std
;
struct
CV_
GpuMatAsyncCall
StereoBMTest
:
public
CvTest
struct
CV_
Async
StereoBMTest
:
public
CvTest
{
public
:
CV_
GpuMatAsyncCallStereoBMTest
()
:
CvTest
(
"GPU-MatAsyncCall
StereoBM"
,
"asyncStereoBM"
)
{}
~
CV_
GpuMatAsyncCall
StereoBMTest
()
{}
CV_
AsyncStereoBMTest
()
:
CvTest
(
"GPU-Async
StereoBM"
,
"asyncStereoBM"
)
{}
~
CV_
Async
StereoBMTest
()
{}
void
run
(
int
/* start_from */
)
{
...
...
@@ -100,4 +100,4 @@ struct CV_GpuMatAsyncCallStereoBMTest : public CvTest
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
CV_
GpuMatAsyncCallStereoBMTest
CV_GpuMatAsyncCall
StereoBMTest_test
;
CV_
AsyncStereoBMTest
CV_Async
StereoBMTest_test
;
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