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
a1e5bd71
Commit
a1e5bd71
authored
Mar 19, 2014
by
Roman Donchenko
Committed by
OpenCV Buildbot
Mar 19, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2446 from asmorkalov:ocv_implicit_cuda_control
parents
bff92da9
b4e4f13f
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
56 additions
and
25 deletions
+56
-25
OpenCVModule.cmake
cmake/OpenCVModule.cmake
+37
-15
CMakeLists.txt
modules/nonfree/CMakeLists.txt
+1
-1
CMakeLists.txt
modules/superres/CMakeLists.txt
+7
-2
btv_l1_gpu.cpp
modules/superres/src/btv_l1_gpu.cpp
+1
-1
btv_l1_gpu.cu
modules/superres/src/cuda/btv_l1_gpu.cu
+1
-1
frame_source.cpp
modules/superres/src/frame_source.cpp
+1
-1
input_array_utility.cpp
modules/superres/src/input_array_utility.cpp
+1
-1
optical_flow.cpp
modules/superres/src/optical_flow.cpp
+1
-1
precomp.hpp
modules/superres/src/precomp.hpp
+1
-1
CMakeLists.txt
samples/gpu/CMakeLists.txt
+1
-1
brox_optical_flow.cpp
samples/gpu/brox_optical_flow.cpp
+1
-0
opticalflow_nvidia_api.cpp
samples/gpu/opticalflow_nvidia_api.cpp
+1
-0
super_resolution.cpp
samples/gpu/super_resolution.cpp
+2
-0
No files found.
cmake/OpenCVModule.cmake
View file @
a1e5bd71
...
@@ -27,7 +27,8 @@
...
@@ -27,7 +27,8 @@
# The verbose template for OpenCV module:
# The verbose template for OpenCV module:
#
#
# ocv_add_module(modname <dependencies>)
# ocv_add_module(modname <dependencies>)
# ocv_glob_module_sources() or glob them manually and ocv_set_module_sources(...)
# ocv_glob_module_sources(([EXCLUDE_CUDA] <extra sources&headers>)
# or glob them manually and ocv_set_module_sources(...)
# ocv_module_include_directories(<extra include directories>)
# ocv_module_include_directories(<extra include directories>)
# ocv_create_module()
# ocv_create_module()
# <add extra link dependencies, compiler options, etc>
# <add extra link dependencies, compiler options, etc>
...
@@ -478,8 +479,14 @@ endmacro()
...
@@ -478,8 +479,14 @@ endmacro()
# finds and sets headers and sources for the standard OpenCV module
# finds and sets headers and sources for the standard OpenCV module
# Usage:
# Usage:
# ocv_glob_module_sources(<extra sources&headers in the same format as used in ocv_set_module_sources>)
# ocv_glob_module_sources(
[EXCLUDE_CUDA]
<extra sources&headers in the same format as used in ocv_set_module_sources>)
macro
(
ocv_glob_module_sources
)
macro
(
ocv_glob_module_sources
)
set
(
_argn
${
ARGN
}
)
list
(
FIND _argn
"EXCLUDE_CUDA"
exclude_cuda
)
if
(
NOT exclude_cuda EQUAL -1
)
list
(
REMOVE_AT _argn
${
exclude_cuda
}
)
endif
()
file
(
GLOB_RECURSE lib_srcs
"src/*.cpp"
)
file
(
GLOB_RECURSE lib_srcs
"src/*.cpp"
)
file
(
GLOB_RECURSE lib_int_hdrs
"src/*.hpp"
"src/*.h"
)
file
(
GLOB_RECURSE lib_int_hdrs
"src/*.hpp"
"src/*.h"
)
file
(
GLOB lib_hdrs
"include/opencv2/
${
name
}
/*.hpp"
"include/opencv2/
${
name
}
/*.h"
)
file
(
GLOB lib_hdrs
"include/opencv2/
${
name
}
/*.hpp"
"include/opencv2/
${
name
}
/*.h"
)
...
@@ -489,15 +496,21 @@ macro(ocv_glob_module_sources)
...
@@ -489,15 +496,21 @@ macro(ocv_glob_module_sources)
list
(
APPEND lib_srcs
${
lib_srcs_apple
}
)
list
(
APPEND lib_srcs
${
lib_srcs_apple
}
)
endif
()
endif
()
file
(
GLOB lib_cuda_srcs
"src/cuda/*.cu"
)
if
(
exclude_cuda EQUAL -1
)
set
(
cuda_objs
""
)
file
(
GLOB lib_cuda_srcs
"src/cuda/*.cu"
)
set
(
lib_cuda_hdrs
""
)
set
(
cuda_objs
""
)
if
(
HAVE_CUDA
)
set
(
lib_cuda_hdrs
""
)
ocv_include_directories
(
${
CUDA_INCLUDE_DIRS
}
)
if
(
HAVE_CUDA
)
file
(
GLOB lib_cuda_hdrs
"src/cuda/*.hpp"
)
ocv_include_directories
(
${
CUDA_INCLUDE_DIRS
}
)
file
(
GLOB lib_cuda_hdrs
"src/cuda/*.hpp"
)
ocv_cuda_compile
(
cuda_objs
${
lib_cuda_srcs
}
${
lib_cuda_hdrs
}
)
ocv_cuda_compile
(
cuda_objs
${
lib_cuda_srcs
}
${
lib_cuda_hdrs
}
)
source_group
(
"Src
\\
Cuda"
FILES
${
lib_cuda_srcs
}
${
lib_cuda_hdrs
}
)
source_group
(
"Src
\\
Cuda"
FILES
${
lib_cuda_srcs
}
${
lib_cuda_hdrs
}
)
endif
()
else
()
set
(
cuda_objs
""
)
set
(
lib_cuda_srcs
""
)
set
(
lib_cuda_hdrs
""
)
endif
()
endif
()
source_group
(
"Src"
FILES
${
lib_srcs
}
${
lib_int_hdrs
}
)
source_group
(
"Src"
FILES
${
lib_srcs
}
${
lib_int_hdrs
}
)
...
@@ -516,8 +529,8 @@ macro(ocv_glob_module_sources)
...
@@ -516,8 +529,8 @@ macro(ocv_glob_module_sources)
source_group
(
"Include"
FILES
${
lib_hdrs
}
)
source_group
(
"Include"
FILES
${
lib_hdrs
}
)
source_group
(
"Include
\\
detail"
FILES
${
lib_hdrs_detail
}
)
source_group
(
"Include
\\
detail"
FILES
${
lib_hdrs_detail
}
)
ocv_set_module_sources
(
${
ARGN
}
HEADERS
${
lib_hdrs
}
${
lib_hdrs_detail
}
ocv_set_module_sources
(
${
_argn
}
HEADERS
${
lib_hdrs
}
${
lib_hdrs_detail
}
SOURCES
${
lib_srcs
}
${
lib_int_hdrs
}
${
cuda_objs
}
${
lib_cuda_srcs
}
${
lib_cuda_hdrs
}
)
SOURCES
${
lib_srcs
}
${
lib_int_hdrs
}
${
cuda_objs
}
${
lib_cuda_srcs
}
${
lib_cuda_hdrs
}
)
endmacro
()
endmacro
()
# creates OpenCV module in current folder
# creates OpenCV module in current folder
...
@@ -616,11 +629,20 @@ endmacro()
...
@@ -616,11 +629,20 @@ endmacro()
# short command for adding simple OpenCV module
# short command for adding simple OpenCV module
# see ocv_add_module for argument details
# see ocv_add_module for argument details
# Usage:
# Usage:
# ocv_define_module(module_name [INTERNAL] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
# ocv_define_module(module_name [INTERNAL] [
EXCLUDE_CUDA] [
REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
macro
(
ocv_define_module module_name
)
macro
(
ocv_define_module module_name
)
ocv_add_module
(
${
module_name
}
${
ARGN
}
)
set
(
_argn
${
ARGN
}
)
set
(
exclude_cuda
""
)
foreach
(
arg
${
_argn
}
)
if
(
"
${
arg
}
"
STREQUAL
"EXCLUDE_CUDA"
)
set
(
exclude_cuda
"
${
arg
}
"
)
list
(
REMOVE_ITEM _argn
${
arg
}
)
endif
()
endforeach
()
ocv_add_module
(
${
module_name
}
${
_argn
}
)
ocv_module_include_directories
()
ocv_module_include_directories
()
ocv_glob_module_sources
()
ocv_glob_module_sources
(
${
exclude_cuda
}
)
ocv_create_module
()
ocv_create_module
()
ocv_add_precompiled_headers
(
${
the_module
}
)
ocv_add_precompiled_headers
(
${
the_module
}
)
...
...
modules/nonfree/CMakeLists.txt
View file @
a1e5bd71
...
@@ -6,7 +6,7 @@ set(the_description "Functionality with possible limitations on the use")
...
@@ -6,7 +6,7 @@ set(the_description "Functionality with possible limitations on the use")
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wundef -Wshadow
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wundef -Wshadow
)
if
(
ENABLE_DYNAMIC_CUDA
)
if
(
ENABLE_DYNAMIC_CUDA
)
add_definitions
(
-DDYNAMIC_CUDA_SUPPORT
)
add_definitions
(
-DDYNAMIC_CUDA_SUPPORT
)
ocv_define_module
(
nonfree opencv_imgproc opencv_features2d opencv_calib3d OPTIONAL opencv_ocl
)
ocv_define_module
(
nonfree
EXCLUDE_CUDA
opencv_imgproc opencv_features2d opencv_calib3d OPTIONAL opencv_ocl
)
else
()
else
()
ocv_define_module
(
nonfree opencv_imgproc opencv_features2d opencv_calib3d OPTIONAL opencv_gpu opencv_ocl
)
ocv_define_module
(
nonfree opencv_imgproc opencv_features2d opencv_calib3d OPTIONAL opencv_gpu opencv_ocl
)
endif
()
endif
()
modules/superres/CMakeLists.txt
View file @
a1e5bd71
if
(
ANDROID OR
IOS
)
if
(
IOS
)
ocv_module_disable
(
superres
)
ocv_module_disable
(
superres
)
endif
()
endif
()
set
(
the_description
"Super Resolution"
)
set
(
the_description
"Super Resolution"
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS /wd4127 -Wundef -Wshadow
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS /wd4127 -Wundef -Wshadow
)
ocv_define_module
(
superres opencv_imgproc opencv_video OPTIONAL opencv_gpu opencv_highgui opencv_ocl
${
CUDA_LIBRARIES
}
${
CUDA_npp_LIBRARY
}
)
if
(
ENABLE_DYNAMIC_CUDA
)
add_definitions
(
-DDYNAMIC_CUDA_SUPPORT
)
ocv_define_module
(
superres EXCLUDE_CUDA opencv_imgproc opencv_video OPTIONAL opencv_highgui opencv_ocl
)
else
()
ocv_define_module
(
superres opencv_imgproc opencv_video OPTIONAL opencv_gpu opencv_highgui opencv_ocl
${
CUDA_LIBRARIES
}
${
CUDA_npp_LIBRARY
}
)
endif
()
modules/superres/src/btv_l1_gpu.cpp
View file @
a1e5bd71
...
@@ -51,7 +51,7 @@ using namespace cv::gpu;
...
@@ -51,7 +51,7 @@ using namespace cv::gpu;
using
namespace
cv
::
superres
;
using
namespace
cv
::
superres
;
using
namespace
cv
::
superres
::
detail
;
using
namespace
cv
::
superres
::
detail
;
#if !defined(HAVE_CUDA) || !defined(HAVE_OPENCV_GPU)
#if !defined(HAVE_CUDA) || !defined(HAVE_OPENCV_GPU)
|| defined(DYNAMIC_CUDA_SUPPORT)
Ptr
<
SuperResolution
>
cv
::
superres
::
createSuperResolution_BTVL1_GPU
()
Ptr
<
SuperResolution
>
cv
::
superres
::
createSuperResolution_BTVL1_GPU
()
{
{
...
...
modules/superres/src/cuda/btv_l1_gpu.cu
View file @
a1e5bd71
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
#include "opencv2/opencv_modules.hpp"
#include "opencv2/opencv_modules.hpp"
#if
def HAVE_OPENCV_GPU
#if
defined(HAVE_OPENCV_GPU) && !defined(DYNAMIC_CUDA_SUPPORT)
#include "opencv2/gpu/device/common.hpp"
#include "opencv2/gpu/device/common.hpp"
#include "opencv2/gpu/device/transform.hpp"
#include "opencv2/gpu/device/transform.hpp"
...
...
modules/superres/src/frame_source.cpp
View file @
a1e5bd71
...
@@ -200,7 +200,7 @@ Ptr<FrameSource> cv::superres::createFrameSource_Camera(int deviceId)
...
@@ -200,7 +200,7 @@ Ptr<FrameSource> cv::superres::createFrameSource_Camera(int deviceId)
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
// VideoFrameSource_GPU
// VideoFrameSource_GPU
#if
ndef HAVE_OPENCV_GPU
#if
!defined(HAVE_OPENCV_GPU) || defined(DYNAMIC_CUDA_SUPPORT)
Ptr
<
FrameSource
>
cv
::
superres
::
createFrameSource_Video_GPU
(
const
string
&
fileName
)
Ptr
<
FrameSource
>
cv
::
superres
::
createFrameSource_Video_GPU
(
const
string
&
fileName
)
{
{
...
...
modules/superres/src/input_array_utility.cpp
View file @
a1e5bd71
...
@@ -207,7 +207,7 @@ namespace
...
@@ -207,7 +207,7 @@ namespace
switch
(
src
.
kind
())
switch
(
src
.
kind
())
{
{
case
_InputArray
:
:
GPU_MAT
:
case
_InputArray
:
:
GPU_MAT
:
#if
def HAVE_OPENCV_GPU
#if
defined(HAVE_OPENCV_GPU) && !defined(DYNAMIC_CUDA_SUPPORT)
gpu
::
cvtColor
(
src
.
getGpuMat
(),
dst
.
getGpuMatRef
(),
code
,
cn
);
gpu
::
cvtColor
(
src
.
getGpuMat
(),
dst
.
getGpuMatRef
(),
code
,
cn
);
#else
#else
CV_Error
(
CV_StsNotImplemented
,
"The called functionality is disabled for current build or platform"
);
CV_Error
(
CV_StsNotImplemented
,
"The called functionality is disabled for current build or platform"
);
...
...
modules/superres/src/optical_flow.cpp
View file @
a1e5bd71
...
@@ -344,7 +344,7 @@ Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_DualTVL1()
...
@@ -344,7 +344,7 @@ Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_DualTVL1()
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// GpuOpticalFlow
// GpuOpticalFlow
#if
ndef HAVE_OPENCV_GPU
#if
!defined(HAVE_OPENCV_GPU) || defined(DYNAMIC_CUDA_SUPPORT)
Ptr
<
DenseOpticalFlowExt
>
cv
::
superres
::
createOptFlow_Farneback_GPU
()
Ptr
<
DenseOpticalFlowExt
>
cv
::
superres
::
createOptFlow_Farneback_GPU
()
{
{
...
...
modules/superres/src/precomp.hpp
View file @
a1e5bd71
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/video/tracking.hpp"
#include "opencv2/video/tracking.hpp"
#if
def HAVE_OPENCV_GPU
#if
defined(HAVE_OPENCV_GPU) && !defined(DYNAMIC_CUDA_SUPPORT)
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/gpu/gpu.hpp"
#ifdef HAVE_CUDA
#ifdef HAVE_CUDA
#include "opencv2/gpu/stream_accessor.hpp"
#include "opencv2/gpu/stream_accessor.hpp"
...
...
samples/gpu/CMakeLists.txt
View file @
a1e5bd71
...
@@ -41,7 +41,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
...
@@ -41,7 +41,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
target_link_libraries
(
${
the_target
}
${
OPENCV_LINKER_LIBS
}
${
OPENCV_GPU_SAMPLES_REQUIRED_DEPS
}
)
target_link_libraries
(
${
the_target
}
${
OPENCV_LINKER_LIBS
}
${
OPENCV_GPU_SAMPLES_REQUIRED_DEPS
}
)
if
(
HAVE_CUDA
)
if
(
HAVE_CUDA
AND NOT ANDROID
)
target_link_libraries
(
${
the_target
}
${
CUDA_CUDA_LIBRARY
}
)
target_link_libraries
(
${
the_target
}
${
CUDA_CUDA_LIBRARY
}
)
endif
()
endif
()
...
...
samples/gpu/brox_optical_flow.cpp
View file @
a1e5bd71
#include <iostream>
#include <iostream>
#include <iomanip>
#include <iomanip>
#include <string>
#include <string>
#include <ctype.h>
#include "cvconfig.h"
#include "cvconfig.h"
#include "opencv2/core/core.hpp"
#include "opencv2/core/core.hpp"
...
...
samples/gpu/opticalflow_nvidia_api.cpp
View file @
a1e5bd71
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include <memory>
#include <memory>
#include <exception>
#include <exception>
#include <ctime>
#include <ctime>
#include <ctype.h>
#include "cvconfig.h"
#include "cvconfig.h"
#include <iostream>
#include <iostream>
...
...
samples/gpu/super_resolution.cpp
View file @
a1e5bd71
#include <iostream>
#include <iostream>
#include <iomanip>
#include <iomanip>
#include <string>
#include <string>
#include <ctype.h>
#include "opencv2/core/core.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc/imgproc.hpp"
...
...
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