From a57707b8d812b16a45c7fb9a3b0bb100bac2e662 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Sun, 31 Mar 2013 14:54:23 +0400 Subject: [PATCH 01/12] moved device layer to core module --- modules/core/CMakeLists.txt | 8 ++++-- .../include/opencv2/core}/device/block.hpp | 0 .../core}/device/border_interpolate.hpp | 0 .../include/opencv2/core}/device/color.hpp | 0 .../include/opencv2/core}/device/common.hpp | 0 .../opencv2/core}/device/datamov_utils.hpp | 0 .../core}/device/detail/color_detail.hpp | 0 .../opencv2/core}/device/detail/reduce.hpp | 0 .../core}/device/detail/reduce_key_val.hpp | 0 .../core}/device/detail/transform_detail.hpp | 0 .../device/detail/type_traits_detail.hpp | 0 .../device/detail/vec_distance_detail.hpp | 0 .../opencv2/core}/device/dynamic_smem.hpp | 0 .../opencv2/core}/device/emulation.hpp | 0 .../include/opencv2/core}/device/filters.hpp | 0 .../opencv2/core}/device/funcattrib.hpp | 0 .../opencv2/core}/device/functional.hpp | 0 .../include/opencv2/core}/device/limits.hpp | 0 .../include/opencv2/core}/device/reduce.hpp | 0 .../opencv2/core}/device/saturate_cast.hpp | 0 .../include/opencv2/core}/device/scan.hpp | 8 +++--- .../opencv2/core}/device/simd_functions.hpp | 0 .../opencv2/core}/device/static_check.hpp | 0 .../opencv2/core}/device/transform.hpp | 0 .../opencv2/core}/device/type_traits.hpp | 0 .../include/opencv2/core}/device/utility.hpp | 0 .../opencv2/core}/device/vec_distance.hpp | 0 .../include/opencv2/core}/device/vec_math.hpp | 0 .../opencv2/core}/device/vec_traits.hpp | 0 .../include/opencv2/core}/device/warp.hpp | 0 .../opencv2/core}/device/warp_reduce.hpp | 0 .../opencv2/core}/device/warp_shuffle.hpp | 0 modules/core/src/cuda/matrix_operations.cu | 8 +++--- modules/gpu/CMakeLists.txt | 4 +-- modules/gpu/src/cuda/NV12ToARGB.cu | 2 +- modules/gpu/src/cuda/bf_knnmatch.cu | 14 +++++----- modules/gpu/src/cuda/bf_match.cu | 12 ++++---- modules/gpu/src/cuda/bf_radius_match.cu | 10 +++---- modules/gpu/src/cuda/bgfg_gmg.cu | 6 ++-- modules/gpu/src/cuda/bgfg_mog.cu | 8 +++--- modules/gpu/src/cuda/bilateral_filter.cu | 8 +++--- modules/gpu/src/cuda/blend.cu | 2 +- modules/gpu/src/cuda/calib3d.cu | 8 +++--- modules/gpu/src/cuda/canny.cu | 10 +++---- modules/gpu/src/cuda/ccomponetns.cu | 8 +++--- modules/gpu/src/cuda/clahe.cu | 12 ++++---- modules/gpu/src/cuda/color.cu | 6 ++-- modules/gpu/src/cuda/column_filter.h | 8 +++--- modules/gpu/src/cuda/copy_make_border.cu | 4 +-- modules/gpu/src/cuda/debayer.cu | 12 ++++---- modules/gpu/src/cuda/disp_bilateral_filter.cu | 4 +-- modules/gpu/src/cuda/element_operations.cu | 14 +++++----- modules/gpu/src/cuda/fast.cu | 4 +-- modules/gpu/src/cuda/fgd_bgfg.cu | 12 ++++---- modules/gpu/src/cuda/gftt.cu | 4 +-- modules/gpu/src/cuda/global_motion.cu | 2 +- modules/gpu/src/cuda/hist.cu | 8 +++--- modules/gpu/src/cuda/hog.cu | 8 +++--- modules/gpu/src/cuda/hough.cu | 10 +++---- modules/gpu/src/cuda/imgproc.cu | 10 +++---- modules/gpu/src/cuda/integral_image.cu | 2 +- modules/gpu/src/cuda/internal_shared.hpp | 2 +- modules/gpu/src/cuda/lbp.cu | 4 +-- modules/gpu/src/cuda/lbp.hpp | 4 +-- modules/gpu/src/cuda/match_template.cu | 4 +-- modules/gpu/src/cuda/mathfunc.cu | 2 +- modules/gpu/src/cuda/matrix_reductions.cu | 18 ++++++------ modules/gpu/src/cuda/nlm.cu | 12 ++++---- modules/gpu/src/cuda/optflowbm.cu | 8 +++--- modules/gpu/src/cuda/optical_flow.cu | 2 +- .../gpu/src/cuda/optical_flow_farneback.cu | 4 +-- modules/gpu/src/cuda/orb.cu | 6 ++-- modules/gpu/src/cuda/pyr_down.cu | 10 +++---- modules/gpu/src/cuda/pyr_up.cu | 10 +++---- modules/gpu/src/cuda/pyrlk.cu | 12 ++++---- modules/gpu/src/cuda/remap.cu | 12 ++++---- modules/gpu/src/cuda/resize.cu | 14 +++++----- modules/gpu/src/cuda/rgb_to_yv12.cu | 4 +-- modules/gpu/src/cuda/row_filter.h | 8 +++--- modules/gpu/src/cuda/split_merge.cu | 2 +- modules/gpu/src/cuda/stereobm.cu | 2 +- modules/gpu/src/cuda/stereobp.cu | 6 ++-- modules/gpu/src/cuda/stereocsbp.cu | 10 +++---- modules/gpu/src/cuda/tvl1flow.cu | 6 ++-- modules/gpu/src/cuda/warp.cu | 12 ++++---- modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu | 2 +- .../gpu/src/nvidia/NCVHaarObjectDetection.cu | 4 +-- .../gpu/src/nvidia/NPP_staging/NPP_staging.cu | 4 +-- modules/gpu/src/nvidia/core/NCVPyramid.cu | 2 +- modules/nonfree/src/cuda/surf.cu | 14 +++++----- modules/nonfree/src/cuda/vibe.cu | 2 +- modules/nonfree/src/precomp.hpp | 2 +- modules/softcascade/src/cuda_invoker.hpp | 3 +- modules/superres/CMakeLists.txt | 28 ++----------------- modules/superres/src/cuda/btv_l1_gpu.cu | 8 +++--- 95 files changed, 228 insertions(+), 251 deletions(-) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/block.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/border_interpolate.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/color.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/common.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/datamov_utils.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/detail/color_detail.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/detail/reduce.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/detail/reduce_key_val.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/detail/transform_detail.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/detail/type_traits_detail.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/detail/vec_distance_detail.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/dynamic_smem.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/emulation.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/filters.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/funcattrib.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/functional.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/limits.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/reduce.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/saturate_cast.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/scan.hpp (98%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/simd_functions.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/static_check.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/transform.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/type_traits.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/utility.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/vec_distance.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/vec_math.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/vec_traits.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/warp.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/warp_reduce.hpp (100%) rename modules/{gpu/include/opencv2/gpu => core/include/opencv2/core}/device/warp_shuffle.hpp (100%) diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index e538d1aca..6b5c3accc 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -1,12 +1,16 @@ set(the_description "The Core Functionality") ocv_add_module(core ${ZLIB_LIBRARIES}) -ocv_module_include_directories(${ZLIB_INCLUDE_DIR} "${OpenCV_SOURCE_DIR}/modules/gpu/include") +ocv_module_include_directories(${ZLIB_INCLUDE_DIR}) if(HAVE_CUDA) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef) endif() -ocv_glob_module_sources(SOURCES "${opencv_core_BINARY_DIR}/version_string.inc") +file(GLOB lib_device_hdrs "include/opencv2/${name}/device/*.hpp" "include/opencv2/${name}/device/*.h") +file(GLOB lib_device_hdrs_detail "include/opencv2/${name}/device/detail/*.hpp" "include/opencv2/${name}/device/detail/*.h") +ocv_glob_module_sources(SOURCES "${opencv_core_BINARY_DIR}/version_string.inc" + HEADERS ${lib_device_hdrs} ${lib_device_hdrs_detail}) + ocv_create_module() ocv_add_precompiled_headers(${the_module}) diff --git a/modules/gpu/include/opencv2/gpu/device/block.hpp b/modules/core/include/opencv2/core/device/block.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/block.hpp rename to modules/core/include/opencv2/core/device/block.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/border_interpolate.hpp b/modules/core/include/opencv2/core/device/border_interpolate.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/border_interpolate.hpp rename to modules/core/include/opencv2/core/device/border_interpolate.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/color.hpp b/modules/core/include/opencv2/core/device/color.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/color.hpp rename to modules/core/include/opencv2/core/device/color.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/common.hpp b/modules/core/include/opencv2/core/device/common.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/common.hpp rename to modules/core/include/opencv2/core/device/common.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/datamov_utils.hpp b/modules/core/include/opencv2/core/device/datamov_utils.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/datamov_utils.hpp rename to modules/core/include/opencv2/core/device/datamov_utils.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/detail/color_detail.hpp b/modules/core/include/opencv2/core/device/detail/color_detail.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/detail/color_detail.hpp rename to modules/core/include/opencv2/core/device/detail/color_detail.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/detail/reduce.hpp b/modules/core/include/opencv2/core/device/detail/reduce.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/detail/reduce.hpp rename to modules/core/include/opencv2/core/device/detail/reduce.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/detail/reduce_key_val.hpp b/modules/core/include/opencv2/core/device/detail/reduce_key_val.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/detail/reduce_key_val.hpp rename to modules/core/include/opencv2/core/device/detail/reduce_key_val.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/detail/transform_detail.hpp b/modules/core/include/opencv2/core/device/detail/transform_detail.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/detail/transform_detail.hpp rename to modules/core/include/opencv2/core/device/detail/transform_detail.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/detail/type_traits_detail.hpp b/modules/core/include/opencv2/core/device/detail/type_traits_detail.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/detail/type_traits_detail.hpp rename to modules/core/include/opencv2/core/device/detail/type_traits_detail.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/detail/vec_distance_detail.hpp b/modules/core/include/opencv2/core/device/detail/vec_distance_detail.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/detail/vec_distance_detail.hpp rename to modules/core/include/opencv2/core/device/detail/vec_distance_detail.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/dynamic_smem.hpp b/modules/core/include/opencv2/core/device/dynamic_smem.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/dynamic_smem.hpp rename to modules/core/include/opencv2/core/device/dynamic_smem.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/emulation.hpp b/modules/core/include/opencv2/core/device/emulation.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/emulation.hpp rename to modules/core/include/opencv2/core/device/emulation.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/filters.hpp b/modules/core/include/opencv2/core/device/filters.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/filters.hpp rename to modules/core/include/opencv2/core/device/filters.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/funcattrib.hpp b/modules/core/include/opencv2/core/device/funcattrib.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/funcattrib.hpp rename to modules/core/include/opencv2/core/device/funcattrib.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/functional.hpp b/modules/core/include/opencv2/core/device/functional.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/functional.hpp rename to modules/core/include/opencv2/core/device/functional.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/limits.hpp b/modules/core/include/opencv2/core/device/limits.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/limits.hpp rename to modules/core/include/opencv2/core/device/limits.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/reduce.hpp b/modules/core/include/opencv2/core/device/reduce.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/reduce.hpp rename to modules/core/include/opencv2/core/device/reduce.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/saturate_cast.hpp b/modules/core/include/opencv2/core/device/saturate_cast.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/saturate_cast.hpp rename to modules/core/include/opencv2/core/device/saturate_cast.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/scan.hpp b/modules/core/include/opencv2/core/device/scan.hpp similarity index 98% rename from modules/gpu/include/opencv2/gpu/device/scan.hpp rename to modules/core/include/opencv2/core/device/scan.hpp index 3d8da16f8..777754c54 100644 --- a/modules/gpu/include/opencv2/gpu/device/scan.hpp +++ b/modules/core/include/opencv2/core/device/scan.hpp @@ -43,10 +43,10 @@ #ifndef __OPENCV_GPU_SCAN_HPP__ #define __OPENCV_GPU_SCAN_HPP__ -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/utility.hpp" -#include "opencv2/gpu/device/warp.hpp" -#include "opencv2/gpu/device/warp_shuffle.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/device/warp.hpp" +#include "opencv2/core/device/warp_shuffle.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/include/opencv2/gpu/device/simd_functions.hpp b/modules/core/include/opencv2/core/device/simd_functions.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/simd_functions.hpp rename to modules/core/include/opencv2/core/device/simd_functions.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/static_check.hpp b/modules/core/include/opencv2/core/device/static_check.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/static_check.hpp rename to modules/core/include/opencv2/core/device/static_check.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/transform.hpp b/modules/core/include/opencv2/core/device/transform.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/transform.hpp rename to modules/core/include/opencv2/core/device/transform.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/type_traits.hpp b/modules/core/include/opencv2/core/device/type_traits.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/type_traits.hpp rename to modules/core/include/opencv2/core/device/type_traits.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/utility.hpp b/modules/core/include/opencv2/core/device/utility.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/utility.hpp rename to modules/core/include/opencv2/core/device/utility.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/vec_distance.hpp b/modules/core/include/opencv2/core/device/vec_distance.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/vec_distance.hpp rename to modules/core/include/opencv2/core/device/vec_distance.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/vec_math.hpp b/modules/core/include/opencv2/core/device/vec_math.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/vec_math.hpp rename to modules/core/include/opencv2/core/device/vec_math.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/vec_traits.hpp b/modules/core/include/opencv2/core/device/vec_traits.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/vec_traits.hpp rename to modules/core/include/opencv2/core/device/vec_traits.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/warp.hpp b/modules/core/include/opencv2/core/device/warp.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/warp.hpp rename to modules/core/include/opencv2/core/device/warp.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/warp_reduce.hpp b/modules/core/include/opencv2/core/device/warp_reduce.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/warp_reduce.hpp rename to modules/core/include/opencv2/core/device/warp_reduce.hpp diff --git a/modules/gpu/include/opencv2/gpu/device/warp_shuffle.hpp b/modules/core/include/opencv2/core/device/warp_shuffle.hpp similarity index 100% rename from modules/gpu/include/opencv2/gpu/device/warp_shuffle.hpp rename to modules/core/include/opencv2/core/device/warp_shuffle.hpp diff --git a/modules/core/src/cuda/matrix_operations.cu b/modules/core/src/cuda/matrix_operations.cu index c9b12de10..dd67c544f 100644 --- a/modules/core/src/cuda/matrix_operations.cu +++ b/modules/core/src/cuda/matrix_operations.cu @@ -40,10 +40,10 @@ // //M*/ -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/transform.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/type_traits.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/transform.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/type_traits.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/CMakeLists.txt b/modules/gpu/CMakeLists.txt index 3472b2fa0..b9f2e90c9 100644 --- a/modules/gpu/CMakeLists.txt +++ b/modules/gpu/CMakeLists.txt @@ -8,8 +8,6 @@ ocv_add_module(gpu opencv_imgproc opencv_calib3d opencv_objdetect opencv_video o ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/cuda") file(GLOB lib_hdrs "include/opencv2/*.hpp" "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h") -file(GLOB lib_device_hdrs "include/opencv2/${name}/device/*.hpp" "include/opencv2/${name}/device/*.h") -file(GLOB lib_device_hdrs_detail "include/opencv2/${name}/device/detail/*.hpp" "include/opencv2/${name}/device/detail/*.h") file(GLOB lib_int_hdrs "src/*.hpp" "src/*.h") file(GLOB lib_cuda_hdrs "src/cuda/*.hpp" "src/cuda/*.h") file(GLOB lib_srcs "src/*.cpp") @@ -64,7 +62,7 @@ else() endif() ocv_set_module_sources( - HEADERS ${lib_hdrs} ${lib_device_hdrs} ${lib_device_hdrs_detail} + HEADERS ${lib_hdrs} SOURCES ${lib_int_hdrs} ${lib_cuda_hdrs} ${lib_srcs} ${lib_cuda} ${ncv_files} ${cuda_objs} ) diff --git a/modules/gpu/src/cuda/NV12ToARGB.cu b/modules/gpu/src/cuda/NV12ToARGB.cu index 99aeba6fd..45e44a5d0 100644 --- a/modules/gpu/src/cuda/NV12ToARGB.cu +++ b/modules/gpu/src/cuda/NV12ToARGB.cu @@ -49,7 +49,7 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" +#include "opencv2/core/device/common.hpp" namespace cv { namespace gpu { namespace device { namespace video_decoding diff --git a/modules/gpu/src/cuda/bf_knnmatch.cu b/modules/gpu/src/cuda/bf_knnmatch.cu index 66e37d088..2177bb26b 100644 --- a/modules/gpu/src/cuda/bf_knnmatch.cu +++ b/modules/gpu/src/cuda/bf_knnmatch.cu @@ -42,13 +42,13 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/utility.hpp" -#include "opencv2/gpu/device/reduce.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/vec_distance.hpp" -#include "opencv2/gpu/device/datamov_utils.hpp" -#include "opencv2/gpu/device/warp_shuffle.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/vec_distance.hpp" +#include "opencv2/core/device/datamov_utils.hpp" +#include "opencv2/core/device/warp_shuffle.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/bf_match.cu b/modules/gpu/src/cuda/bf_match.cu index f7bdcdc0f..c3efa7419 100644 --- a/modules/gpu/src/cuda/bf_match.cu +++ b/modules/gpu/src/cuda/bf_match.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/utility.hpp" -#include "opencv2/gpu/device/reduce.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/vec_distance.hpp" -#include "opencv2/gpu/device/datamov_utils.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/vec_distance.hpp" +#include "opencv2/core/device/datamov_utils.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/bf_radius_match.cu b/modules/gpu/src/cuda/bf_radius_match.cu index 44cd2b55f..d5ba42f21 100644 --- a/modules/gpu/src/cuda/bf_radius_match.cu +++ b/modules/gpu/src/cuda/bf_radius_match.cu @@ -42,11 +42,11 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/utility.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/vec_distance.hpp" -#include "opencv2/gpu/device/datamov_utils.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/vec_distance.hpp" +#include "opencv2/core/device/datamov_utils.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/bgfg_gmg.cu b/modules/gpu/src/cuda/bgfg_gmg.cu index f0f78c933..a94381550 100644 --- a/modules/gpu/src/cuda/bgfg_gmg.cu +++ b/modules/gpu/src/cuda/bgfg_gmg.cu @@ -42,9 +42,9 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/limits.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/limits.hpp" namespace cv { namespace gpu { namespace device { namespace bgfg_gmg diff --git a/modules/gpu/src/cuda/bgfg_mog.cu b/modules/gpu/src/cuda/bgfg_mog.cu index 89ad5ff0b..57ab1f238 100644 --- a/modules/gpu/src/cuda/bgfg_mog.cu +++ b/modules/gpu/src/cuda/bgfg_mog.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/limits.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/limits.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/bilateral_filter.cu b/modules/gpu/src/cuda/bilateral_filter.cu index 2a3e67253..64a2a3053 100644 --- a/modules/gpu/src/cuda/bilateral_filter.cu +++ b/modules/gpu/src/cuda/bilateral_filter.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/border_interpolate.hpp" using namespace cv::gpu; diff --git a/modules/gpu/src/cuda/blend.cu b/modules/gpu/src/cuda/blend.cu index 5cfcb5168..db49e6cc5 100644 --- a/modules/gpu/src/cuda/blend.cu +++ b/modules/gpu/src/cuda/blend.cu @@ -42,7 +42,7 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" +#include "opencv2/core/device/common.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/calib3d.cu b/modules/gpu/src/cuda/calib3d.cu index 0fd482c41..2c122fde0 100644 --- a/modules/gpu/src/cuda/calib3d.cu +++ b/modules/gpu/src/cuda/calib3d.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/transform.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/reduce.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/transform.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/reduce.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/canny.cu b/modules/gpu/src/cuda/canny.cu index 1afcddc9c..2b7bcf763 100644 --- a/modules/gpu/src/cuda/canny.cu +++ b/modules/gpu/src/cuda/canny.cu @@ -44,11 +44,11 @@ #include #include //std::swap -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/emulation.hpp" -#include "opencv2/gpu/device/transform.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/utility.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/emulation.hpp" +#include "opencv2/core/device/transform.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/utility.hpp" using namespace cv::gpu; using namespace cv::gpu::device; diff --git a/modules/gpu/src/cuda/ccomponetns.cu b/modules/gpu/src/cuda/ccomponetns.cu index 7f3d4ae33..5519efeb2 100644 --- a/modules/gpu/src/cuda/ccomponetns.cu +++ b/modules/gpu/src/cuda/ccomponetns.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/modules/gpu/src/cuda/clahe.cu b/modules/gpu/src/cuda/clahe.cu index a0c30d582..35ce9c1a0 100644 --- a/modules/gpu/src/cuda/clahe.cu +++ b/modules/gpu/src/cuda/clahe.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/emulation.hpp" -#include "opencv2/gpu/device/scan.hpp" -#include "opencv2/gpu/device/reduce.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/emulation.hpp" +#include "opencv2/core/device/scan.hpp" +#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/device/saturate_cast.hpp" using namespace cv::gpu; using namespace cv::gpu::device; diff --git a/modules/gpu/src/cuda/color.cu b/modules/gpu/src/cuda/color.cu index 8de91d12b..61794e2a8 100644 --- a/modules/gpu/src/cuda/color.cu +++ b/modules/gpu/src/cuda/color.cu @@ -42,9 +42,9 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/transform.hpp" -#include "opencv2/gpu/device/color.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/transform.hpp" +#include "opencv2/core/device/color.hpp" #include "cvt_color_internal.h" namespace cv { namespace gpu { namespace device diff --git a/modules/gpu/src/cuda/column_filter.h b/modules/gpu/src/cuda/column_filter.h index 46e358315..d28ceafc6 100644 --- a/modules/gpu/src/cuda/column_filter.h +++ b/modules/gpu/src/cuda/column_filter.h @@ -40,10 +40,10 @@ // //M*/ -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/border_interpolate.hpp" using namespace cv::gpu; using namespace cv::gpu::device; diff --git a/modules/gpu/src/cuda/copy_make_border.cu b/modules/gpu/src/cuda/copy_make_border.cu index ad0d05f7d..3797c09aa 100644 --- a/modules/gpu/src/cuda/copy_make_border.cu +++ b/modules/gpu/src/cuda/copy_make_border.cu @@ -42,8 +42,8 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/border_interpolate.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/debayer.cu b/modules/gpu/src/cuda/debayer.cu index 1d2f18e7a..468c12f08 100644 --- a/modules/gpu/src/cuda/debayer.cu +++ b/modules/gpu/src/cuda/debayer.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/color.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/color.hpp" +#include "opencv2/core/device/saturate_cast.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/disp_bilateral_filter.cu b/modules/gpu/src/cuda/disp_bilateral_filter.cu index 2bf18a466..9a01b8dce 100644 --- a/modules/gpu/src/cuda/disp_bilateral_filter.cu +++ b/modules/gpu/src/cuda/disp_bilateral_filter.cu @@ -42,8 +42,8 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/limits.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/limits.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/element_operations.cu b/modules/gpu/src/cuda/element_operations.cu index e9397e534..06003e999 100644 --- a/modules/gpu/src/cuda/element_operations.cu +++ b/modules/gpu/src/cuda/element_operations.cu @@ -42,13 +42,13 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/transform.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/simd_functions.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/transform.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/simd_functions.hpp" using namespace cv::gpu; using namespace cv::gpu::device; diff --git a/modules/gpu/src/cuda/fast.cu b/modules/gpu/src/cuda/fast.cu index 9bf1f7ad9..57a7a3489 100644 --- a/modules/gpu/src/cuda/fast.cu +++ b/modules/gpu/src/cuda/fast.cu @@ -42,8 +42,8 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/utility.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/utility.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/fgd_bgfg.cu b/modules/gpu/src/cuda/fgd_bgfg.cu index 9ecf890e9..ebc7cf5cf 100644 --- a/modules/gpu/src/cuda/fgd_bgfg.cu +++ b/modules/gpu/src/cuda/fgd_bgfg.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/utility.hpp" -#include "opencv2/gpu/device/reduce.hpp" -#include "opencv2/gpu/device/functional.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/device/functional.hpp" #include "fgd_bgfg_common.hpp" using namespace cv::gpu; diff --git a/modules/gpu/src/cuda/gftt.cu b/modules/gpu/src/cuda/gftt.cu index b5c3edb2d..593053dbf 100644 --- a/modules/gpu/src/cuda/gftt.cu +++ b/modules/gpu/src/cuda/gftt.cu @@ -45,8 +45,8 @@ #include #include -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/utility.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/utility.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/global_motion.cu b/modules/gpu/src/cuda/global_motion.cu index bad6fd5a2..79a19ddcf 100644 --- a/modules/gpu/src/cuda/global_motion.cu +++ b/modules/gpu/src/cuda/global_motion.cu @@ -45,7 +45,7 @@ #include #include #include -#include "opencv2/gpu/device/common.hpp" +#include "opencv2/core/device/common.hpp" namespace cv { namespace gpu { namespace device { namespace globmotion { diff --git a/modules/gpu/src/cuda/hist.cu b/modules/gpu/src/cuda/hist.cu index 8b8a1e8c6..2e67a4068 100644 --- a/modules/gpu/src/cuda/hist.cu +++ b/modules/gpu/src/cuda/hist.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/emulation.hpp" -#include "opencv2/gpu/device/transform.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/emulation.hpp" +#include "opencv2/core/device/transform.hpp" using namespace cv::gpu; using namespace cv::gpu::device; diff --git a/modules/gpu/src/cuda/hog.cu b/modules/gpu/src/cuda/hog.cu index 523e5bf64..34cc80ce7 100644 --- a/modules/gpu/src/cuda/hog.cu +++ b/modules/gpu/src/cuda/hog.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/reduce.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/warp_shuffle.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/warp_shuffle.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/hough.cu b/modules/gpu/src/cuda/hough.cu index faec89b95..1f885fbf6 100644 --- a/modules/gpu/src/cuda/hough.cu +++ b/modules/gpu/src/cuda/hough.cu @@ -45,11 +45,11 @@ #include #include -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/emulation.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/dynamic_smem.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/emulation.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/dynamic_smem.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/imgproc.cu b/modules/gpu/src/cuda/imgproc.cu index dfe5e63e2..0f59a771b 100644 --- a/modules/gpu/src/cuda/imgproc.cu +++ b/modules/gpu/src/cuda/imgproc.cu @@ -42,11 +42,11 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/border_interpolate.hpp" #include "internal_shared.hpp" namespace cv { namespace gpu { namespace device diff --git a/modules/gpu/src/cuda/integral_image.cu b/modules/gpu/src/cuda/integral_image.cu index 6b3275000..9ef316641 100644 --- a/modules/gpu/src/cuda/integral_image.cu +++ b/modules/gpu/src/cuda/integral_image.cu @@ -42,7 +42,7 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" +#include "opencv2/core/device/common.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/internal_shared.hpp b/modules/gpu/src/cuda/internal_shared.hpp index a0850d008..6e8461156 100644 --- a/modules/gpu/src/cuda/internal_shared.hpp +++ b/modules/gpu/src/cuda/internal_shared.hpp @@ -48,7 +48,7 @@ #include "NPP_staging.hpp" #include "opencv2/gpu/devmem2d.hpp" #include "safe_call.hpp" -#include "opencv2/gpu/device/common.hpp" +#include "opencv2/core/device/common.hpp" namespace cv { namespace gpu { diff --git a/modules/gpu/src/cuda/lbp.cu b/modules/gpu/src/cuda/lbp.cu index 06e730335..87dfbfca0 100644 --- a/modules/gpu/src/cuda/lbp.cu +++ b/modules/gpu/src/cuda/lbp.cu @@ -43,8 +43,8 @@ #if !defined CUDA_DISABLER #include "lbp.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/saturate_cast.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/lbp.hpp b/modules/gpu/src/cuda/lbp.hpp index 792a96a51..9cfebd575 100644 --- a/modules/gpu/src/cuda/lbp.hpp +++ b/modules/gpu/src/cuda/lbp.hpp @@ -43,8 +43,8 @@ #ifndef __OPENCV_GPU_DEVICE_LBP_HPP_ #define __OPENCV_GPU_DEVICE_LBP_HPP_ -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/emulation.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/emulation.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/match_template.cu b/modules/gpu/src/cuda/match_template.cu index 5f89faaf3..9ad3338d7 100644 --- a/modules/gpu/src/cuda/match_template.cu +++ b/modules/gpu/src/cuda/match_template.cu @@ -42,8 +42,8 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/vec_math.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/vec_math.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/mathfunc.cu b/modules/gpu/src/cuda/mathfunc.cu index 5571239eb..01ebf3dc3 100644 --- a/modules/gpu/src/cuda/mathfunc.cu +++ b/modules/gpu/src/cuda/mathfunc.cu @@ -42,7 +42,7 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" +#include "opencv2/core/device/common.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/matrix_reductions.cu b/modules/gpu/src/cuda/matrix_reductions.cu index 745daca1d..d0edea5ec 100644 --- a/modules/gpu/src/cuda/matrix_reductions.cu +++ b/modules/gpu/src/cuda/matrix_reductions.cu @@ -42,15 +42,15 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/reduce.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/utility.hpp" -#include "opencv2/gpu/device/type_traits.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/device/type_traits.hpp" using namespace cv::gpu; using namespace cv::gpu::device; diff --git a/modules/gpu/src/cuda/nlm.cu b/modules/gpu/src/cuda/nlm.cu index 922cba7e5..6fb5dbaa7 100644 --- a/modules/gpu/src/cuda/nlm.cu +++ b/modules/gpu/src/cuda/nlm.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/reduce.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/device/border_interpolate.hpp" using namespace cv::gpu; diff --git a/modules/gpu/src/cuda/optflowbm.cu b/modules/gpu/src/cuda/optflowbm.cu index 774b68d00..7cc4d2f3c 100644 --- a/modules/gpu/src/cuda/optflowbm.cu +++ b/modules/gpu/src/cuda/optflowbm.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/reduce.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/reduce.hpp" using namespace cv::gpu; using namespace cv::gpu::device; diff --git a/modules/gpu/src/cuda/optical_flow.cu b/modules/gpu/src/cuda/optical_flow.cu index d2c68a79f..a80d485e1 100644 --- a/modules/gpu/src/cuda/optical_flow.cu +++ b/modules/gpu/src/cuda/optical_flow.cu @@ -42,7 +42,7 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" +#include "opencv2/core/device/common.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/optical_flow_farneback.cu b/modules/gpu/src/cuda/optical_flow_farneback.cu index 9236962f4..f9f50c8d3 100644 --- a/modules/gpu/src/cuda/optical_flow_farneback.cu +++ b/modules/gpu/src/cuda/optical_flow_farneback.cu @@ -42,8 +42,8 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/border_interpolate.hpp" #define tx threadIdx.x #define ty threadIdx.y diff --git a/modules/gpu/src/cuda/orb.cu b/modules/gpu/src/cuda/orb.cu index 723bf28ff..9c4e0ff8e 100644 --- a/modules/gpu/src/cuda/orb.cu +++ b/modules/gpu/src/cuda/orb.cu @@ -45,9 +45,9 @@ #include #include -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/reduce.hpp" -#include "opencv2/gpu/device/functional.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/device/functional.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/pyr_down.cu b/modules/gpu/src/cuda/pyr_down.cu index e6ef64721..42442506f 100644 --- a/modules/gpu/src/cuda/pyr_down.cu +++ b/modules/gpu/src/cuda/pyr_down.cu @@ -42,11 +42,11 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/saturate_cast.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/pyr_up.cu b/modules/gpu/src/cuda/pyr_up.cu index a36c2b9ec..52ef35a9d 100644 --- a/modules/gpu/src/cuda/pyr_up.cu +++ b/modules/gpu/src/cuda/pyr_up.cu @@ -42,11 +42,11 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/saturate_cast.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/pyrlk.cu b/modules/gpu/src/cuda/pyrlk.cu index 8ef728b03..fc387a723 100644 --- a/modules/gpu/src/cuda/pyrlk.cu +++ b/modules/gpu/src/cuda/pyrlk.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/utility.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/reduce.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/reduce.hpp" using namespace cv::gpu; using namespace cv::gpu::device; diff --git a/modules/gpu/src/cuda/remap.cu b/modules/gpu/src/cuda/remap.cu index 40ecf66a4..4589834b4 100644 --- a/modules/gpu/src/cuda/remap.cu +++ b/modules/gpu/src/cuda/remap.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/filters.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/filters.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/resize.cu b/modules/gpu/src/cuda/resize.cu index e78bcc0cc..86f8d5501 100644 --- a/modules/gpu/src/cuda/resize.cu +++ b/modules/gpu/src/cuda/resize.cu @@ -43,13 +43,13 @@ #if !defined CUDA_DISABLER #include -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/filters.hpp" -#include "opencv2/gpu/device/scan.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/filters.hpp" +#include "opencv2/core/device/scan.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/rgb_to_yv12.cu b/modules/gpu/src/cuda/rgb_to_yv12.cu index e38368ab8..56800fc44 100644 --- a/modules/gpu/src/cuda/rgb_to_yv12.cu +++ b/modules/gpu/src/cuda/rgb_to_yv12.cu @@ -42,8 +42,8 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/vec_traits.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/row_filter.h b/modules/gpu/src/cuda/row_filter.h index 933f90029..beaee3755 100644 --- a/modules/gpu/src/cuda/row_filter.h +++ b/modules/gpu/src/cuda/row_filter.h @@ -40,10 +40,10 @@ // //M*/ -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/border_interpolate.hpp" using namespace cv::gpu; using namespace cv::gpu::device; diff --git a/modules/gpu/src/cuda/split_merge.cu b/modules/gpu/src/cuda/split_merge.cu index dad787da9..d92ecbc17 100644 --- a/modules/gpu/src/cuda/split_merge.cu +++ b/modules/gpu/src/cuda/split_merge.cu @@ -42,7 +42,7 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" +#include "opencv2/core/device/common.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/stereobm.cu b/modules/gpu/src/cuda/stereobm.cu index cfe8e76f5..10a63ecf4 100644 --- a/modules/gpu/src/cuda/stereobm.cu +++ b/modules/gpu/src/cuda/stereobm.cu @@ -42,7 +42,7 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" +#include "opencv2/core/device/common.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/stereobp.cu b/modules/gpu/src/cuda/stereobp.cu index f696b629b..2aa70bf92 100644 --- a/modules/gpu/src/cuda/stereobp.cu +++ b/modules/gpu/src/cuda/stereobp.cu @@ -42,9 +42,9 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/limits.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/limits.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/stereocsbp.cu b/modules/gpu/src/cuda/stereocsbp.cu index 7b76f478b..717398ea0 100644 --- a/modules/gpu/src/cuda/stereocsbp.cu +++ b/modules/gpu/src/cuda/stereocsbp.cu @@ -42,11 +42,11 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/reduce.hpp" -#include "opencv2/gpu/device/functional.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/device/functional.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/cuda/tvl1flow.cu b/modules/gpu/src/cuda/tvl1flow.cu index a2b934bf7..29470fb92 100644 --- a/modules/gpu/src/cuda/tvl1flow.cu +++ b/modules/gpu/src/cuda/tvl1flow.cu @@ -42,9 +42,9 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" -#include "opencv2/gpu/device/limits.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/device/limits.hpp" using namespace cv::gpu; using namespace cv::gpu::device; diff --git a/modules/gpu/src/cuda/warp.cu b/modules/gpu/src/cuda/warp.cu index 2f0317065..4a006448c 100644 --- a/modules/gpu/src/cuda/warp.cu +++ b/modules/gpu/src/cuda/warp.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/border_interpolate.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/filters.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/filters.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu b/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu index c4a270afd..881d12692 100644 --- a/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu +++ b/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu @@ -65,7 +65,7 @@ #include "NPP_staging/NPP_staging.hpp" #include "NCVBroxOpticalFlow.hpp" -#include "opencv2/gpu/device/utility.hpp" +#include "opencv2/core/device/utility.hpp" typedef NCVVectorAlloc FloatVector; diff --git a/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu b/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu index c137b2a1e..4ff632b07 100644 --- a/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu +++ b/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu @@ -66,8 +66,8 @@ #include "NPP_staging/NPP_staging.hpp" #include "NCVRuntimeTemplates.hpp" #include "NCVHaarObjectDetection.hpp" -#include "opencv2/gpu/device/warp.hpp" -#include "opencv2/gpu/device/warp_shuffle.hpp" +#include "opencv2/core/device/warp.hpp" +#include "opencv2/core/device/warp_shuffle.hpp" //============================================================================== diff --git a/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu b/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu index 525feb68b..8d898175e 100644 --- a/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu +++ b/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu @@ -45,8 +45,8 @@ #include #include #include "NPP_staging.hpp" -#include "opencv2/gpu/device/warp.hpp" -#include "opencv2/gpu/device/warp_shuffle.hpp" +#include "opencv2/core/device/warp.hpp" +#include "opencv2/core/device/warp_shuffle.hpp" texture tex8u; diff --git a/modules/gpu/src/nvidia/core/NCVPyramid.cu b/modules/gpu/src/nvidia/core/NCVPyramid.cu index 3cb3a33f4..89d1d4b36 100644 --- a/modules/gpu/src/nvidia/core/NCVPyramid.cu +++ b/modules/gpu/src/nvidia/core/NCVPyramid.cu @@ -48,7 +48,7 @@ #include "NCVAlg.hpp" #include "NCVPyramid.hpp" #include "NCVPixelOperations.hpp" -#include "opencv2/gpu/device/common.hpp" +#include "opencv2/core/device/common.hpp" template struct __average4_CN {static __host__ __device__ T _average4_CN(const T &p00, const T &p01, const T &p10, const T &p11);}; diff --git a/modules/nonfree/src/cuda/surf.cu b/modules/nonfree/src/cuda/surf.cu index 4cd8182f9..39de3c368 100644 --- a/modules/nonfree/src/cuda/surf.cu +++ b/modules/nonfree/src/cuda/surf.cu @@ -44,13 +44,13 @@ #ifdef HAVE_OPENCV_GPU -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/limits.hpp" -#include "opencv2/gpu/device/saturate_cast.hpp" -#include "opencv2/gpu/device/reduce.hpp" -#include "opencv2/gpu/device/utility.hpp" -#include "opencv2/gpu/device/functional.hpp" -#include "opencv2/gpu/device/filters.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/device/filters.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/nonfree/src/cuda/vibe.cu b/modules/nonfree/src/cuda/vibe.cu index 7276e7ab6..52cbed79c 100644 --- a/modules/nonfree/src/cuda/vibe.cu +++ b/modules/nonfree/src/cuda/vibe.cu @@ -44,7 +44,7 @@ #ifdef HAVE_OPENCV_GPU -#include "opencv2/gpu/device/common.hpp" +#include "opencv2/core/device/common.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/nonfree/src/precomp.hpp b/modules/nonfree/src/precomp.hpp index 1cbb36d13..51d2aba41 100644 --- a/modules/nonfree/src/precomp.hpp +++ b/modules/nonfree/src/precomp.hpp @@ -56,7 +56,7 @@ #if defined(HAVE_CUDA) #include "opencv2/core/stream_accessor.hpp" - #include "opencv2/gpu/device/common.hpp" + #include "opencv2/core/device/common.hpp" static inline void throw_nogpu() { CV_Error(CV_StsNotImplemented, "The called functionality is disabled for current build or platform"); } #else diff --git a/modules/softcascade/src/cuda_invoker.hpp b/modules/softcascade/src/cuda_invoker.hpp index 9589b6ff5..135f40546 100644 --- a/modules/softcascade/src/cuda_invoker.hpp +++ b/modules/softcascade/src/cuda_invoker.hpp @@ -44,7 +44,6 @@ #ifndef __OPENCV_ICF_HPP__ #define __OPENCV_ICF_HPP__ -// #include #include "opencv2/core/cuda_devptrs.hpp" #include "cuda_runtime_api.h" @@ -154,4 +153,4 @@ struct CascadeInvoker }}} -#endif \ No newline at end of file +#endif diff --git a/modules/superres/CMakeLists.txt b/modules/superres/CMakeLists.txt index 92ce01c2d..6c6022c72 100644 --- a/modules/superres/CMakeLists.txt +++ b/modules/superres/CMakeLists.txt @@ -3,29 +3,5 @@ if(ANDROID OR IOS) endif() set(the_description "Super Resolution") -ocv_add_module(superres opencv_imgproc opencv_video OPTIONAL opencv_gpu opencv_highgui) -ocv_module_include_directories() - -ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef /wd4127) - -if(HAVE_CUDA) - ocv_source_group("Src\\Cuda" GLOB "src/cuda/*.cu") - ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpu/include" ${CUDA_INCLUDE_DIRS}) - - file(GLOB lib_cuda "src/cuda/*.cu") - ocv_cuda_compile(cuda_objs ${lib_cuda}) - - set(cuda_link_libs ${CUDA_LIBRARIES}) -else() - set(lib_cuda "") - set(cuda_objs "") - set(cuda_link_libs "") -endif() - -ocv_glob_module_sources(SOURCES ${lib_cuda} ${cuda_objs}) - -ocv_create_module(${cuda_link_libs}) -ocv_add_precompiled_headers(${the_module}) - -ocv_add_accuracy_tests() -ocv_add_perf_tests() +ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127 -Wundef) +ocv_define_module(superres opencv_imgproc opencv_video OPTIONAL opencv_gpu opencv_highgui) diff --git a/modules/superres/src/cuda/btv_l1_gpu.cu b/modules/superres/src/cuda/btv_l1_gpu.cu index b27671aa0..2bb93d131 100644 --- a/modules/superres/src/cuda/btv_l1_gpu.cu +++ b/modules/superres/src/cuda/btv_l1_gpu.cu @@ -40,10 +40,10 @@ // //M*/ -#include "opencv2/gpu/device/common.hpp" -#include "opencv2/gpu/device/transform.hpp" -#include "opencv2/gpu/device/vec_traits.hpp" -#include "opencv2/gpu/device/vec_math.hpp" +#include "opencv2/core/device/common.hpp" +#include "opencv2/core/device/transform.hpp" +#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/device/vec_math.hpp" using namespace cv::gpu; using namespace cv::gpu::device; From 28b1e81883653f59acf42fb268d8610d26707274 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Wed, 3 Apr 2013 16:04:04 +0400 Subject: [PATCH 02/12] renamed device -> cuda --- cmake/OpenCVModule.cmake | 16 +- modules/core/CMakeLists.txt | 6 +- .../opencv2/core/{device => cuda}/block.hpp | 2 +- .../{device => cuda}/border_interpolate.hpp | 4 +- .../opencv2/core/{device => cuda}/color.hpp | 4 +- .../opencv2/core/{device => cuda}/common.hpp | 2 +- .../core/{device => cuda}/datamov_utils.hpp | 4 +- .../{device => cuda}/detail/color_detail.hpp | 70 ++++---- .../core/{device => cuda}/detail/reduce.hpp | 2 +- .../detail/reduce_key_val.hpp | 2 +- .../detail/transform_detail.hpp | 4 +- .../detail/type_traits_detail.hpp | 4 +- .../detail/vec_distance_detail.hpp | 4 +- .../core/{device => cuda}/dynamic_smem.hpp | 2 +- .../core/{device => cuda}/emulation.hpp | 4 +- .../opencv2/core/{device => cuda}/filters.hpp | 4 +- .../core/{device => cuda}/funcattrib.hpp | 4 +- .../core/{device => cuda}/functional.hpp | 4 +- .../opencv2/core/{device => cuda}/limits.hpp | 4 +- .../opencv2/core/{device => cuda}/reduce.hpp | 2 +- .../core/{device => cuda}/saturate_cast.hpp | 2 +- .../opencv2/core/{device => cuda}/scan.hpp | 14 +- .../core/{device => cuda}/simd_functions.hpp | 2 +- .../core/{device => cuda}/static_check.hpp | 2 +- .../core/{device => cuda}/transform.hpp | 2 +- .../core/{device => cuda}/type_traits.hpp | 2 +- .../opencv2/core/{device => cuda}/utility.hpp | 4 +- .../core/{device => cuda}/vec_distance.hpp | 4 +- .../core/{device => cuda}/vec_math.hpp | 4 +- .../core/{device => cuda}/vec_traits.hpp | 4 +- .../opencv2/core/{device => cuda}/warp.hpp | 4 +- .../core/{device => cuda}/warp_reduce.hpp | 4 +- .../core/{device => cuda}/warp_shuffle.hpp | 2 +- .../include/opencv2/core/cuda_devptrs.hpp | 18 -- modules/core/src/cuda/matrix_operations.cu | 20 +-- modules/core/src/gpumat.cpp | 12 +- modules/gpu/src/arithm.cpp | 6 +- modules/gpu/src/bgfg_gmg.cpp | 6 +- modules/gpu/src/bgfg_mog.cpp | 12 +- modules/gpu/src/bilateral_filter.cpp | 4 +- modules/gpu/src/blend.cpp | 4 +- modules/gpu/src/brute_force_matcher.cpp | 14 +- modules/gpu/src/calib3d.cpp | 4 +- modules/gpu/src/cascadeclassifier.cpp | 6 +- modules/gpu/src/color.cpp | 162 +++++++++--------- modules/gpu/src/cuda/NV12ToARGB.cu | 4 +- modules/gpu/src/cuda/bf_knnmatch.cu | 18 +- modules/gpu/src/cuda/bf_match.cu | 16 +- modules/gpu/src/cuda/bf_radius_match.cu | 14 +- modules/gpu/src/cuda/bgfg_gmg.cu | 8 +- modules/gpu/src/cuda/bgfg_mog.cu | 10 +- modules/gpu/src/cuda/bilateral_filter.cu | 12 +- modules/gpu/src/cuda/blend.cu | 6 +- modules/gpu/src/cuda/calib3d.cu | 16 +- modules/gpu/src/cuda/canny.cu | 16 +- modules/gpu/src/cuda/ccomponetns.cu | 10 +- modules/gpu/src/cuda/clahe.cu | 14 +- modules/gpu/src/cuda/color.cu | 12 +- modules/gpu/src/cuda/column_filter.h | 10 +- modules/gpu/src/cuda/copy_make_border.cu | 8 +- modules/gpu/src/cuda/debayer.cu | 14 +- modules/gpu/src/cuda/disp_bilateral_filter.cu | 8 +- modules/gpu/src/cuda/element_operations.cu | 72 ++++---- modules/gpu/src/cuda/fast.cu | 6 +- modules/gpu/src/cuda/fgd_bgfg.cu | 14 +- modules/gpu/src/cuda/gftt.cu | 6 +- modules/gpu/src/cuda/global_motion.cu | 4 +- modules/gpu/src/cuda/hist.cu | 12 +- modules/gpu/src/cuda/hog.cu | 12 +- modules/gpu/src/cuda/hough.cu | 14 +- modules/gpu/src/cuda/imgproc.cu | 14 +- modules/gpu/src/cuda/integral_image.cu | 4 +- modules/gpu/src/cuda/internal_shared.hpp | 2 +- modules/gpu/src/cuda/lbp.cu | 6 +- modules/gpu/src/cuda/lbp.hpp | 6 +- modules/gpu/src/cuda/match_template.cu | 8 +- modules/gpu/src/cuda/mathfunc.cu | 6 +- modules/gpu/src/cuda/matrix_reductions.cu | 42 ++--- modules/gpu/src/cuda/nlm.cu | 24 +-- modules/gpu/src/cuda/optflowbm.cu | 10 +- modules/gpu/src/cuda/optical_flow.cu | 4 +- .../gpu/src/cuda/optical_flow_farneback.cu | 8 +- modules/gpu/src/cuda/orb.cu | 8 +- modules/gpu/src/cuda/pyr_down.cu | 14 +- modules/gpu/src/cuda/pyr_up.cu | 14 +- modules/gpu/src/cuda/pyrlk.cu | 14 +- modules/gpu/src/cuda/remap.cu | 16 +- modules/gpu/src/cuda/resize.cu | 18 +- modules/gpu/src/cuda/rgb_to_yv12.cu | 6 +- modules/gpu/src/cuda/row_filter.h | 10 +- modules/gpu/src/cuda/split_merge.cu | 6 +- modules/gpu/src/cuda/stereobm.cu | 6 +- modules/gpu/src/cuda/stereobp.cu | 12 +- modules/gpu/src/cuda/stereocsbp.cu | 16 +- modules/gpu/src/cuda/texture_binder.hpp | 2 +- modules/gpu/src/cuda/tvl1flow.cu | 8 +- modules/gpu/src/cuda/warp.cu | 16 +- modules/gpu/src/cvt_color_internal.h | 2 +- modules/gpu/src/denoising.cpp | 16 +- modules/gpu/src/fast.cpp | 6 +- modules/gpu/src/filtering.cpp | 6 +- modules/gpu/src/gftt.cpp | 4 +- modules/gpu/src/global_motion.cpp | 6 +- modules/gpu/src/graphcuts.cpp | 12 +- modules/gpu/src/hog.cpp | 4 +- modules/gpu/src/hough.cpp | 42 ++--- modules/gpu/src/imgproc.cpp | 68 ++++---- modules/gpu/src/match_template.cpp | 4 +- modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu | 6 +- .../gpu/src/nvidia/NCVHaarObjectDetection.cu | 8 +- .../gpu/src/nvidia/NPP_staging/NPP_staging.cu | 8 +- modules/gpu/src/nvidia/core/NCVPyramid.cu | 6 +- modules/gpu/src/optical_flow.cpp | 4 +- modules/gpu/src/optical_flow_farneback.cpp | 38 ++-- modules/gpu/src/orb.cpp | 12 +- modules/gpu/src/pyramids.cpp | 14 +- modules/gpu/src/remap.cpp | 4 +- modules/gpu/src/resize.cpp | 4 +- modules/gpu/src/split_merge.cpp | 6 +- modules/gpu/src/stereobm.cpp | 4 +- modules/gpu/src/stereobp.cpp | 4 +- modules/gpu/src/stereocsbp.cpp | 4 +- modules/gpu/src/video_reader.cpp | 4 +- modules/gpu/src/video_writer.cpp | 4 +- modules/gpu/src/warp.cpp | 10 +- modules/nonfree/src/cuda/surf.cu | 22 +-- modules/nonfree/src/cuda/vibe.cu | 6 +- modules/nonfree/src/precomp.hpp | 2 +- modules/nonfree/src/surf_gpu.cpp | 4 +- modules/nonfree/src/vibe_gpu.cpp | 6 +- modules/softcascade/src/cuda/channels.cu | 2 +- modules/softcascade/src/cuda/icf-sc.cu | 2 +- modules/softcascade/src/cuda_invoker.hpp | 2 +- modules/softcascade/src/detector_cuda.cpp | 48 +++--- modules/superres/src/btv_l1_gpu.cpp | 16 +- modules/superres/src/cuda/btv_l1_gpu.cu | 20 +-- 136 files changed, 762 insertions(+), 780 deletions(-) rename modules/core/include/opencv2/core/{device => cuda}/block.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/border_interpolate.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/color.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/common.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/datamov_utils.hpp (97%) rename modules/core/include/opencv2/core/{device => cuda}/detail/color_detail.hpp (98%) rename modules/core/include/opencv2/core/{device => cuda}/detail/reduce.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/detail/reduce_key_val.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/detail/transform_detail.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/detail/type_traits_detail.hpp (98%) rename modules/core/include/opencv2/core/{device => cuda}/detail/vec_distance_detail.hpp (98%) rename modules/core/include/opencv2/core/{device => cuda}/dynamic_smem.hpp (98%) rename modules/core/include/opencv2/core/{device => cuda}/emulation.hpp (97%) rename modules/core/include/opencv2/core/{device => cuda}/filters.hpp (98%) rename modules/core/include/opencv2/core/{device => cuda}/funcattrib.hpp (96%) rename modules/core/include/opencv2/core/{device => cuda}/functional.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/limits.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/reduce.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/saturate_cast.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/scan.hpp (96%) rename modules/core/include/opencv2/core/{device => cuda}/simd_functions.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/static_check.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/transform.hpp (98%) rename modules/core/include/opencv2/core/{device => cuda}/type_traits.hpp (98%) rename modules/core/include/opencv2/core/{device => cuda}/utility.hpp (98%) rename modules/core/include/opencv2/core/{device => cuda}/vec_distance.hpp (98%) rename modules/core/include/opencv2/core/{device => cuda}/vec_math.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/vec_traits.hpp (99%) rename modules/core/include/opencv2/core/{device => cuda}/warp.hpp (97%) rename modules/core/include/opencv2/core/{device => cuda}/warp_reduce.hpp (96%) rename modules/core/include/opencv2/core/{device => cuda}/warp_shuffle.hpp (99%) diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 1ce9c8917..fe31b70aa 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -432,16 +432,16 @@ macro(ocv_glob_module_sources) file(GLOB lib_hdrs "include/opencv2/*.hpp" "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h") file(GLOB lib_hdrs_detail "include/opencv2/${name}/detail/*.hpp" "include/opencv2/${name}/detail/*.h") - file(GLOB lib_device_srcs "src/cuda/*.cu") - set(device_objs "") - set(lib_device_hdrs "") + file(GLOB lib_cuda_srcs "src/cuda/*.cu") + set(cuda_objs "") + set(lib_cuda_hdrs "") - if (HAVE_CUDA AND lib_device_srcs) + if(HAVE_CUDA AND lib_cuda_srcs) ocv_include_directories(${CUDA_INCLUDE_DIRS}) - file(GLOB lib_device_hdrs "src/cuda/*.hpp") + file(GLOB lib_cuda_hdrs "src/cuda/*.hpp") - ocv_cuda_compile(device_objs ${lib_device_srcs} ${lib_device_hdrs}) - source_group("Src\\Cuda" FILES ${lib_device_srcs} ${lib_device_hdrs}) + ocv_cuda_compile(cuda_objs ${lib_cuda_srcs} ${lib_cuda_hdrs}) + source_group("Src\\Cuda" FILES ${lib_cuda_srcs} ${lib_cuda_hdrs}) endif() file(GLOB cl_kernels "src/opencl/*.cl") @@ -457,7 +457,7 @@ macro(ocv_glob_module_sources) endif() ocv_set_module_sources(${ARGN} HEADERS ${lib_hdrs} ${lib_hdrs_detail} - SOURCES ${lib_srcs} ${lib_int_hdrs} ${device_objs} ${lib_device_srcs} ${lib_device_hdrs}) + SOURCES ${lib_srcs} ${lib_int_hdrs} ${cuda_objs} ${lib_cuda_srcs} ${lib_cuda_hdrs}) source_group("Src" FILES ${lib_srcs} ${lib_int_hdrs}) source_group("Include" FILES ${lib_hdrs}) diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 6b5c3accc..f2b130deb 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -6,10 +6,10 @@ if(HAVE_CUDA) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef) endif() -file(GLOB lib_device_hdrs "include/opencv2/${name}/device/*.hpp" "include/opencv2/${name}/device/*.h") -file(GLOB lib_device_hdrs_detail "include/opencv2/${name}/device/detail/*.hpp" "include/opencv2/${name}/device/detail/*.h") +file(GLOB lib_cuda_hdrs "include/opencv2/${name}/cuda/*.hpp" "include/opencv2/${name}/cuda/*.h") +file(GLOB lib_cuda_hdrs_detail "include/opencv2/${name}/cuda/detail/*.hpp" "include/opencv2/${name}/cuda/detail/*.h") ocv_glob_module_sources(SOURCES "${opencv_core_BINARY_DIR}/version_string.inc" - HEADERS ${lib_device_hdrs} ${lib_device_hdrs_detail}) + HEADERS ${lib_cuda_hdrs} ${lib_cuda_hdrs_detail}) ocv_create_module() ocv_add_precompiled_headers(${the_module}) diff --git a/modules/core/include/opencv2/core/device/block.hpp b/modules/core/include/opencv2/core/cuda/block.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/block.hpp rename to modules/core/include/opencv2/core/cuda/block.hpp index 86ce205bc..b2bcb9f50 100644 --- a/modules/core/include/opencv2/core/device/block.hpp +++ b/modules/core/include/opencv2/core/cuda/block.hpp @@ -43,7 +43,7 @@ #ifndef __OPENCV_GPU_DEVICE_BLOCK_HPP__ #define __OPENCV_GPU_DEVICE_BLOCK_HPP__ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { struct Block { diff --git a/modules/core/include/opencv2/core/device/border_interpolate.hpp b/modules/core/include/opencv2/core/cuda/border_interpolate.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/border_interpolate.hpp rename to modules/core/include/opencv2/core/cuda/border_interpolate.hpp index 2ec97435e..3854e8429 100644 --- a/modules/core/include/opencv2/core/device/border_interpolate.hpp +++ b/modules/core/include/opencv2/core/cuda/border_interpolate.hpp @@ -47,7 +47,7 @@ #include "vec_traits.hpp" #include "vec_math.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { ////////////////////////////////////////////////////////////// // BrdConstant @@ -709,6 +709,6 @@ namespace cv { namespace gpu { namespace device const int width; const D val; }; -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_BORDER_INTERPOLATE_HPP__ diff --git a/modules/core/include/opencv2/core/device/color.hpp b/modules/core/include/opencv2/core/cuda/color.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/color.hpp rename to modules/core/include/opencv2/core/cuda/color.hpp index c087d179b..c625308f6 100644 --- a/modules/core/include/opencv2/core/device/color.hpp +++ b/modules/core/include/opencv2/core/cuda/color.hpp @@ -45,7 +45,7 @@ #include "detail/color_detail.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { // All OPENCV_GPU_IMPLEMENT_*_TRAITS(ColorSpace1_to_ColorSpace2, ...) macros implements // template class ColorSpace1_to_ColorSpace2_traits @@ -296,6 +296,6 @@ namespace cv { namespace gpu { namespace device OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_lbgra, 4, 4, false, 0) #undef OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_BORDER_INTERPOLATE_HPP__ diff --git a/modules/core/include/opencv2/core/device/common.hpp b/modules/core/include/opencv2/core/cuda/common.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/common.hpp rename to modules/core/include/opencv2/core/cuda/common.hpp index 64d82c83b..680ec497c 100644 --- a/modules/core/include/opencv2/core/device/common.hpp +++ b/modules/core/include/opencv2/core/cuda/common.hpp @@ -92,7 +92,7 @@ namespace cv { namespace gpu return (total + grain - 1) / grain; } - namespace device + namespace cuda { using cv::gpu::divUp; diff --git a/modules/core/include/opencv2/core/device/datamov_utils.hpp b/modules/core/include/opencv2/core/cuda/datamov_utils.hpp similarity index 97% rename from modules/core/include/opencv2/core/device/datamov_utils.hpp rename to modules/core/include/opencv2/core/cuda/datamov_utils.hpp index a3f62fba9..d2aadf9f1 100644 --- a/modules/core/include/opencv2/core/device/datamov_utils.hpp +++ b/modules/core/include/opencv2/core/cuda/datamov_utils.hpp @@ -45,7 +45,7 @@ #include "common.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 200 @@ -100,6 +100,6 @@ namespace cv { namespace gpu { namespace device #undef OPENCV_GPU_ASM_PTR #endif // __CUDA_ARCH__ >= 200 -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_DATAMOV_UTILS_HPP__ diff --git a/modules/core/include/opencv2/core/device/detail/color_detail.hpp b/modules/core/include/opencv2/core/cuda/detail/color_detail.hpp similarity index 98% rename from modules/core/include/opencv2/core/device/detail/color_detail.hpp rename to modules/core/include/opencv2/core/cuda/detail/color_detail.hpp index d02027f24..5853475d3 100644 --- a/modules/core/include/opencv2/core/device/detail/color_detail.hpp +++ b/modules/core/include/opencv2/core/cuda/detail/color_detail.hpp @@ -49,7 +49,7 @@ #include "../limits.hpp" #include "../functional.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { #ifndef CV_DESCALE #define CV_DESCALE(x, n) (((x) + (1 << ((n)-1))) >> (n)) @@ -149,7 +149,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB2RGB_TRAITS(name, scn, dcn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -222,7 +222,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB2RGB5x5_TRAITS(name, scn, bidx, green_bits) \ struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2RGB5x5 functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2RGB5x5 functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -303,7 +303,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB5x52RGB_TRAITS(name, dcn, bidx, green_bits) \ struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB5x52RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB5x52RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -350,7 +350,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_GRAY2RGB_TRAITS(name, dcn) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::Gray2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::Gray2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -392,7 +392,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_GRAY2RGB5x5_TRAITS(name, green_bits) \ struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::Gray2RGB5x5 functor_type; \ + typedef ::cv::gpu::cuda::color_detail::Gray2RGB5x5 functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -434,7 +434,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB5x52GRAY_TRAITS(name, green_bits) \ struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB5x52Gray functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB5x52Gray functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -486,7 +486,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB2GRAY_TRAITS(name, scn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2Gray functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2Gray functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -539,7 +539,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(name, scn, dcn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2YUV functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2YUV functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -629,7 +629,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(name, scn, dcn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::YUV2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::YUV2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -710,7 +710,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB2YCrCb_TRAITS(name, scn, dcn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2YCrCb functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2YCrCb functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -791,7 +791,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_YCrCb2RGB_TRAITS(name, scn, dcn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::YCrCb2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::YCrCb2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -869,7 +869,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB2XYZ_TRAITS(name, scn, dcn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2XYZ functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2XYZ functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -946,7 +946,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_XYZ2RGB_TRAITS(name, scn, dcn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::XYZ2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::XYZ2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1086,7 +1086,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB2HSV_TRAITS(name, scn, dcn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2HSV functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2HSV functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1094,7 +1094,7 @@ namespace cv { namespace gpu { namespace device }; \ template struct name ## _full_traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2HSV functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2HSV functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1102,7 +1102,7 @@ namespace cv { namespace gpu { namespace device }; \ template <> struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2HSV functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2HSV functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1110,7 +1110,7 @@ namespace cv { namespace gpu { namespace device }; \ template <> struct name ## _full_traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2HSV functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2HSV functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1228,7 +1228,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_HSV2RGB_TRAITS(name, scn, dcn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::HSV2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::HSV2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1236,7 +1236,7 @@ namespace cv { namespace gpu { namespace device }; \ template struct name ## _full_traits \ { \ - typedef ::cv::gpu::device::color_detail::HSV2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::HSV2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1244,7 +1244,7 @@ namespace cv { namespace gpu { namespace device }; \ template <> struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::HSV2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::HSV2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1252,7 +1252,7 @@ namespace cv { namespace gpu { namespace device }; \ template <> struct name ## _full_traits \ { \ - typedef ::cv::gpu::device::color_detail::HSV2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::HSV2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1363,7 +1363,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB2HLS_TRAITS(name, scn, dcn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2HLS functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2HLS functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1371,7 +1371,7 @@ namespace cv { namespace gpu { namespace device }; \ template struct name ## _full_traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2HLS functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2HLS functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1379,7 +1379,7 @@ namespace cv { namespace gpu { namespace device }; \ template <> struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2HLS functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2HLS functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1387,7 +1387,7 @@ namespace cv { namespace gpu { namespace device }; \ template <> struct name ## _full_traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2HLS functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2HLS functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1505,7 +1505,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_HLS2RGB_TRAITS(name, scn, dcn, bidx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::HLS2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::HLS2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1513,7 +1513,7 @@ namespace cv { namespace gpu { namespace device }; \ template struct name ## _full_traits \ { \ - typedef ::cv::gpu::device::color_detail::HLS2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::HLS2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1521,7 +1521,7 @@ namespace cv { namespace gpu { namespace device }; \ template <> struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::HLS2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::HLS2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1529,7 +1529,7 @@ namespace cv { namespace gpu { namespace device }; \ template <> struct name ## _full_traits \ { \ - typedef ::cv::gpu::device::color_detail::HLS2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::HLS2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1674,7 +1674,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(name, scn, dcn, srgb, blueIdx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2Lab functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2Lab functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1787,7 +1787,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(name, scn, dcn, srgb, blueIdx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::Lab2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::Lab2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1886,7 +1886,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(name, scn, dcn, srgb, blueIdx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::RGB2Luv functor_type; \ + typedef ::cv::gpu::cuda::color_detail::RGB2Luv functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1987,7 +1987,7 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(name, scn, dcn, srgb, blueIdx) \ template struct name ## _traits \ { \ - typedef ::cv::gpu::device::color_detail::Luv2RGB functor_type; \ + typedef ::cv::gpu::cuda::color_detail::Luv2RGB functor_type; \ static __host__ __device__ __forceinline__ functor_type create_functor() \ { \ return functor_type(); \ @@ -1996,6 +1996,6 @@ namespace cv { namespace gpu { namespace device #undef CV_DESCALE -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_COLOR_DETAIL_HPP__ diff --git a/modules/core/include/opencv2/core/device/detail/reduce.hpp b/modules/core/include/opencv2/core/cuda/detail/reduce.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/detail/reduce.hpp rename to modules/core/include/opencv2/core/cuda/detail/reduce.hpp index 091a160e3..6866016c9 100644 --- a/modules/core/include/opencv2/core/device/detail/reduce.hpp +++ b/modules/core/include/opencv2/core/cuda/detail/reduce.hpp @@ -47,7 +47,7 @@ #include "../warp.hpp" #include "../warp_shuffle.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace reduce_detail { diff --git a/modules/core/include/opencv2/core/device/detail/reduce_key_val.hpp b/modules/core/include/opencv2/core/cuda/detail/reduce_key_val.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/detail/reduce_key_val.hpp rename to modules/core/include/opencv2/core/cuda/detail/reduce_key_val.hpp index a84e0c2fd..dde37dc75 100644 --- a/modules/core/include/opencv2/core/device/detail/reduce_key_val.hpp +++ b/modules/core/include/opencv2/core/cuda/detail/reduce_key_val.hpp @@ -47,7 +47,7 @@ #include "../warp.hpp" #include "../warp_shuffle.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace reduce_key_val_detail { diff --git a/modules/core/include/opencv2/core/device/detail/transform_detail.hpp b/modules/core/include/opencv2/core/cuda/detail/transform_detail.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/detail/transform_detail.hpp rename to modules/core/include/opencv2/core/cuda/detail/transform_detail.hpp index 10da5938c..0ed8d64db 100644 --- a/modules/core/include/opencv2/core/device/detail/transform_detail.hpp +++ b/modules/core/include/opencv2/core/cuda/detail/transform_detail.hpp @@ -47,7 +47,7 @@ #include "../vec_traits.hpp" #include "../functional.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace transform_detail { @@ -390,6 +390,6 @@ namespace cv { namespace gpu { namespace device } }; } // namespace transform_detail -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_TRANSFORM_DETAIL_HPP__ diff --git a/modules/core/include/opencv2/core/device/detail/type_traits_detail.hpp b/modules/core/include/opencv2/core/cuda/detail/type_traits_detail.hpp similarity index 98% rename from modules/core/include/opencv2/core/device/detail/type_traits_detail.hpp rename to modules/core/include/opencv2/core/cuda/detail/type_traits_detail.hpp index 97ff00d8f..ee92184c3 100644 --- a/modules/core/include/opencv2/core/device/detail/type_traits_detail.hpp +++ b/modules/core/include/opencv2/core/cuda/detail/type_traits_detail.hpp @@ -46,7 +46,7 @@ #include "../common.hpp" #include "../vec_traits.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace type_traits_detail { @@ -182,6 +182,6 @@ namespace cv { namespace gpu { namespace device enum { value = 1 }; }; } // namespace type_traits_detail -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_TYPE_TRAITS_DETAIL_HPP__ diff --git a/modules/core/include/opencv2/core/device/detail/vec_distance_detail.hpp b/modules/core/include/opencv2/core/cuda/detail/vec_distance_detail.hpp similarity index 98% rename from modules/core/include/opencv2/core/device/detail/vec_distance_detail.hpp rename to modules/core/include/opencv2/core/cuda/detail/vec_distance_detail.hpp index 78ab5565c..435e69c8e 100644 --- a/modules/core/include/opencv2/core/device/detail/vec_distance_detail.hpp +++ b/modules/core/include/opencv2/core/cuda/detail/vec_distance_detail.hpp @@ -45,7 +45,7 @@ #include "../datamov_utils.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace vec_distance_detail { @@ -112,6 +112,6 @@ namespace cv { namespace gpu { namespace device } }; } // namespace vec_distance_detail -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_VEC_DISTANCE_DETAIL_HPP__ diff --git a/modules/core/include/opencv2/core/device/dynamic_smem.hpp b/modules/core/include/opencv2/core/cuda/dynamic_smem.hpp similarity index 98% rename from modules/core/include/opencv2/core/device/dynamic_smem.hpp rename to modules/core/include/opencv2/core/cuda/dynamic_smem.hpp index cf431d952..41f9ecce6 100644 --- a/modules/core/include/opencv2/core/device/dynamic_smem.hpp +++ b/modules/core/include/opencv2/core/cuda/dynamic_smem.hpp @@ -43,7 +43,7 @@ #ifndef __OPENCV_GPU_DYNAMIC_SMEM_HPP__ #define __OPENCV_GPU_DYNAMIC_SMEM_HPP__ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct DynamicSharedMem { diff --git a/modules/core/include/opencv2/core/device/emulation.hpp b/modules/core/include/opencv2/core/cuda/emulation.hpp similarity index 97% rename from modules/core/include/opencv2/core/device/emulation.hpp rename to modules/core/include/opencv2/core/cuda/emulation.hpp index bf47bc5f1..e2c743788 100644 --- a/modules/core/include/opencv2/core/device/emulation.hpp +++ b/modules/core/include/opencv2/core/cuda/emulation.hpp @@ -45,7 +45,7 @@ #include "warp_reduce.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { struct Emulation { @@ -133,6 +133,6 @@ namespace cv { namespace gpu { namespace device } }; }; -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* OPENCV_GPU_EMULATION_HPP_ */ diff --git a/modules/core/include/opencv2/core/device/filters.hpp b/modules/core/include/opencv2/core/cuda/filters.hpp similarity index 98% rename from modules/core/include/opencv2/core/device/filters.hpp rename to modules/core/include/opencv2/core/cuda/filters.hpp index d193969a7..607aecf2a 100644 --- a/modules/core/include/opencv2/core/device/filters.hpp +++ b/modules/core/include/opencv2/core/cuda/filters.hpp @@ -48,7 +48,7 @@ #include "vec_math.hpp" #include "type_traits.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct PointFilter { @@ -273,6 +273,6 @@ namespace cv { namespace gpu { namespace device float scale_x, scale_y; int width, haight; }; -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_FILTERS_HPP__ diff --git a/modules/core/include/opencv2/core/device/funcattrib.hpp b/modules/core/include/opencv2/core/cuda/funcattrib.hpp similarity index 96% rename from modules/core/include/opencv2/core/device/funcattrib.hpp rename to modules/core/include/opencv2/core/cuda/funcattrib.hpp index 2ed798020..e97b5bec6 100644 --- a/modules/core/include/opencv2/core/device/funcattrib.hpp +++ b/modules/core/include/opencv2/core/cuda/funcattrib.hpp @@ -45,7 +45,7 @@ #include -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template void printFuncAttrib(Func& func) @@ -66,6 +66,6 @@ namespace cv { namespace gpu { namespace device printf("\n"); fflush(stdout); } -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* __OPENCV_GPU_DEVICE_FUNCATTRIB_HPP_ */ diff --git a/modules/core/include/opencv2/core/device/functional.hpp b/modules/core/include/opencv2/core/cuda/functional.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/functional.hpp rename to modules/core/include/opencv2/core/cuda/functional.hpp index 6064e8e99..5ac90eb47 100644 --- a/modules/core/include/opencv2/core/device/functional.hpp +++ b/modules/core/include/opencv2/core/cuda/functional.hpp @@ -49,7 +49,7 @@ #include "type_traits.hpp" #include "device_functions.h" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { // Function Objects template struct unary_function : public std::unary_function {}; @@ -786,6 +786,6 @@ namespace cv { namespace gpu { namespace device #define OPENCV_GPU_TRANSFORM_FUNCTOR_TRAITS(type) \ template <> struct TransformFunctorTraits< type > : DefaultTransformFunctorTraits< type > -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_FUNCTIONAL_HPP__ diff --git a/modules/core/include/opencv2/core/device/limits.hpp b/modules/core/include/opencv2/core/cuda/limits.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/limits.hpp rename to modules/core/include/opencv2/core/cuda/limits.hpp index b040f199d..fc5e7b234 100644 --- a/modules/core/include/opencv2/core/device/limits.hpp +++ b/modules/core/include/opencv2/core/cuda/limits.hpp @@ -46,7 +46,7 @@ #include #include "common.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct numeric_limits { @@ -230,6 +230,6 @@ namespace cv { namespace gpu { namespace device __device__ __forceinline__ static type signaling_NaN(); static const bool is_signed = true; }; -}}} // namespace cv { namespace gpu { namespace device { +}}} // namespace cv { namespace gpu { namespace cuda { #endif // __OPENCV_GPU_LIMITS_GPU_HPP__ diff --git a/modules/core/include/opencv2/core/device/reduce.hpp b/modules/core/include/opencv2/core/cuda/reduce.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/reduce.hpp rename to modules/core/include/opencv2/core/cuda/reduce.hpp index 2161b0649..ca16a20e0 100644 --- a/modules/core/include/opencv2/core/device/reduce.hpp +++ b/modules/core/include/opencv2/core/cuda/reduce.hpp @@ -47,7 +47,7 @@ #include "detail/reduce.hpp" #include "detail/reduce_key_val.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template __device__ __forceinline__ void reduce(volatile T* smem, T& val, unsigned int tid, const Op& op) diff --git a/modules/core/include/opencv2/core/device/saturate_cast.hpp b/modules/core/include/opencv2/core/cuda/saturate_cast.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/saturate_cast.hpp rename to modules/core/include/opencv2/core/cuda/saturate_cast.hpp index 7a2799fa3..f80a43abe 100644 --- a/modules/core/include/opencv2/core/device/saturate_cast.hpp +++ b/modules/core/include/opencv2/core/cuda/saturate_cast.hpp @@ -45,7 +45,7 @@ #include "common.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template __device__ __forceinline__ _Tp saturate_cast(uchar v) { return _Tp(v); } template __device__ __forceinline__ _Tp saturate_cast(schar v) { return _Tp(v); } diff --git a/modules/core/include/opencv2/core/device/scan.hpp b/modules/core/include/opencv2/core/cuda/scan.hpp similarity index 96% rename from modules/core/include/opencv2/core/device/scan.hpp rename to modules/core/include/opencv2/core/cuda/scan.hpp index 777754c54..0493ee360 100644 --- a/modules/core/include/opencv2/core/device/scan.hpp +++ b/modules/core/include/opencv2/core/cuda/scan.hpp @@ -43,12 +43,12 @@ #ifndef __OPENCV_GPU_SCAN_HPP__ #define __OPENCV_GPU_SCAN_HPP__ -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/utility.hpp" -#include "opencv2/core/device/warp.hpp" -#include "opencv2/core/device/warp_shuffle.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/utility.hpp" +#include "opencv2/core/cuda/warp.hpp" +#include "opencv2/core/cuda/warp_shuffle.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { enum ScanKind { EXCLUSIVE = 0, INCLUSIVE = 1 }; @@ -174,13 +174,13 @@ namespace cv { namespace gpu { namespace device __device__ T warpScanInclusive(T idata, volatile T* s_Data, unsigned int tid) { #if __CUDA_ARCH__ >= 300 - const unsigned int laneId = cv::gpu::device::Warp::laneId(); + const unsigned int laneId = cv::gpu::cuda::Warp::laneId(); // scan on shuffl functions #pragma unroll for (int i = 1; i <= (OPENCV_GPU_WARP_SIZE / 2); i *= 2) { - const T n = cv::gpu::device::shfl_up(idata, i); + const T n = cv::gpu::cuda::shfl_up(idata, i); if (laneId >= i) idata += n; } diff --git a/modules/core/include/opencv2/core/device/simd_functions.hpp b/modules/core/include/opencv2/core/cuda/simd_functions.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/simd_functions.hpp rename to modules/core/include/opencv2/core/cuda/simd_functions.hpp index b0377e533..b6d2fe13c 100644 --- a/modules/core/include/opencv2/core/device/simd_functions.hpp +++ b/modules/core/include/opencv2/core/cuda/simd_functions.hpp @@ -123,7 +123,7 @@ vmin4(a,b) per-byte unsigned minimum: min(a, b) */ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { // 2 diff --git a/modules/core/include/opencv2/core/device/static_check.hpp b/modules/core/include/opencv2/core/cuda/static_check.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/static_check.hpp rename to modules/core/include/opencv2/core/cuda/static_check.hpp index e77691b7b..db1bb8e05 100644 --- a/modules/core/include/opencv2/core/device/static_check.hpp +++ b/modules/core/include/opencv2/core/cuda/static_check.hpp @@ -51,7 +51,7 @@ namespace cv { namespace gpu { - namespace device + namespace cuda { template struct Static {}; diff --git a/modules/core/include/opencv2/core/device/transform.hpp b/modules/core/include/opencv2/core/cuda/transform.hpp similarity index 98% rename from modules/core/include/opencv2/core/device/transform.hpp rename to modules/core/include/opencv2/core/cuda/transform.hpp index 636caac63..bf9b68bed 100644 --- a/modules/core/include/opencv2/core/device/transform.hpp +++ b/modules/core/include/opencv2/core/cuda/transform.hpp @@ -47,7 +47,7 @@ #include "utility.hpp" #include "detail/transform_detail.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template static inline void transform(PtrStepSz src, PtrStepSz dst, UnOp op, const Mask& mask, cudaStream_t stream) diff --git a/modules/core/include/opencv2/core/device/type_traits.hpp b/modules/core/include/opencv2/core/cuda/type_traits.hpp similarity index 98% rename from modules/core/include/opencv2/core/device/type_traits.hpp rename to modules/core/include/opencv2/core/cuda/type_traits.hpp index 1b36acca5..0fb5fdac5 100644 --- a/modules/core/include/opencv2/core/device/type_traits.hpp +++ b/modules/core/include/opencv2/core/cuda/type_traits.hpp @@ -45,7 +45,7 @@ #include "detail/type_traits_detail.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct IsSimpleParameter { diff --git a/modules/core/include/opencv2/core/device/utility.hpp b/modules/core/include/opencv2/core/cuda/utility.hpp similarity index 98% rename from modules/core/include/opencv2/core/device/utility.hpp rename to modules/core/include/opencv2/core/cuda/utility.hpp index 83eaaa21c..79973850d 100644 --- a/modules/core/include/opencv2/core/device/utility.hpp +++ b/modules/core/include/opencv2/core/cuda/utility.hpp @@ -46,7 +46,7 @@ #include "saturate_cast.hpp" #include "datamov_utils.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { #define OPENCV_GPU_LOG_WARP_SIZE (5) #define OPENCV_GPU_WARP_SIZE (1 << OPENCV_GPU_LOG_WARP_SIZE) @@ -208,6 +208,6 @@ namespace cv { namespace gpu { namespace device return false; } -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_UTILITY_HPP__ diff --git a/modules/core/include/opencv2/core/device/vec_distance.hpp b/modules/core/include/opencv2/core/cuda/vec_distance.hpp similarity index 98% rename from modules/core/include/opencv2/core/device/vec_distance.hpp rename to modules/core/include/opencv2/core/cuda/vec_distance.hpp index d5b4bb202..552100161 100644 --- a/modules/core/include/opencv2/core/device/vec_distance.hpp +++ b/modules/core/include/opencv2/core/cuda/vec_distance.hpp @@ -47,7 +47,7 @@ #include "functional.hpp" #include "detail/vec_distance_detail.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct L1Dist { @@ -219,6 +219,6 @@ namespace cv { namespace gpu { namespace device U vec1Vals[MAX_LEN / THREAD_DIM]; }; -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_VEC_DISTANCE_HPP__ diff --git a/modules/core/include/opencv2/core/device/vec_math.hpp b/modules/core/include/opencv2/core/cuda/vec_math.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/vec_math.hpp rename to modules/core/include/opencv2/core/cuda/vec_math.hpp index 1c46dc0c3..238c71e28 100644 --- a/modules/core/include/opencv2/core/device/vec_math.hpp +++ b/modules/core/include/opencv2/core/cuda/vec_math.hpp @@ -47,7 +47,7 @@ #include "vec_traits.hpp" #include "functional.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace vec_math_detail { @@ -325,6 +325,6 @@ namespace cv { namespace gpu { namespace device #undef OPENCV_GPU_IMPLEMENT_VEC_BINOP #undef OPENCV_GPU_IMPLEMENT_VEC_OP #undef OPENCV_GPU_IMPLEMENT_VEC_INT_OP -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_VECMATH_HPP__ diff --git a/modules/core/include/opencv2/core/device/vec_traits.hpp b/modules/core/include/opencv2/core/cuda/vec_traits.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/vec_traits.hpp rename to modules/core/include/opencv2/core/cuda/vec_traits.hpp index 8d179c83f..9cdf64b7b 100644 --- a/modules/core/include/opencv2/core/device/vec_traits.hpp +++ b/modules/core/include/opencv2/core/cuda/vec_traits.hpp @@ -45,7 +45,7 @@ #include "common.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TypeVec; @@ -275,6 +275,6 @@ namespace cv { namespace gpu { namespace device static __device__ __host__ __forceinline__ char8 make(schar a0, schar a1, schar a2, schar a3, schar a4, schar a5, schar a6, schar a7) {return make_char8(a0, a1, a2, a3, a4, a5, a6, a7);} static __device__ __host__ __forceinline__ char8 make(const schar* v) {return make_char8(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);} }; -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif // __OPENCV_GPU_VEC_TRAITS_HPP__ diff --git a/modules/core/include/opencv2/core/device/warp.hpp b/modules/core/include/opencv2/core/cuda/warp.hpp similarity index 97% rename from modules/core/include/opencv2/core/device/warp.hpp rename to modules/core/include/opencv2/core/cuda/warp.hpp index 0f1dc794a..14cf6cba7 100644 --- a/modules/core/include/opencv2/core/device/warp.hpp +++ b/modules/core/include/opencv2/core/cuda/warp.hpp @@ -43,7 +43,7 @@ #ifndef __OPENCV_GPU_DEVICE_WARP_HPP__ #define __OPENCV_GPU_DEVICE_WARP_HPP__ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { struct Warp { @@ -126,6 +126,6 @@ namespace cv { namespace gpu { namespace device *t = value; } }; -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* __OPENCV_GPU_DEVICE_WARP_HPP__ */ diff --git a/modules/core/include/opencv2/core/device/warp_reduce.hpp b/modules/core/include/opencv2/core/cuda/warp_reduce.hpp similarity index 96% rename from modules/core/include/opencv2/core/device/warp_reduce.hpp rename to modules/core/include/opencv2/core/cuda/warp_reduce.hpp index d4e64c461..7d4d838e8 100644 --- a/modules/core/include/opencv2/core/device/warp_reduce.hpp +++ b/modules/core/include/opencv2/core/cuda/warp_reduce.hpp @@ -43,7 +43,7 @@ #ifndef OPENCV_GPU_WARP_REDUCE_HPP__ #define OPENCV_GPU_WARP_REDUCE_HPP__ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template __device__ __forceinline__ T warp_reduce(volatile T *ptr , const unsigned int tid = threadIdx.x) @@ -63,6 +63,6 @@ namespace cv { namespace gpu { namespace device return ptr[tid - lane]; } -}}} // namespace cv { namespace gpu { namespace device { +}}} // namespace cv { namespace gpu { namespace cuda { #endif /* OPENCV_GPU_WARP_REDUCE_HPP__ */ diff --git a/modules/core/include/opencv2/core/device/warp_shuffle.hpp b/modules/core/include/opencv2/core/cuda/warp_shuffle.hpp similarity index 99% rename from modules/core/include/opencv2/core/device/warp_shuffle.hpp rename to modules/core/include/opencv2/core/cuda/warp_shuffle.hpp index 8b4479a79..954b618d3 100644 --- a/modules/core/include/opencv2/core/device/warp_shuffle.hpp +++ b/modules/core/include/opencv2/core/cuda/warp_shuffle.hpp @@ -43,7 +43,7 @@ #ifndef __OPENCV_GPU_WARP_SHUFFLE_HPP__ #define __OPENCV_GPU_WARP_SHUFFLE_HPP__ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template __device__ __forceinline__ T shfl(T val, int srcLane, int width = warpSize) diff --git a/modules/core/include/opencv2/core/cuda_devptrs.hpp b/modules/core/include/opencv2/core/cuda_devptrs.hpp index 5af5ab88f..9e0ba11da 100644 --- a/modules/core/include/opencv2/core/cuda_devptrs.hpp +++ b/modules/core/include/opencv2/core/cuda_devptrs.hpp @@ -148,24 +148,6 @@ namespace cv typedef DevMem2Db DevMem2D; typedef DevMem2D_ DevMem2Df; typedef DevMem2D_ DevMem2Di; - -//#undef __CV_GPU_DEPR_BEFORE__ -//#undef __CV_GPU_DEPR_AFTER__ - - namespace device - { - using cv::gpu::PtrSz; - using cv::gpu::PtrStep; - using cv::gpu::PtrStepSz; - - using cv::gpu::PtrStepSzb; - using cv::gpu::PtrStepSzf; - using cv::gpu::PtrStepSzi; - - using cv::gpu::PtrStepb; - using cv::gpu::PtrStepf; - using cv::gpu::PtrStepi; - } } } diff --git a/modules/core/src/cuda/matrix_operations.cu b/modules/core/src/cuda/matrix_operations.cu index dd67c544f..2cb82184c 100644 --- a/modules/core/src/cuda/matrix_operations.cu +++ b/modules/core/src/cuda/matrix_operations.cu @@ -40,12 +40,12 @@ // //M*/ -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/transform.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/type_traits.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/transform.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/type_traits.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { void writeScalar(const uchar*); void writeScalar(const schar*); @@ -58,7 +58,7 @@ namespace cv { namespace gpu { namespace device void convert_gpu(PtrStepSzb, int, PtrStepSzb, int, double, double, cudaStream_t); }}} -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct shift_and_sizeof; template <> struct shift_and_sizeof { enum { shift = 0 }; }; @@ -76,9 +76,9 @@ namespace cv { namespace gpu { namespace device template void copyToWithMask(PtrStepSzb src, PtrStepSzb dst, int cn, PtrStepSzb mask, bool colorMask, cudaStream_t stream) { if (colorMask) - cv::gpu::device::transform((PtrStepSz)src, (PtrStepSz)dst, identity(), SingleMask(mask), stream); + cv::gpu::cuda::transform((PtrStepSz)src, (PtrStepSz)dst, identity(), SingleMask(mask), stream); else - cv::gpu::device::transform((PtrStepSz)src, (PtrStepSz)dst, identity(), SingleMaskChannels(mask, cn), stream); + cv::gpu::cuda::transform((PtrStepSz)src, (PtrStepSz)dst, identity(), SingleMaskChannels(mask, cn), stream); } void copyToWithMask_gpu(PtrStepSzb src, PtrStepSzb dst, size_t elemSize1, int cn, PtrStepSzb mask, bool colorMask, cudaStream_t stream) @@ -293,7 +293,7 @@ namespace cv { namespace gpu { namespace device cudaSafeCall( cudaSetDoubleForDevice(&alpha) ); cudaSafeCall( cudaSetDoubleForDevice(&beta) ); Convertor op(static_cast(alpha), static_cast(beta)); - cv::gpu::device::transform((PtrStepSz)src, (PtrStepSz)dst, op, WithOutMask(), stream); + cv::gpu::cuda::transform((PtrStepSz)src, (PtrStepSz)dst, op, WithOutMask(), stream); } #if defined __clang__ @@ -379,4 +379,4 @@ namespace cv { namespace gpu { namespace device #if defined __clang__ # pragma clang diagnostic pop #endif -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda diff --git a/modules/core/src/gpumat.cpp b/modules/core/src/gpumat.cpp index 09e1562d6..12252b538 100644 --- a/modules/core/src/gpumat.cpp +++ b/modules/core/src/gpumat.cpp @@ -870,7 +870,7 @@ namespace #else // HAVE_CUDA -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { void copyToWithMask_gpu(PtrStepSzb src, PtrStepSzb dst, size_t elemSize1, int cn, PtrStepSzb mask, bool colorMask, cudaStream_t stream); @@ -888,13 +888,13 @@ namespace template void kernelSetCaller(GpuMat& src, Scalar s, cudaStream_t stream) { Scalar_ sf = s; - cv::gpu::device::set_to_gpu(src, sf.val, src.channels(), stream); + cv::gpu::cuda::set_to_gpu(src, sf.val, src.channels(), stream); } template void kernelSetCaller(GpuMat& src, Scalar s, const GpuMat& mask, cudaStream_t stream) { Scalar_ sf = s; - cv::gpu::device::set_to_gpu(src, sf.val, mask, src.channels(), stream); + cv::gpu::cuda::set_to_gpu(src, sf.val, mask, src.channels(), stream); } } @@ -918,17 +918,17 @@ namespace cv { namespace gpu CV_Assert(src.size() == dst.size() && src.type() == dst.type()); CV_Assert(src.size() == mask.size() && mask.depth() == CV_8U && (mask.channels() == 1 || mask.channels() == src.channels())); - cv::gpu::device::copyToWithMask_gpu(src.reshape(1), dst.reshape(1), src.elemSize1(), src.channels(), mask.reshape(1), mask.channels() != 1, stream); + cv::gpu::cuda::copyToWithMask_gpu(src.reshape(1), dst.reshape(1), src.elemSize1(), src.channels(), mask.reshape(1), mask.channels() != 1, stream); } void convertTo(const GpuMat& src, GpuMat& dst) { - cv::gpu::device::convert_gpu(src.reshape(1), src.depth(), dst.reshape(1), dst.depth(), 1.0, 0.0, 0); + cv::gpu::cuda::convert_gpu(src.reshape(1), src.depth(), dst.reshape(1), dst.depth(), 1.0, 0.0, 0); } void convertTo(const GpuMat& src, GpuMat& dst, double alpha, double beta, cudaStream_t stream = 0) { - cv::gpu::device::convert_gpu(src.reshape(1), src.depth(), dst.reshape(1), dst.depth(), alpha, beta, stream); + cv::gpu::cuda::convert_gpu(src.reshape(1), src.depth(), dst.reshape(1), dst.depth(), alpha, beta, stream); } void setTo(GpuMat& src, Scalar s, cudaStream_t stream) diff --git a/modules/gpu/src/arithm.cpp b/modules/gpu/src/arithm.cpp index ad0b894d9..cefc29f20 100644 --- a/modules/gpu/src/arithm.cpp +++ b/modules/gpu/src/arithm.cpp @@ -444,7 +444,7 @@ void cv::gpu::magnitudeSqr(const GpuMat& src, GpuMat& dst, Stream& stream) //////////////////////////////////////////////////////////////////////// // Polar <-> Cart -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace mathfunc { @@ -457,7 +457,7 @@ namespace { inline void cartToPolar_caller(const GpuMat& x, const GpuMat& y, GpuMat* mag, bool magSqr, GpuMat* angle, bool angleInDegrees, cudaStream_t stream) { - using namespace ::cv::gpu::device::mathfunc; + using namespace ::cv::gpu::cuda::mathfunc; CV_Assert(x.size() == y.size() && x.type() == y.type()); CV_Assert(x.depth() == CV_32F); @@ -477,7 +477,7 @@ namespace inline void polarToCart_caller(const GpuMat& mag, const GpuMat& angle, GpuMat& x, GpuMat& y, bool angleInDegrees, cudaStream_t stream) { - using namespace ::cv::gpu::device::mathfunc; + using namespace ::cv::gpu::cuda::mathfunc; CV_Assert((mag.empty() || mag.size() == angle.size()) && mag.type() == angle.type()); CV_Assert(mag.depth() == CV_32F); diff --git a/modules/gpu/src/bgfg_gmg.cpp b/modules/gpu/src/bgfg_gmg.cpp index 46f3ba289..b474823a5 100644 --- a/modules/gpu/src/bgfg_gmg.cpp +++ b/modules/gpu/src/bgfg_gmg.cpp @@ -51,7 +51,7 @@ void cv::gpu::GMG_GPU::release() {} #else -namespace cv { namespace gpu { namespace device { +namespace cv { namespace gpu { namespace cuda { namespace bgfg_gmg { void loadConstants(int width, int height, float minVal, float maxVal, int quantizationLevels, float backgroundPrior, @@ -77,7 +77,7 @@ cv::gpu::GMG_GPU::GMG_GPU() void cv::gpu::GMG_GPU::initialize(cv::Size frameSize, float min, float max) { - using namespace cv::gpu::device::bgfg_gmg; + using namespace cv::gpu::cuda::bgfg_gmg; CV_Assert(min < max); CV_Assert(maxFeatures > 0); @@ -107,7 +107,7 @@ void cv::gpu::GMG_GPU::initialize(cv::Size frameSize, float min, float max) void cv::gpu::GMG_GPU::operator ()(const cv::gpu::GpuMat& frame, cv::gpu::GpuMat& fgmask, float newLearningRate, cv::gpu::Stream& stream) { - using namespace cv::gpu::device::bgfg_gmg; + using namespace cv::gpu::cuda::bgfg_gmg; typedef void (*func_t)(PtrStepSzb frame, PtrStepb fgmask, PtrStepSzi colors, PtrStepf weights, PtrStepi nfeatures, int frameNum, float learningRate, bool updateBackgroundModel, cudaStream_t stream); diff --git a/modules/gpu/src/bgfg_mog.cpp b/modules/gpu/src/bgfg_mog.cpp index 05b4ffb9c..13db07911 100644 --- a/modules/gpu/src/bgfg_mog.cpp +++ b/modules/gpu/src/bgfg_mog.cpp @@ -58,7 +58,7 @@ void cv::gpu::MOG2_GPU::release() {} #else -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace mog { @@ -123,7 +123,7 @@ void cv::gpu::MOG_GPU::initialize(cv::Size frameSize, int frameType) void cv::gpu::MOG_GPU::operator()(const cv::gpu::GpuMat& frame, cv::gpu::GpuMat& fgmask, float learningRate, Stream& stream) { - using namespace cv::gpu::device::mog; + using namespace cv::gpu::cuda::mog; CV_Assert(frame.depth() == CV_8U); @@ -146,7 +146,7 @@ void cv::gpu::MOG_GPU::operator()(const cv::gpu::GpuMat& frame, cv::gpu::GpuMat& void cv::gpu::MOG_GPU::getBackgroundImage(GpuMat& backgroundImage, Stream& stream) const { - using namespace cv::gpu::device::mog; + using namespace cv::gpu::cuda::mog; backgroundImage.create(frameSize_, frameType_); @@ -208,7 +208,7 @@ cv::gpu::MOG2_GPU::MOG2_GPU(int nmixtures) : void cv::gpu::MOG2_GPU::initialize(cv::Size frameSize, int frameType) { - using namespace cv::gpu::device::mog; + using namespace cv::gpu::cuda::mog; CV_Assert(frameType == CV_8UC1 || frameType == CV_8UC3 || frameType == CV_8UC4); @@ -236,7 +236,7 @@ void cv::gpu::MOG2_GPU::initialize(cv::Size frameSize, int frameType) void cv::gpu::MOG2_GPU::operator()(const GpuMat& frame, GpuMat& fgmask, float learningRate, Stream& stream) { - using namespace cv::gpu::device::mog; + using namespace cv::gpu::cuda::mog; int ch = frame.channels(); int work_ch = ch; @@ -256,7 +256,7 @@ void cv::gpu::MOG2_GPU::operator()(const GpuMat& frame, GpuMat& fgmask, float le void cv::gpu::MOG2_GPU::getBackgroundImage(GpuMat& backgroundImage, Stream& stream) const { - using namespace cv::gpu::device::mog; + using namespace cv::gpu::cuda::mog; backgroundImage.create(frameSize_, frameType_); diff --git a/modules/gpu/src/bilateral_filter.cpp b/modules/gpu/src/bilateral_filter.cpp index c60954dcf..41640a556 100644 --- a/modules/gpu/src/bilateral_filter.cpp +++ b/modules/gpu/src/bilateral_filter.cpp @@ -54,7 +54,7 @@ void cv::gpu::DisparityBilateralFilter::operator()(const GpuMat&, const GpuMat&, #else /* !defined (HAVE_CUDA) */ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace disp_bilateral_filter { @@ -65,7 +65,7 @@ namespace cv { namespace gpu { namespace device } }}} -using namespace ::cv::gpu::device::disp_bilateral_filter; +using namespace ::cv::gpu::cuda::disp_bilateral_filter; namespace { diff --git a/modules/gpu/src/blend.cpp b/modules/gpu/src/blend.cpp index 1f4cf7d30..08193386b 100644 --- a/modules/gpu/src/blend.cpp +++ b/modules/gpu/src/blend.cpp @@ -51,7 +51,7 @@ void cv::gpu::blendLinear(const GpuMat&, const GpuMat&, const GpuMat&, const Gpu #else -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace blend { @@ -62,7 +62,7 @@ namespace cv { namespace gpu { namespace device } }}} -using namespace ::cv::gpu::device::blend; +using namespace ::cv::gpu::cuda::blend; void cv::gpu::blendLinear(const GpuMat& img1, const GpuMat& img2, const GpuMat& weights1, const GpuMat& weights2, GpuMat& result, Stream& stream) diff --git a/modules/gpu/src/brute_force_matcher.cpp b/modules/gpu/src/brute_force_matcher.cpp index b57b13fab..1f9c11cd0 100644 --- a/modules/gpu/src/brute_force_matcher.cpp +++ b/modules/gpu/src/brute_force_matcher.cpp @@ -81,7 +81,7 @@ void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat&, std::vector< std::vector #else /* !defined (HAVE_CUDA) */ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace bf_match { @@ -197,7 +197,7 @@ void cv::gpu::BFMatcher_GPU::matchSingle(const GpuMat& query, const GpuMat& trai if (query.empty() || train.empty()) return; - using namespace cv::gpu::device::bf_match; + using namespace cv::gpu::cuda::bf_match; typedef void (*caller_t)(const PtrStepSzb& query, const PtrStepSzb& train, const PtrStepSzb& mask, const PtrStepSzi& trainIdx, const PtrStepSzf& distance, @@ -340,7 +340,7 @@ void cv::gpu::BFMatcher_GPU::matchCollection(const GpuMat& query, const GpuMat& if (query.empty() || trainCollection.empty()) return; - using namespace cv::gpu::device::bf_match; + using namespace cv::gpu::cuda::bf_match; typedef void (*caller_t)(const PtrStepSzb& query, const PtrStepSzb& trains, const PtrStepSz& masks, const PtrStepSzi& trainIdx, const PtrStepSzi& imgIdx, const PtrStepSzf& distance, @@ -451,7 +451,7 @@ void cv::gpu::BFMatcher_GPU::knnMatchSingle(const GpuMat& query, const GpuMat& t if (query.empty() || train.empty()) return; - using namespace cv::gpu::device::bf_knnmatch; + using namespace cv::gpu::cuda::bf_knnmatch; typedef void (*caller_t)(const PtrStepSzb& query, const PtrStepSzb& train, int k, const PtrStepSzb& mask, const PtrStepSzb& trainIdx, const PtrStepSzb& distance, const PtrStepSzf& allDist, @@ -580,7 +580,7 @@ void cv::gpu::BFMatcher_GPU::knnMatch2Collection(const GpuMat& query, const GpuM if (query.empty() || trainCollection.empty()) return; - using namespace cv::gpu::device::bf_knnmatch; + using namespace cv::gpu::cuda::bf_knnmatch; typedef void (*caller_t)(const PtrStepSzb& query, const PtrStepSzb& trains, const PtrStepSz& masks, const PtrStepSzb& trainIdx, const PtrStepSzb& imgIdx, const PtrStepSzb& distance, @@ -761,7 +761,7 @@ void cv::gpu::BFMatcher_GPU::radiusMatchSingle(const GpuMat& query, const GpuMat if (query.empty() || train.empty()) return; - using namespace cv::gpu::device::bf_radius_match; + using namespace cv::gpu::cuda::bf_radius_match; typedef void (*caller_t)(const PtrStepSzb& query, const PtrStepSzb& train, float maxDistance, const PtrStepSzb& mask, const PtrStepSzi& trainIdx, const PtrStepSzf& distance, const PtrStepSz& nMatches, @@ -890,7 +890,7 @@ void cv::gpu::BFMatcher_GPU::radiusMatchCollection(const GpuMat& query, GpuMat& if (query.empty() || empty()) return; - using namespace cv::gpu::device::bf_radius_match; + using namespace cv::gpu::cuda::bf_radius_match; typedef void (*caller_t)(const PtrStepSzb& query, const PtrStepSzb* trains, int n, float maxDistance, const PtrStepSzb* masks, const PtrStepSzi& trainIdx, const PtrStepSzi& imgIdx, const PtrStepSzf& distance, const PtrStepSz& nMatches, diff --git a/modules/gpu/src/calib3d.cpp b/modules/gpu/src/calib3d.cpp index ab7f63f45..78408c73b 100644 --- a/modules/gpu/src/calib3d.cpp +++ b/modules/gpu/src/calib3d.cpp @@ -55,7 +55,7 @@ void cv::gpu::solvePnPRansac(const Mat&, const Mat&, const Mat&, const Mat&, Mat #else -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace transform_points { @@ -78,7 +78,7 @@ namespace cv { namespace gpu { namespace device } }}} -using namespace ::cv::gpu::device; +using namespace ::cv::gpu::cuda; namespace { diff --git a/modules/gpu/src/cascadeclassifier.cpp b/modules/gpu/src/cascadeclassifier.cpp index 10108e906..3ba8368d1 100644 --- a/modules/gpu/src/cascadeclassifier.cpp +++ b/modules/gpu/src/cascadeclassifier.cpp @@ -340,7 +340,7 @@ struct PyrLavel cv::Size sWindow; }; -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace lbp { @@ -441,7 +441,7 @@ public: acc += level.sFrame.width + 1; } - device::lbp::classifyPyramid(image.cols, image.rows, NxM.width - 1, NxM.height - 1, iniScale, scaleFactor, total, stage_mat, stage_mat.cols / sizeof(Stage), nodes_mat, + cuda::lbp::classifyPyramid(image.cols, image.rows, NxM.width - 1, NxM.height - 1, iniScale, scaleFactor, total, stage_mat, stage_mat.cols / sizeof(Stage), nodes_mat, leaves_mat, subsets_mat, features_mat, subsetSize, candidates, dclassified.ptr(), integral); } @@ -449,7 +449,7 @@ public: return 0; cudaSafeCall( cudaMemcpy(&classified, dclassified.ptr(), sizeof(int), cudaMemcpyDeviceToHost) ); - device::lbp::connectedConmonents(candidates, classified, objects, groupThreshold, grouping_eps, dclassified.ptr()); + cuda::lbp::connectedConmonents(candidates, classified, objects, groupThreshold, grouping_eps, dclassified.ptr()); cudaSafeCall( cudaMemcpy(&classified, dclassified.ptr(), sizeof(int), cudaMemcpyDeviceToHost) ); cudaSafeCall( cudaDeviceSynchronize() ); diff --git a/modules/gpu/src/color.cpp b/modules/gpu/src/color.cpp index 76793d520..9f6ca2598 100644 --- a/modules/gpu/src/color.cpp +++ b/modules/gpu/src/color.cpp @@ -57,7 +57,7 @@ void cv::gpu::gammaCorrection(const GpuMat&, GpuMat&, bool, Stream&) { throw_nog #include "cvt_color_internal.h" namespace cv { namespace gpu { - namespace device + namespace cuda { template void Bayer2BGR_8u_gpu(PtrStepSzb src, PtrStepSzb dst, bool blue_last, bool start_with_green, cudaStream_t stream); @@ -69,7 +69,7 @@ namespace cv { namespace gpu { } }} -using namespace ::cv::gpu::device; +using namespace ::cv::gpu::cuda; namespace { @@ -77,7 +77,7 @@ namespace void bgr_to_rgb(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {bgr_to_rgb_8u, 0, bgr_to_rgb_16u, 0, 0, bgr_to_rgb_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -90,7 +90,7 @@ namespace void bgr_to_bgra(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {bgr_to_bgra_8u, 0, bgr_to_bgra_16u, 0, 0, bgr_to_bgra_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -103,7 +103,7 @@ namespace void bgr_to_rgba(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {bgr_to_rgba_8u, 0, bgr_to_rgba_16u, 0, 0, bgr_to_rgba_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -116,7 +116,7 @@ namespace void bgra_to_bgr(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {bgra_to_bgr_8u, 0, bgra_to_bgr_16u, 0, 0, bgra_to_bgr_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -129,7 +129,7 @@ namespace void bgra_to_rgb(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {bgra_to_rgb_8u, 0, bgra_to_rgb_16u, 0, 0, bgra_to_rgb_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -142,7 +142,7 @@ namespace void bgra_to_rgba(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {bgra_to_rgba_8u, 0, bgra_to_rgba_16u, 0, 0, bgra_to_rgba_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -160,7 +160,7 @@ namespace dst.create(src.size(), CV_8UC2); - device::bgr_to_bgr555(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr_to_bgr555(src, dst, StreamAccessor::getStream(stream)); } void bgr_to_bgr565(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -170,7 +170,7 @@ namespace dst.create(src.size(), CV_8UC2); - device::bgr_to_bgr565(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr_to_bgr565(src, dst, StreamAccessor::getStream(stream)); } void rgb_to_bgr555(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -180,7 +180,7 @@ namespace dst.create(src.size(), CV_8UC2); - device::rgb_to_bgr555(src, dst, StreamAccessor::getStream(stream)); + cuda::rgb_to_bgr555(src, dst, StreamAccessor::getStream(stream)); } void rgb_to_bgr565(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -190,7 +190,7 @@ namespace dst.create(src.size(), CV_8UC2); - device::rgb_to_bgr565(src, dst, StreamAccessor::getStream(stream)); + cuda::rgb_to_bgr565(src, dst, StreamAccessor::getStream(stream)); } void bgra_to_bgr555(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -200,7 +200,7 @@ namespace dst.create(src.size(), CV_8UC2); - device::bgra_to_bgr555(src, dst, StreamAccessor::getStream(stream)); + cuda::bgra_to_bgr555(src, dst, StreamAccessor::getStream(stream)); } void bgra_to_bgr565(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -210,7 +210,7 @@ namespace dst.create(src.size(), CV_8UC2); - device::bgra_to_bgr565(src, dst, StreamAccessor::getStream(stream)); + cuda::bgra_to_bgr565(src, dst, StreamAccessor::getStream(stream)); } void rgba_to_bgr555(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -220,7 +220,7 @@ namespace dst.create(src.size(), CV_8UC2); - device::rgba_to_bgr555(src, dst, StreamAccessor::getStream(stream)); + cuda::rgba_to_bgr555(src, dst, StreamAccessor::getStream(stream)); } void rgba_to_bgr565(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -230,7 +230,7 @@ namespace dst.create(src.size(), CV_8UC2); - device::rgba_to_bgr565(src, dst, StreamAccessor::getStream(stream)); + cuda::rgba_to_bgr565(src, dst, StreamAccessor::getStream(stream)); } void bgr555_to_rgb(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -240,7 +240,7 @@ namespace dst.create(src.size(), CV_8UC3); - device::bgr555_to_rgb(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr555_to_rgb(src, dst, StreamAccessor::getStream(stream)); } void bgr565_to_rgb(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -250,7 +250,7 @@ namespace dst.create(src.size(), CV_8UC3); - device::bgr565_to_rgb(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr565_to_rgb(src, dst, StreamAccessor::getStream(stream)); } void bgr555_to_bgr(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -260,7 +260,7 @@ namespace dst.create(src.size(), CV_8UC3); - device::bgr555_to_bgr(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr555_to_bgr(src, dst, StreamAccessor::getStream(stream)); } void bgr565_to_bgr(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -270,7 +270,7 @@ namespace dst.create(src.size(), CV_8UC3); - device::bgr565_to_bgr(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr565_to_bgr(src, dst, StreamAccessor::getStream(stream)); } void bgr555_to_rgba(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -280,7 +280,7 @@ namespace dst.create(src.size(), CV_8UC4); - device::bgr555_to_rgba(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr555_to_rgba(src, dst, StreamAccessor::getStream(stream)); } void bgr565_to_rgba(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -290,7 +290,7 @@ namespace dst.create(src.size(), CV_8UC4); - device::bgr565_to_rgba(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr565_to_rgba(src, dst, StreamAccessor::getStream(stream)); } void bgr555_to_bgra(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -300,7 +300,7 @@ namespace dst.create(src.size(), CV_8UC4); - device::bgr555_to_bgra(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr555_to_bgra(src, dst, StreamAccessor::getStream(stream)); } void bgr565_to_bgra(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -310,12 +310,12 @@ namespace dst.create(src.size(), CV_8UC4); - device::bgr565_to_bgra(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr565_to_bgra(src, dst, StreamAccessor::getStream(stream)); } void gray_to_bgr(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {gray_to_bgr_8u, 0, gray_to_bgr_16u, 0, 0, gray_to_bgr_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -328,7 +328,7 @@ namespace void gray_to_bgra(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {gray_to_bgra_8u, 0, gray_to_bgra_16u, 0, 0, gray_to_bgra_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -346,7 +346,7 @@ namespace dst.create(src.size(), CV_8UC2); - device::gray_to_bgr555(src, dst, StreamAccessor::getStream(stream)); + cuda::gray_to_bgr555(src, dst, StreamAccessor::getStream(stream)); } void gray_to_bgr565(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -356,7 +356,7 @@ namespace dst.create(src.size(), CV_8UC2); - device::gray_to_bgr565(src, dst, StreamAccessor::getStream(stream)); + cuda::gray_to_bgr565(src, dst, StreamAccessor::getStream(stream)); } void bgr555_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -366,7 +366,7 @@ namespace dst.create(src.size(), CV_8UC1); - device::bgr555_to_gray(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr555_to_gray(src, dst, StreamAccessor::getStream(stream)); } void bgr565_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) @@ -376,12 +376,12 @@ namespace dst.create(src.size(), CV_8UC1); - device::bgr565_to_gray(src, dst, StreamAccessor::getStream(stream)); + cuda::bgr565_to_gray(src, dst, StreamAccessor::getStream(stream)); } void rgb_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {rgb_to_gray_8u, 0, rgb_to_gray_16u, 0, 0, rgb_to_gray_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -394,7 +394,7 @@ namespace void bgr_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {bgr_to_gray_8u, 0, bgr_to_gray_16u, 0, 0, bgr_to_gray_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -407,7 +407,7 @@ namespace void rgba_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {rgba_to_gray_8u, 0, rgba_to_gray_16u, 0, 0, rgba_to_gray_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -420,7 +420,7 @@ namespace void bgra_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[] = {bgra_to_gray_8u, 0, bgra_to_gray_16u, 0, 0, bgra_to_gray_32f}; CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); @@ -433,7 +433,7 @@ namespace void rgb_to_yuv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -459,7 +459,7 @@ namespace void bgr_to_yuv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -485,7 +485,7 @@ namespace void yuv_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -511,7 +511,7 @@ namespace void yuv_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -537,7 +537,7 @@ namespace void rgb_to_YCrCb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -563,7 +563,7 @@ namespace void bgr_to_YCrCb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -589,7 +589,7 @@ namespace void YCrCb_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -615,7 +615,7 @@ namespace void YCrCb_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -641,7 +641,7 @@ namespace void rgb_to_xyz(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -667,7 +667,7 @@ namespace void bgr_to_xyz(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -693,7 +693,7 @@ namespace void xyz_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -719,7 +719,7 @@ namespace void xyz_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -745,7 +745,7 @@ namespace void rgb_to_hsv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -771,7 +771,7 @@ namespace void bgr_to_hsv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -797,7 +797,7 @@ namespace void hsv_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -823,7 +823,7 @@ namespace void hsv_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -849,7 +849,7 @@ namespace void rgb_to_hls(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -875,7 +875,7 @@ namespace void bgr_to_hls(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -901,7 +901,7 @@ namespace void hls_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -927,7 +927,7 @@ namespace void hls_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -953,7 +953,7 @@ namespace void rgb_to_hsv_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -979,7 +979,7 @@ namespace void bgr_to_hsv_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -1005,7 +1005,7 @@ namespace void hsv_to_rgb_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -1031,7 +1031,7 @@ namespace void hsv_to_bgr_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -1057,7 +1057,7 @@ namespace void rgb_to_hls_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -1083,7 +1083,7 @@ namespace void bgr_to_hls_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -1109,7 +1109,7 @@ namespace void hls_to_rgb_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -1135,7 +1135,7 @@ namespace void hls_to_bgr_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][6] = { { @@ -1161,7 +1161,7 @@ namespace void bgr_to_lab(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1187,7 +1187,7 @@ namespace void rgb_to_lab(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1213,7 +1213,7 @@ namespace void lbgr_to_lab(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1239,7 +1239,7 @@ namespace void lrgb_to_lab(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1265,7 +1265,7 @@ namespace void lab_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1291,7 +1291,7 @@ namespace void lab_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1317,7 +1317,7 @@ namespace void lab_to_lbgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1343,7 +1343,7 @@ namespace void lab_to_lrgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1369,7 +1369,7 @@ namespace void bgr_to_luv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1395,7 +1395,7 @@ namespace void rgb_to_luv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1421,7 +1421,7 @@ namespace void lbgr_to_luv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1447,7 +1447,7 @@ namespace void lrgb_to_luv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1473,7 +1473,7 @@ namespace void luv_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1499,7 +1499,7 @@ namespace void luv_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1525,7 +1525,7 @@ namespace void luv_to_lbgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1551,7 +1551,7 @@ namespace void luv_to_lrgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) { - using namespace cv::gpu::device; + using namespace cv::gpu::cuda; static const gpu_func_t funcs[2][2][2] = { { @@ -1895,9 +1895,9 @@ void cv::gpu::demosaicing(const GpuMat& src, GpuMat& dst, int code, int dcn, Str code == COLOR_BayerRG2BGR_MHT || code == COLOR_BayerGR2BGR_MHT ? 0 : 1); if (dcn == 3) - device::MHCdemosaic<3>(srcWhole, make_int2(ofs.x, ofs.y), dst, firstRed, StreamAccessor::getStream(stream)); + cuda::MHCdemosaic<3>(srcWhole, make_int2(ofs.x, ofs.y), dst, firstRed, StreamAccessor::getStream(stream)); else - device::MHCdemosaic<4>(srcWhole, make_int2(ofs.x, ofs.y), dst, firstRed, StreamAccessor::getStream(stream)); + cuda::MHCdemosaic<4>(srcWhole, make_int2(ofs.x, ofs.y), dst, firstRed, StreamAccessor::getStream(stream)); break; } @@ -1917,7 +1917,7 @@ void cv::gpu::demosaicing(const GpuMat& src, GpuMat& dst, int code, int dcn, Str const int2 firstRed = make_int2(code == COLOR_BayerRG2BGR_MHT || code == COLOR_BayerGB2BGR_MHT ? 0 : 1, code == COLOR_BayerRG2BGR_MHT || code == COLOR_BayerGR2BGR_MHT ? 0 : 1); - device::MHCdemosaic<1>(srcWhole, make_int2(ofs.x, ofs.y), dst, firstRed, StreamAccessor::getStream(stream)); + cuda::MHCdemosaic<1>(srcWhole, make_int2(ofs.x, ofs.y), dst, firstRed, StreamAccessor::getStream(stream)); break; } diff --git a/modules/gpu/src/cuda/NV12ToARGB.cu b/modules/gpu/src/cuda/NV12ToARGB.cu index 45e44a5d0..4110dbc2a 100644 --- a/modules/gpu/src/cuda/NV12ToARGB.cu +++ b/modules/gpu/src/cuda/NV12ToARGB.cu @@ -49,9 +49,9 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" +#include "opencv2/core/cuda/common.hpp" -namespace cv { namespace gpu { namespace device { +namespace cv { namespace gpu { namespace cuda { namespace video_decoding { __constant__ uint constAlpha = ((uint)0xff << 24); diff --git a/modules/gpu/src/cuda/bf_knnmatch.cu b/modules/gpu/src/cuda/bf_knnmatch.cu index 2177bb26b..629ac694a 100644 --- a/modules/gpu/src/cuda/bf_knnmatch.cu +++ b/modules/gpu/src/cuda/bf_knnmatch.cu @@ -42,15 +42,15 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/utility.hpp" -#include "opencv2/core/device/reduce.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/vec_distance.hpp" -#include "opencv2/core/device/datamov_utils.hpp" -#include "opencv2/core/device/warp_shuffle.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/utility.hpp" +#include "opencv2/core/cuda/reduce.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/vec_distance.hpp" +#include "opencv2/core/cuda/datamov_utils.hpp" +#include "opencv2/core/cuda/warp_shuffle.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace bf_knnmatch { @@ -1249,7 +1249,7 @@ namespace cv { namespace gpu { namespace device //template void match2Hamming_gpu(const PtrStepSzb& query, const PtrStepSzb& trains, const PtrStepSz& masks, const PtrStepSzb& trainIdx, const PtrStepSzb& imgIdx, const PtrStepSzb& distance, cudaStream_t stream); template void match2Hamming_gpu(const PtrStepSzb& query, const PtrStepSzb& trains, const PtrStepSz& masks, const PtrStepSzb& trainIdx, const PtrStepSzb& imgIdx, const PtrStepSzb& distance, cudaStream_t stream); } // namespace bf_knnmatch -}}} // namespace cv { namespace gpu { namespace device { +}}} // namespace cv { namespace gpu { namespace cuda { #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/bf_match.cu b/modules/gpu/src/cuda/bf_match.cu index c3efa7419..1e7cf8ab8 100644 --- a/modules/gpu/src/cuda/bf_match.cu +++ b/modules/gpu/src/cuda/bf_match.cu @@ -42,14 +42,14 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/utility.hpp" -#include "opencv2/core/device/reduce.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/vec_distance.hpp" -#include "opencv2/core/device/datamov_utils.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/utility.hpp" +#include "opencv2/core/cuda/reduce.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/vec_distance.hpp" +#include "opencv2/core/cuda/datamov_utils.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace bf_match { @@ -768,7 +768,7 @@ namespace cv { namespace gpu { namespace device //template void matchHamming_gpu(const PtrStepSzb& query, const PtrStepSzb& trains, const PtrStepSz& masks, const PtrStepSzi& trainIdx, const PtrStepSzi& imgIdx, const PtrStepSzf& distance, cudaStream_t stream); template void matchHamming_gpu(const PtrStepSzb& query, const PtrStepSzb& trains, const PtrStepSz& masks, const PtrStepSzi& trainIdx, const PtrStepSzi& imgIdx, const PtrStepSzf& distance, cudaStream_t stream); } // namespace bf_match -}}} // namespace cv { namespace gpu { namespace device { +}}} // namespace cv { namespace gpu { namespace cuda { #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/bf_radius_match.cu b/modules/gpu/src/cuda/bf_radius_match.cu index d5ba42f21..1c0857748 100644 --- a/modules/gpu/src/cuda/bf_radius_match.cu +++ b/modules/gpu/src/cuda/bf_radius_match.cu @@ -42,13 +42,13 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/utility.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/vec_distance.hpp" -#include "opencv2/core/device/datamov_utils.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/utility.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/vec_distance.hpp" +#include "opencv2/core/cuda/datamov_utils.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace bf_radius_match { @@ -457,7 +457,7 @@ namespace cv { namespace gpu { namespace device //template void matchHamming_gpu(const PtrStepSzb& query, const PtrStepSzb* trains, int n, float maxDistance, const PtrStepSzb* masks, const PtrStepSzi& trainIdx, const PtrStepSzi& imgIdx, const PtrStepSzf& distance, const PtrStepSz& nMatches, cudaStream_t stream); template void matchHamming_gpu(const PtrStepSzb& query, const PtrStepSzb* trains, int n, float maxDistance, const PtrStepSzb* masks, const PtrStepSzi& trainIdx, const PtrStepSzi& imgIdx, const PtrStepSzf& distance, const PtrStepSz& nMatches, cudaStream_t stream); } // namespace bf_radius_match -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/bgfg_gmg.cu b/modules/gpu/src/cuda/bgfg_gmg.cu index a94381550..0047fe53e 100644 --- a/modules/gpu/src/cuda/bgfg_gmg.cu +++ b/modules/gpu/src/cuda/bgfg_gmg.cu @@ -42,11 +42,11 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/limits.hpp" -namespace cv { namespace gpu { namespace device { +namespace cv { namespace gpu { namespace cuda { namespace bgfg_gmg { __constant__ int c_width; diff --git a/modules/gpu/src/cuda/bgfg_mog.cu b/modules/gpu/src/cuda/bgfg_mog.cu index 57ab1f238..6a514f7d3 100644 --- a/modules/gpu/src/cuda/bgfg_mog.cu +++ b/modules/gpu/src/cuda/bgfg_mog.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/limits.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace mog { diff --git a/modules/gpu/src/cuda/bilateral_filter.cu b/modules/gpu/src/cuda/bilateral_filter.cu index 64a2a3053..17c7c1d8e 100644 --- a/modules/gpu/src/cuda/bilateral_filter.cu +++ b/modules/gpu/src/cuda/bilateral_filter.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" using namespace cv::gpu; @@ -55,7 +55,7 @@ typedef unsigned short ushort; ////////////////////////////////////////////////////////////////////////////////// /// Bilateral filtering -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -163,7 +163,7 @@ namespace cv { namespace gpu { namespace device #define OCV_INSTANTIATE_BILATERAL_FILTER(T) \ - template void cv::gpu::device::imgproc::bilateral_filter_gpu(const PtrStepSzb&, PtrStepSzb, int, float, float, int, cudaStream_t); + template void cv::gpu::cuda::imgproc::bilateral_filter_gpu(const PtrStepSzb&, PtrStepSzb, int, float, float, int, cudaStream_t); OCV_INSTANTIATE_BILATERAL_FILTER(uchar) //OCV_INSTANTIATE_BILATERAL_FILTER(uchar2) diff --git a/modules/gpu/src/cuda/blend.cu b/modules/gpu/src/cuda/blend.cu index db49e6cc5..b4ecfbb7f 100644 --- a/modules/gpu/src/cuda/blend.cu +++ b/modules/gpu/src/cuda/blend.cu @@ -42,9 +42,9 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" +#include "opencv2/core/cuda/common.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace blend { @@ -115,7 +115,7 @@ namespace cv { namespace gpu { namespace device cudaSafeCall(cudaDeviceSynchronize()); } } // namespace blend -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/calib3d.cu b/modules/gpu/src/cuda/calib3d.cu index 2c122fde0..5d12405d5 100644 --- a/modules/gpu/src/cuda/calib3d.cu +++ b/modules/gpu/src/cuda/calib3d.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/transform.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/transform.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/reduce.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { #define SOLVE_PNP_RANSAC_MAX_NUM_ITERS 200 @@ -79,7 +79,7 @@ namespace cv { namespace gpu { namespace device cudaSafeCall(cudaMemcpyToSymbol(crot1, rot + 3, sizeof(float) * 3)); cudaSafeCall(cudaMemcpyToSymbol(crot2, rot + 6, sizeof(float) * 3)); cudaSafeCall(cudaMemcpyToSymbol(ctransl, transl, sizeof(float) * 3)); - cv::gpu::device::transform(src, dst, TransformOp(), WithOutMask(), stream); + cv::gpu::cuda::transform(src, dst, TransformOp(), WithOutMask(), stream); } } // namespace transform_points @@ -120,7 +120,7 @@ namespace cv { namespace gpu { namespace device cudaSafeCall(cudaMemcpyToSymbol(ctransl, transl, sizeof(float) * 3)); cudaSafeCall(cudaMemcpyToSymbol(cproj0, proj, sizeof(float) * 3)); cudaSafeCall(cudaMemcpyToSymbol(cproj1, proj + 3, sizeof(float) * 3)); - cv::gpu::device::transform(src, dst, ProjectOp(), WithOutMask(), stream); + cv::gpu::cuda::transform(src, dst, ProjectOp(), WithOutMask(), stream); } } // namespace project_points @@ -187,7 +187,7 @@ namespace cv { namespace gpu { namespace device cudaSafeCall( cudaDeviceSynchronize() ); } } // namespace solvepnp_ransac -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/canny.cu b/modules/gpu/src/cuda/canny.cu index 2b7bcf763..151f234f0 100644 --- a/modules/gpu/src/cuda/canny.cu +++ b/modules/gpu/src/cuda/canny.cu @@ -44,14 +44,14 @@ #include #include //std::swap -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/emulation.hpp" -#include "opencv2/core/device/transform.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/emulation.hpp" +#include "opencv2/core/cuda/transform.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/utility.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; namespace canny { @@ -77,7 +77,7 @@ namespace canny }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template <> struct TransformFunctorTraits : DefaultTransformFunctorTraits { @@ -475,7 +475,7 @@ namespace canny }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template <> struct TransformFunctorTraits : DefaultTransformFunctorTraits { diff --git a/modules/gpu/src/cuda/ccomponetns.cu b/modules/gpu/src/cuda/ccomponetns.cu index 5519efeb2..2e52ff2bf 100644 --- a/modules/gpu/src/cuda/ccomponetns.cu +++ b/modules/gpu/src/cuda/ccomponetns.cu @@ -42,15 +42,15 @@ #if !defined CUDA_DISABLER -#include -#include -#include -#include +#include +#include +#include +#include #include #include -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace ccl { diff --git a/modules/gpu/src/cuda/clahe.cu b/modules/gpu/src/cuda/clahe.cu index 35ce9c1a0..c5ecbf4e8 100644 --- a/modules/gpu/src/cuda/clahe.cu +++ b/modules/gpu/src/cuda/clahe.cu @@ -42,15 +42,15 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/emulation.hpp" -#include "opencv2/core/device/scan.hpp" -#include "opencv2/core/device/reduce.hpp" -#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/emulation.hpp" +#include "opencv2/core/cuda/scan.hpp" +#include "opencv2/core/cuda/reduce.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; namespace clahe { diff --git a/modules/gpu/src/cuda/color.cu b/modules/gpu/src/cuda/color.cu index 61794e2a8..a38873518 100644 --- a/modules/gpu/src/cuda/color.cu +++ b/modules/gpu/src/cuda/color.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/transform.hpp" -#include "opencv2/core/device/color.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/transform.hpp" +#include "opencv2/core/cuda/color.hpp" #include "cvt_color_internal.h" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { OPENCV_GPU_TRANSFORM_FUNCTOR_TRAITS(bgra_to_rgba_traits::functor_type) { @@ -229,7 +229,7 @@ namespace cv { namespace gpu { namespace device traits::functor_type functor = traits::create_functor(); \ typedef typename traits::functor_type::argument_type src_t; \ typedef typename traits::functor_type::result_type dst_t; \ - cv::gpu::device::transform((PtrStepSz)src, (PtrStepSz)dst, functor, WithOutMask(), stream); \ + cv::gpu::cuda::transform((PtrStepSz)src, (PtrStepSz)dst, functor, WithOutMask(), stream); \ } #define OPENCV_GPU_IMPLEMENT_CVTCOLOR_ONE(name) \ @@ -456,6 +456,6 @@ namespace cv { namespace gpu { namespace device #undef OPENCV_GPU_IMPLEMENT_CVTCOLOR_ALL #undef OPENCV_GPU_IMPLEMENT_CVTCOLOR_8U32F #undef OPENCV_GPU_IMPLEMENT_CVTCOLOR_8U32F_FULL -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/column_filter.h b/modules/gpu/src/cuda/column_filter.h index d28ceafc6..00278103e 100644 --- a/modules/gpu/src/cuda/column_filter.h +++ b/modules/gpu/src/cuda/column_filter.h @@ -40,13 +40,13 @@ // //M*/ -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; namespace column_filter { diff --git a/modules/gpu/src/cuda/copy_make_border.cu b/modules/gpu/src/cuda/copy_make_border.cu index 3797c09aa..43544658f 100644 --- a/modules/gpu/src/cuda/copy_make_border.cu +++ b/modules/gpu/src/cuda/copy_make_border.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -126,6 +126,6 @@ namespace cv { namespace gpu { namespace device template void copyMakeBorder_gpu(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const float* borderValue, cudaStream_t stream); template void copyMakeBorder_gpu(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const float* borderValue, cudaStream_t stream); } // namespace imgproc -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/debayer.cu b/modules/gpu/src/cuda/debayer.cu index 468c12f08..a079bd583 100644 --- a/modules/gpu/src/cuda/debayer.cu +++ b/modules/gpu/src/cuda/debayer.cu @@ -42,14 +42,14 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/color.hpp" -#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/color.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct Bayer2BGR; diff --git a/modules/gpu/src/cuda/disp_bilateral_filter.cu b/modules/gpu/src/cuda/disp_bilateral_filter.cu index 9a01b8dce..c3edff320 100644 --- a/modules/gpu/src/cuda/disp_bilateral_filter.cu +++ b/modules/gpu/src/cuda/disp_bilateral_filter.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/limits.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace disp_bilateral_filter { @@ -218,6 +218,6 @@ namespace cv { namespace gpu { namespace device template void disp_bilateral_filter(PtrStepSz disp, PtrStepSzb img, int channels, int iters, cudaStream_t stream); template void disp_bilateral_filter(PtrStepSz disp, PtrStepSzb img, int channels, int iters, cudaStream_t stream); } // namespace bilateral_filter -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/element_operations.cu b/modules/gpu/src/cuda/element_operations.cu index 06003e999..1d3b7ca4c 100644 --- a/modules/gpu/src/cuda/element_operations.cu +++ b/modules/gpu/src/cuda/element_operations.cu @@ -42,16 +42,16 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/transform.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/simd_functions.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/transform.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/simd_functions.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; namespace arithm { @@ -193,7 +193,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template <> struct TransformFunctorTraits< arithm::VAdd4 > : arithm::ArithmFuncTraits { @@ -308,7 +308,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< arithm::AddScalar > : arithm::ArithmFuncTraits { @@ -428,7 +428,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template <> struct TransformFunctorTraits< arithm::VSub4 > : arithm::ArithmFuncTraits { @@ -657,7 +657,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template <> struct TransformFunctorTraits : arithm::ArithmFuncTraits { @@ -774,7 +774,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< arithm::MulScalar > : arithm::ArithmFuncTraits { @@ -925,7 +925,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template <> struct TransformFunctorTraits : arithm::ArithmFuncTraits { @@ -1111,7 +1111,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< arithm::DivInv > : arithm::ArithmFuncTraits { @@ -1240,7 +1240,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template <> struct TransformFunctorTraits< arithm::VAbsDiff4 > : arithm::ArithmFuncTraits { @@ -1305,7 +1305,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< arithm::AbsDiffScalar > : arithm::ArithmFuncTraits { @@ -1334,7 +1334,7 @@ namespace arithm ////////////////////////////////////////////////////////////////////////// // absMat -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< abs_func > : arithm::ArithmFuncTraits { @@ -1375,7 +1375,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< arithm::Sqr > : arithm::ArithmFuncTraits { @@ -1402,7 +1402,7 @@ namespace arithm ////////////////////////////////////////////////////////////////////////// // sqrtMat -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< sqrt_func > : arithm::ArithmFuncTraits { @@ -1429,7 +1429,7 @@ namespace arithm ////////////////////////////////////////////////////////////////////////// // logMat -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< log_func > : arithm::ArithmFuncTraits { @@ -1471,7 +1471,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< arithm::Exp > : arithm::ArithmFuncTraits { @@ -1554,7 +1554,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template <> struct TransformFunctorTraits< arithm::VCmpEq4 > : arithm::ArithmFuncTraits { @@ -1716,7 +1716,7 @@ namespace arithm #undef TYPE_VEC } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< arithm::CmpScalar > : arithm::ArithmFuncTraits { @@ -1875,7 +1875,7 @@ namespace arithm ////////////////////////////////////////////////////////////////////////////////////// // bitMat -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< bit_not > : arithm::ArithmFuncTraits { @@ -1948,7 +1948,7 @@ namespace arithm ////////////////////////////////////////////////////////////////////////////////////// // bitScalar -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< binder2nd< bit_and > > : arithm::ArithmFuncTraits { @@ -1967,17 +1967,17 @@ namespace arithm { template void bitScalarAnd(PtrStepSzb src1, uint src2, PtrStepSzb dst, cudaStream_t stream) { - transform((PtrStepSz) src1, (PtrStepSz) dst, cv::gpu::device::bind2nd(bit_and(), src2), WithOutMask(), stream); + transform((PtrStepSz) src1, (PtrStepSz) dst, cv::gpu::cuda::bind2nd(bit_and(), src2), WithOutMask(), stream); } template void bitScalarOr(PtrStepSzb src1, uint src2, PtrStepSzb dst, cudaStream_t stream) { - transform((PtrStepSz) src1, (PtrStepSz) dst, cv::gpu::device::bind2nd(bit_or(), src2), WithOutMask(), stream); + transform((PtrStepSz) src1, (PtrStepSz) dst, cv::gpu::cuda::bind2nd(bit_or(), src2), WithOutMask(), stream); } template void bitScalarXor(PtrStepSzb src1, uint src2, PtrStepSzb dst, cudaStream_t stream) { - transform((PtrStepSz) src1, (PtrStepSz) dst, cv::gpu::device::bind2nd(bit_xor(), src2), WithOutMask(), stream); + transform((PtrStepSz) src1, (PtrStepSz) dst, cv::gpu::cuda::bind2nd(bit_xor(), src2), WithOutMask(), stream); } template void bitScalarAnd(PtrStepSzb src1, uint src2, PtrStepSzb dst, cudaStream_t stream); @@ -2026,7 +2026,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template <> struct TransformFunctorTraits< arithm::VMin4 > : arithm::ArithmFuncTraits { @@ -2076,7 +2076,7 @@ namespace arithm template void minScalar(PtrStepSzb src1, double src2, PtrStepSzb dst, cudaStream_t stream) { - transform((PtrStepSz) src1, (PtrStepSz) dst, cv::gpu::device::bind2nd(minimum(), src2), WithOutMask(), stream); + transform((PtrStepSz) src1, (PtrStepSz) dst, cv::gpu::cuda::bind2nd(minimum(), src2), WithOutMask(), stream); } template void minScalar(PtrStepSzb src1, double src2, PtrStepSzb dst, cudaStream_t stream); @@ -2118,7 +2118,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template <> struct TransformFunctorTraits< arithm::VMax4 > : arithm::ArithmFuncTraits { @@ -2168,7 +2168,7 @@ namespace arithm template void maxScalar(PtrStepSzb src1, double src2, PtrStepSzb dst, cudaStream_t stream) { - transform((PtrStepSz) src1, (PtrStepSz) dst, cv::gpu::device::bind2nd(maximum(), src2), WithOutMask(), stream); + transform((PtrStepSz) src1, (PtrStepSz) dst, cv::gpu::cuda::bind2nd(maximum(), src2), WithOutMask(), stream); } template void maxScalar(PtrStepSzb src1, double src2, PtrStepSzb dst, cudaStream_t stream); @@ -2183,7 +2183,7 @@ namespace arithm ////////////////////////////////////////////////////////////////////////// // threshold -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< thresh_binary_func > : arithm::ArithmFuncTraits { @@ -2297,7 +2297,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct TransformFunctorTraits< arithm::PowOp > : arithm::ArithmFuncTraits { @@ -2372,7 +2372,7 @@ namespace arithm }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template struct AddWeightedTraits : DefaultTransformFunctorTraits< arithm::AddWeighted > { diff --git a/modules/gpu/src/cuda/fast.cu b/modules/gpu/src/cuda/fast.cu index 57a7a3489..7ac796839 100644 --- a/modules/gpu/src/cuda/fast.cu +++ b/modules/gpu/src/cuda/fast.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/utility.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace fast { diff --git a/modules/gpu/src/cuda/fgd_bgfg.cu b/modules/gpu/src/cuda/fgd_bgfg.cu index ebc7cf5cf..b0da49f8b 100644 --- a/modules/gpu/src/cuda/fgd_bgfg.cu +++ b/modules/gpu/src/cuda/fgd_bgfg.cu @@ -42,16 +42,16 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/utility.hpp" -#include "opencv2/core/device/reduce.hpp" -#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/utility.hpp" +#include "opencv2/core/cuda/reduce.hpp" +#include "opencv2/core/cuda/functional.hpp" #include "fgd_bgfg_common.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; namespace bgfg { diff --git a/modules/gpu/src/cuda/gftt.cu b/modules/gpu/src/cuda/gftt.cu index 593053dbf..cc4467b45 100644 --- a/modules/gpu/src/cuda/gftt.cu +++ b/modules/gpu/src/cuda/gftt.cu @@ -45,10 +45,10 @@ #include #include -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/utility.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace gfft { diff --git a/modules/gpu/src/cuda/global_motion.cu b/modules/gpu/src/cuda/global_motion.cu index 79a19ddcf..f8d95d438 100644 --- a/modules/gpu/src/cuda/global_motion.cu +++ b/modules/gpu/src/cuda/global_motion.cu @@ -45,9 +45,9 @@ #include #include #include -#include "opencv2/core/device/common.hpp" +#include "opencv2/core/cuda/common.hpp" -namespace cv { namespace gpu { namespace device { namespace globmotion { +namespace cv { namespace gpu { namespace cuda { namespace globmotion { __constant__ float cml[9]; __constant__ float cmr[9]; diff --git a/modules/gpu/src/cuda/hist.cu b/modules/gpu/src/cuda/hist.cu index 2e67a4068..566357279 100644 --- a/modules/gpu/src/cuda/hist.cu +++ b/modules/gpu/src/cuda/hist.cu @@ -42,13 +42,13 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/emulation.hpp" -#include "opencv2/core/device/transform.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/emulation.hpp" +#include "opencv2/core/cuda/transform.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; namespace hist { @@ -127,7 +127,7 @@ namespace hist }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { template <> struct TransformFunctorTraits : DefaultTransformFunctorTraits { diff --git a/modules/gpu/src/cuda/hog.cu b/modules/gpu/src/cuda/hog.cu index 34cc80ce7..6d020070c 100644 --- a/modules/gpu/src/cuda/hog.cu +++ b/modules/gpu/src/cuda/hog.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/reduce.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/warp_shuffle.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/reduce.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/warp_shuffle.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { // Other values are not supported #define CELL_WIDTH 8 @@ -808,7 +808,7 @@ namespace cv { namespace gpu { namespace device void resize_8UC1(const PtrStepSzb& src, PtrStepSzb dst) { resize_for_hog (src, dst, resize8UC1_tex); } void resize_8UC4(const PtrStepSzb& src, PtrStepSzb dst) { resize_for_hog(src, dst, resize8UC4_tex); } } // namespace hog -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/hough.cu b/modules/gpu/src/cuda/hough.cu index 1f885fbf6..d8f8c89d4 100644 --- a/modules/gpu/src/cuda/hough.cu +++ b/modules/gpu/src/cuda/hough.cu @@ -45,13 +45,13 @@ #include #include -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/emulation.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/dynamic_smem.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/emulation.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/dynamic_smem.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace hough { @@ -1424,7 +1424,7 @@ namespace cv { namespace gpu { namespace device cudaSafeCall( cudaDeviceSynchronize() ); thrust::device_ptr sizesPtr(sizes); - thrust::transform(sizesPtr, sizesPtr + levels + 1, sizesPtr, device::bind2nd(device::minimum(), maxSize)); + thrust::transform(sizesPtr, sizesPtr + levels + 1, sizesPtr, cuda::bind2nd(cuda::minimum(), maxSize)); } void GHT_Guil_Full_buildTemplFeatureList_gpu(const unsigned int* coordList, const float* thetaList, int pointsCount, diff --git a/modules/gpu/src/cuda/imgproc.cu b/modules/gpu/src/cuda/imgproc.cu index 0f59a771b..0fa52d004 100644 --- a/modules/gpu/src/cuda/imgproc.cu +++ b/modules/gpu/src/cuda/imgproc.cu @@ -42,14 +42,14 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" #include "internal_shared.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -1002,7 +1002,7 @@ namespace cv { namespace gpu { namespace device template void filter2D_gpu(PtrStepSzb srcWhole, int ofsX, int ofsY, PtrStepSzb dst, int kWidth, int kHeight, int anchorX, int anchorY, const float* kernel, int borderMode, const float* borderValue, cudaStream_t stream); template void filter2D_gpu(PtrStepSzb srcWhole, int ofsX, int ofsY, PtrStepSzb dst, int kWidth, int kHeight, int anchorX, int anchorY, const float* kernel, int borderMode, const float* borderValue, cudaStream_t stream); } // namespace imgproc -}}} // namespace cv { namespace gpu { namespace device { +}}} // namespace cv { namespace gpu { namespace cuda { #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/integral_image.cu b/modules/gpu/src/cuda/integral_image.cu index 9ef316641..3759d0412 100644 --- a/modules/gpu/src/cuda/integral_image.cu +++ b/modules/gpu/src/cuda/integral_image.cu @@ -42,9 +42,9 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" +#include "opencv2/core/cuda/common.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { diff --git a/modules/gpu/src/cuda/internal_shared.hpp b/modules/gpu/src/cuda/internal_shared.hpp index 6e8461156..4cdf81626 100644 --- a/modules/gpu/src/cuda/internal_shared.hpp +++ b/modules/gpu/src/cuda/internal_shared.hpp @@ -48,7 +48,7 @@ #include "NPP_staging.hpp" #include "opencv2/gpu/devmem2d.hpp" #include "safe_call.hpp" -#include "opencv2/core/device/common.hpp" +#include "opencv2/core/cuda/common.hpp" namespace cv { namespace gpu { diff --git a/modules/gpu/src/cuda/lbp.cu b/modules/gpu/src/cuda/lbp.cu index 87dfbfca0..cc63bd7a4 100644 --- a/modules/gpu/src/cuda/lbp.cu +++ b/modules/gpu/src/cuda/lbp.cu @@ -43,10 +43,10 @@ #if !defined CUDA_DISABLER #include "lbp.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace lbp { diff --git a/modules/gpu/src/cuda/lbp.hpp b/modules/gpu/src/cuda/lbp.hpp index 9cfebd575..1b8ffcd6a 100644 --- a/modules/gpu/src/cuda/lbp.hpp +++ b/modules/gpu/src/cuda/lbp.hpp @@ -43,10 +43,10 @@ #ifndef __OPENCV_GPU_DEVICE_LBP_HPP_ #define __OPENCV_GPU_DEVICE_LBP_HPP_ -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/emulation.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/emulation.hpp" -namespace cv { namespace gpu { namespace device { +namespace cv { namespace gpu { namespace cuda { namespace lbp { diff --git a/modules/gpu/src/cuda/match_template.cu b/modules/gpu/src/cuda/match_template.cu index 9ad3338d7..95e7c3811 100644 --- a/modules/gpu/src/cuda/match_template.cu +++ b/modules/gpu/src/cuda/match_template.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/vec_math.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace match_template { @@ -910,7 +910,7 @@ namespace cv { namespace gpu { namespace device cudaSafeCall( cudaDeviceSynchronize() ); } } //namespace match_template -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/mathfunc.cu b/modules/gpu/src/cuda/mathfunc.cu index 01ebf3dc3..ed9181159 100644 --- a/modules/gpu/src/cuda/mathfunc.cu +++ b/modules/gpu/src/cuda/mathfunc.cu @@ -42,9 +42,9 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" +#include "opencv2/core/cuda/common.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace mathfunc { @@ -212,6 +212,6 @@ namespace cv { namespace gpu { namespace device callers[mag.data == 0](mag, angle, x, y, angleInDegrees, stream); } } // namespace mathfunc -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/matrix_reductions.cu b/modules/gpu/src/cuda/matrix_reductions.cu index d0edea5ec..0c1f7194b 100644 --- a/modules/gpu/src/cuda/matrix_reductions.cu +++ b/modules/gpu/src/cuda/matrix_reductions.cu @@ -42,18 +42,18 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/reduce.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/utility.hpp" -#include "opencv2/core/device/type_traits.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/reduce.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/utility.hpp" +#include "opencv2/core/cuda/type_traits.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; namespace detail { @@ -205,7 +205,7 @@ namespace detail template static __device__ __forceinline__ thrust::tuple smem_tuple(R* smem) { - return cv::gpu::device::smem_tuple(smem, smem + BLOCK_SIZE); + return cv::gpu::cuda::smem_tuple(smem, smem + BLOCK_SIZE); } template @@ -225,7 +225,7 @@ namespace detail template static __device__ __forceinline__ thrust::tuple smem_tuple(R* smem) { - return cv::gpu::device::smem_tuple(smem, smem + BLOCK_SIZE, smem + 2 * BLOCK_SIZE); + return cv::gpu::cuda::smem_tuple(smem, smem + BLOCK_SIZE, smem + 2 * BLOCK_SIZE); } template @@ -245,7 +245,7 @@ namespace detail template static __device__ __forceinline__ thrust::tuple smem_tuple(R* smem) { - return cv::gpu::device::smem_tuple(smem, smem + BLOCK_SIZE, smem + 2 * BLOCK_SIZE, smem + 3 * BLOCK_SIZE); + return cv::gpu::cuda::smem_tuple(smem, smem + BLOCK_SIZE, smem + 2 * BLOCK_SIZE, smem + 3 * BLOCK_SIZE); } template @@ -340,7 +340,7 @@ namespace sum { sum = tid < gridDim.x * gridDim.y ? result[tid] : VecTraits::all(0); - device::reduce(detail::Unroll::template smem_tuple(smem), detail::Unroll::tie(sum), tid, detail::Unroll::op(plus())); + cuda::reduce(detail::Unroll::template smem_tuple(smem), detail::Unroll::tie(sum), tid, detail::Unroll::op(plus())); if (tid == 0) { @@ -383,7 +383,7 @@ namespace sum } } - device::reduce(detail::Unroll::template smem_tuple(smem), detail::Unroll::tie(sum), tid, detail::Unroll::op(plus())); + cuda::reduce(detail::Unroll::template smem_tuple(smem), detail::Unroll::tie(sum), tid, detail::Unroll::op(plus())); GlobalReduce::run(sum, result, tid, bid, smem); } @@ -642,7 +642,7 @@ namespace minMax const minimum minOp; const maximum maxOp; - device::reduce(smem_tuple(sminval, smaxval), thrust::tie(mymin, mymax), tid, thrust::make_tuple(minOp, maxOp)); + cuda::reduce(smem_tuple(sminval, smaxval), thrust::tie(mymin, mymax), tid, thrust::make_tuple(minOp, maxOp)); if (tid == 0) { @@ -690,7 +690,7 @@ namespace minMax } } - device::reduce(smem_tuple(sminval, smaxval), thrust::tie(mymin, mymax), tid, thrust::make_tuple(minOp, maxOp)); + cuda::reduce(smem_tuple(sminval, smaxval), thrust::tie(mymin, mymax), tid, thrust::make_tuple(minOp, maxOp)); GlobalReduce::run(mymin, mymax, minval, maxval, tid, bid, sminval, smaxval); } @@ -994,7 +994,7 @@ namespace countNonZero } } - device::reduce(scount, mycount, tid, plus()); + cuda::reduce(scount, mycount, tid, plus()); #if __CUDA_ARCH__ >= 200 if (tid == 0) @@ -1019,7 +1019,7 @@ namespace countNonZero { mycount = tid < gridDim.x * gridDim.y ? count[tid] : 0; - device::reduce(scount, mycount, tid, plus()); + cuda::reduce(scount, mycount, tid, plus()); if (tid == 0) { @@ -1217,7 +1217,7 @@ namespace reduce volatile S* srow = smem + threadIdx.y * 16; myVal = srow[threadIdx.x]; - device::reduce<16>(srow, myVal, threadIdx.x, op); + cuda::reduce<16>(srow, myVal, threadIdx.x, op); if (threadIdx.x == 0) srow[0] = myVal; @@ -1301,7 +1301,7 @@ namespace reduce for (int x = threadIdx.x; x < src.cols; x += BLOCK_SIZE) myVal = op(myVal, saturate_cast(srcRow[x])); - device::reduce(detail::Unroll::template smem_tuple(smem), detail::Unroll::tie(myVal), threadIdx.x, detail::Unroll::op(op)); + cuda::reduce(detail::Unroll::template smem_tuple(smem), detail::Unroll::tie(myVal), threadIdx.x, detail::Unroll::op(op)); if (threadIdx.x == 0) dst[y] = saturate_cast(op.result(myVal, src.cols)); diff --git a/modules/gpu/src/cuda/nlm.cu b/modules/gpu/src/cuda/nlm.cu index 6fb5dbaa7..fae24958a 100644 --- a/modules/gpu/src/cuda/nlm.cu +++ b/modules/gpu/src/cuda/nlm.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/reduce.hpp" -#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/reduce.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" using namespace cv::gpu; @@ -57,7 +57,7 @@ typedef unsigned short ushort; ////////////////////////////////////////////////////////////////////////////////// //// Non Local Means Denosing -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -179,7 +179,7 @@ namespace cv { namespace gpu { namespace device ////////////////////////////////////////////////////////////////////////////////// //// Non Local Means Denosing (fast approximate version) -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -190,7 +190,7 @@ namespace cv { namespace gpu { namespace device template static __device__ __forceinline__ thrust::tuple smem_tuple(float* smem) { - return cv::gpu::device::smem_tuple(smem, smem + BLOCK_SIZE); + return cv::gpu::cuda::smem_tuple(smem, smem + BLOCK_SIZE); } static __device__ __forceinline__ thrust::tuple tie(float& val1, float& val2) @@ -209,7 +209,7 @@ namespace cv { namespace gpu { namespace device template static __device__ __forceinline__ thrust::tuple smem_tuple(float* smem) { - return cv::gpu::device::smem_tuple(smem, smem + BLOCK_SIZE, smem + 2 * BLOCK_SIZE); + return cv::gpu::cuda::smem_tuple(smem, smem + BLOCK_SIZE, smem + 2 * BLOCK_SIZE); } static __device__ __forceinline__ thrust::tuple tie(float& val1, float2& val2) @@ -228,7 +228,7 @@ namespace cv { namespace gpu { namespace device template static __device__ __forceinline__ thrust::tuple smem_tuple(float* smem) { - return cv::gpu::device::smem_tuple(smem, smem + BLOCK_SIZE, smem + 2 * BLOCK_SIZE, smem + 3 * BLOCK_SIZE); + return cv::gpu::cuda::smem_tuple(smem, smem + BLOCK_SIZE, smem + 2 * BLOCK_SIZE, smem + 3 * BLOCK_SIZE); } static __device__ __forceinline__ thrust::tuple tie(float& val1, float3& val2) @@ -247,7 +247,7 @@ namespace cv { namespace gpu { namespace device template static __device__ __forceinline__ thrust::tuple smem_tuple(float* smem) { - return cv::gpu::device::smem_tuple(smem, smem + BLOCK_SIZE, smem + 2 * BLOCK_SIZE, smem + 3 * BLOCK_SIZE, smem + 4 * BLOCK_SIZE); + return cv::gpu::cuda::smem_tuple(smem, smem + BLOCK_SIZE, smem + 2 * BLOCK_SIZE, smem + 3 * BLOCK_SIZE, smem + 4 * BLOCK_SIZE); } static __device__ __forceinline__ thrust::tuple tie(float& val1, float4& val2) diff --git a/modules/gpu/src/cuda/optflowbm.cu b/modules/gpu/src/cuda/optflowbm.cu index 7cc4d2f3c..9adf21023 100644 --- a/modules/gpu/src/cuda/optflowbm.cu +++ b/modules/gpu/src/cuda/optflowbm.cu @@ -42,13 +42,13 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/reduce.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; namespace optflowbm { diff --git a/modules/gpu/src/cuda/optical_flow.cu b/modules/gpu/src/cuda/optical_flow.cu index a80d485e1..7219b2f62 100644 --- a/modules/gpu/src/cuda/optical_flow.cu +++ b/modules/gpu/src/cuda/optical_flow.cu @@ -42,9 +42,9 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" +#include "opencv2/core/cuda/common.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace optical_flow { diff --git a/modules/gpu/src/cuda/optical_flow_farneback.cu b/modules/gpu/src/cuda/optical_flow_farneback.cu index f9f50c8d3..df1662ecb 100644 --- a/modules/gpu/src/cuda/optical_flow_farneback.cu +++ b/modules/gpu/src/cuda/optical_flow_farneback.cu @@ -42,8 +42,8 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" #define tx threadIdx.x #define ty threadIdx.y @@ -55,7 +55,7 @@ #define BORDER_SIZE 5 #define MAX_KSIZE_HALF 100 -namespace cv { namespace gpu { namespace device { namespace optflow_farneback +namespace cv { namespace gpu { namespace cuda { namespace optflow_farneback { __constant__ float c_g[8]; __constant__ float c_xg[8]; @@ -641,7 +641,7 @@ namespace cv { namespace gpu { namespace device { namespace optflow_farneback callers[borderMode](src, ksizeHalf, dst, stream); } -}}}} // namespace cv { namespace gpu { namespace device { namespace optflow_farneback +}}}} // namespace cv { namespace gpu { namespace cuda { namespace optflow_farneback #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/orb.cu b/modules/gpu/src/cuda/orb.cu index 9c4e0ff8e..95a9899b5 100644 --- a/modules/gpu/src/cuda/orb.cu +++ b/modules/gpu/src/cuda/orb.cu @@ -45,11 +45,11 @@ #include #include -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/reduce.hpp" -#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/reduce.hpp" +#include "opencv2/core/cuda/functional.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace orb { diff --git a/modules/gpu/src/cuda/pyr_down.cu b/modules/gpu/src/cuda/pyr_down.cu index 42442506f..ce90818c2 100644 --- a/modules/gpu/src/cuda/pyr_down.cu +++ b/modules/gpu/src/cuda/pyr_down.cu @@ -42,13 +42,13 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/border_interpolate.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -222,7 +222,7 @@ namespace cv { namespace gpu { namespace device template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); } // namespace imgproc -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/pyr_up.cu b/modules/gpu/src/cuda/pyr_up.cu index 52ef35a9d..821871c9c 100644 --- a/modules/gpu/src/cuda/pyr_up.cu +++ b/modules/gpu/src/cuda/pyr_up.cu @@ -42,13 +42,13 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/border_interpolate.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/saturate_cast.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -191,6 +191,6 @@ namespace cv { namespace gpu { namespace device template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); } // namespace imgproc -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/pyrlk.cu b/modules/gpu/src/cuda/pyrlk.cu index fc387a723..32d8a128f 100644 --- a/modules/gpu/src/cuda/pyrlk.cu +++ b/modules/gpu/src/cuda/pyrlk.cu @@ -42,15 +42,15 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/utility.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/reduce.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/utility.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/reduce.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; namespace pyrlk { diff --git a/modules/gpu/src/cuda/remap.cu b/modules/gpu/src/cuda/remap.cu index 4589834b4..bc5692cfb 100644 --- a/modules/gpu/src/cuda/remap.cu +++ b/modules/gpu/src/cuda/remap.cu @@ -42,14 +42,14 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/border_interpolate.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/filters.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/filters.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -268,7 +268,7 @@ namespace cv { namespace gpu { namespace device template void remap_gpu(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20); template void remap_gpu(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20); } // namespace imgproc -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/resize.cu b/modules/gpu/src/cuda/resize.cu index 86f8d5501..9976d5e7e 100644 --- a/modules/gpu/src/cuda/resize.cu +++ b/modules/gpu/src/cuda/resize.cu @@ -43,15 +43,15 @@ #if !defined CUDA_DISABLER #include -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/border_interpolate.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/filters.hpp" -#include "opencv2/core/device/scan.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/filters.hpp" +#include "opencv2/core/cuda/scan.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -296,7 +296,7 @@ namespace cv { namespace gpu { namespace device }; } // namespace imgproc -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/rgb_to_yv12.cu b/modules/gpu/src/cuda/rgb_to_yv12.cu index 56800fc44..f8f5b955b 100644 --- a/modules/gpu/src/cuda/rgb_to_yv12.cu +++ b/modules/gpu/src/cuda/rgb_to_yv12.cu @@ -42,10 +42,10 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/vec_traits.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace video_encoding { diff --git a/modules/gpu/src/cuda/row_filter.h b/modules/gpu/src/cuda/row_filter.h index beaee3755..254d8d994 100644 --- a/modules/gpu/src/cuda/row_filter.h +++ b/modules/gpu/src/cuda/row_filter.h @@ -40,13 +40,13 @@ // //M*/ -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/border_interpolate.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; namespace row_filter { diff --git a/modules/gpu/src/cuda/split_merge.cu b/modules/gpu/src/cuda/split_merge.cu index d92ecbc17..47b6e3411 100644 --- a/modules/gpu/src/cuda/split_merge.cu +++ b/modules/gpu/src/cuda/split_merge.cu @@ -42,9 +42,9 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" +#include "opencv2/core/cuda/common.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace split_merge { @@ -505,7 +505,7 @@ namespace cv { namespace gpu { namespace device split_func(src, dst, stream); } } // namespace split_merge -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/stereobm.cu b/modules/gpu/src/cuda/stereobm.cu index 10a63ecf4..5a4cc17f5 100644 --- a/modules/gpu/src/cuda/stereobm.cu +++ b/modules/gpu/src/cuda/stereobm.cu @@ -42,9 +42,9 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" +#include "opencv2/core/cuda/common.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace stereobm { @@ -534,7 +534,7 @@ namespace cv { namespace gpu { namespace device cudaSafeCall( cudaUnbindTexture (texForTF) ); } } // namespace stereobm -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/stereobp.cu b/modules/gpu/src/cuda/stereobp.cu index 2aa70bf92..3fe946c28 100644 --- a/modules/gpu/src/cuda/stereobp.cu +++ b/modules/gpu/src/cuda/stereobp.cu @@ -42,11 +42,11 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/limits.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace stereobp { @@ -384,7 +384,7 @@ namespace cv { namespace gpu { namespace device template __device__ void message(const T* msg1, const T* msg2, const T* msg3, const T* data, T* dst, size_t msg_disp_step, size_t data_disp_step) { - float minimum = device::numeric_limits::max(); + float minimum = cuda::numeric_limits::max(); for(int i = 0; i < cndisp; ++i) { @@ -533,6 +533,6 @@ namespace cv { namespace gpu { namespace device template void output_gpu(const PtrStepSzb& u, const PtrStepSzb& d, const PtrStepSzb& l, const PtrStepSzb& r, const PtrStepSzb& data, const PtrStepSz& disp, cudaStream_t stream); template void output_gpu(const PtrStepSzb& u, const PtrStepSzb& d, const PtrStepSzb& l, const PtrStepSzb& r, const PtrStepSzb& data, const PtrStepSz& disp, cudaStream_t stream); } // namespace stereobp -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/stereocsbp.cu b/modules/gpu/src/cuda/stereocsbp.cu index 717398ea0..2af840279 100644 --- a/modules/gpu/src/cuda/stereocsbp.cu +++ b/modules/gpu/src/cuda/stereocsbp.cu @@ -42,13 +42,13 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/reduce.hpp" -#include "opencv2/core/device/functional.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/reduce.hpp" +#include "opencv2/core/cuda/functional.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace stereocsbp { @@ -146,7 +146,7 @@ namespace cv { namespace gpu { namespace device for(int i = 0; i < nr_plane; i++) { - T minimum = device::numeric_limits::max(); + T minimum = cuda::numeric_limits::max(); int id = 0; for(int d = 0; d < cndisp; d++) { @@ -859,6 +859,6 @@ namespace cv { namespace gpu { namespace device template void compute_disp(const float* u, const float* d, const float* l, const float* r, const float* data_cost_selected, const float* disp_selected, size_t msg_step, const PtrStepSz& disp, int nr_plane, cudaStream_t stream); } // namespace stereocsbp -}}} // namespace cv { namespace gpu { namespace device { +}}} // namespace cv { namespace gpu { namespace cuda { #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cuda/texture_binder.hpp b/modules/gpu/src/cuda/texture_binder.hpp index 801a6d270..e9677460f 100644 --- a/modules/gpu/src/cuda/texture_binder.hpp +++ b/modules/gpu/src/cuda/texture_binder.hpp @@ -83,7 +83,7 @@ namespace cv }; } - namespace device + namespace cuda { using cv::gpu::TextureBinder; } diff --git a/modules/gpu/src/cuda/tvl1flow.cu b/modules/gpu/src/cuda/tvl1flow.cu index 29470fb92..8502b7b71 100644 --- a/modules/gpu/src/cuda/tvl1flow.cu +++ b/modules/gpu/src/cuda/tvl1flow.cu @@ -42,12 +42,12 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/border_interpolate.hpp" -#include "opencv2/core/device/limits.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" +#include "opencv2/core/cuda/limits.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; //////////////////////////////////////////////////////////// // centeredGradient diff --git a/modules/gpu/src/cuda/warp.cu b/modules/gpu/src/cuda/warp.cu index 4a006448c..10735197b 100644 --- a/modules/gpu/src/cuda/warp.cu +++ b/modules/gpu/src/cuda/warp.cu @@ -42,14 +42,14 @@ #if !defined CUDA_DISABLER -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/border_interpolate.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/filters.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/border_interpolate.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/filters.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -383,7 +383,7 @@ namespace cv { namespace gpu { namespace device template void warpPerspective_gpu(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, float coeffs[3 * 3], PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20); template void warpPerspective_gpu(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, float coeffs[3 * 3], PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20); } // namespace imgproc -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/cvt_color_internal.h b/modules/gpu/src/cvt_color_internal.h index 1b7c68f35..7e3bab11d 100644 --- a/modules/gpu/src/cvt_color_internal.h +++ b/modules/gpu/src/cvt_color_internal.h @@ -43,7 +43,7 @@ #ifndef __cvt_color_internal_h__ #define __cvt_color_internal_h__ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { #define OPENCV_GPU_DECLARE_CVTCOLOR_ONE(name) \ void name(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); diff --git a/modules/gpu/src/denoising.cpp b/modules/gpu/src/denoising.cpp index 995b809d3..d3bcae2ee 100644 --- a/modules/gpu/src/denoising.cpp +++ b/modules/gpu/src/denoising.cpp @@ -59,7 +59,7 @@ void cv::gpu::FastNonLocalMeansDenoising::labMethod( const GpuMat&, GpuMat&, flo ////////////////////////////////////////////////////////////////////////////////// //// Non Local Means Denosing (brute force) -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -73,7 +73,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::bilateralFilter(const GpuMat& src, GpuMat& dst, int kernel_size, float sigma_color, float sigma_spatial, int borderMode, Stream& s) { - using cv::gpu::device::imgproc::bilateral_filter_gpu; + using cv::gpu::cuda::imgproc::bilateral_filter_gpu; typedef void (*func_t)(const PtrStepSzb& src, PtrStepSzb dst, int kernel_size, float sigma_spatial, float sigma_color, int borderMode, cudaStream_t s); @@ -109,7 +109,7 @@ void cv::gpu::bilateralFilter(const GpuMat& src, GpuMat& dst, int kernel_size, f void cv::gpu::nonLocalMeans(const GpuMat& src, GpuMat& dst, float h, int search_window, int block_window, int borderMode, Stream& s) { - using cv::gpu::device::imgproc::nlm_bruteforce_gpu; + using cv::gpu::cuda::imgproc::nlm_bruteforce_gpu; typedef void (*func_t)(const PtrStepSzb& src, PtrStepSzb dst, int search_radius, int block_radius, float h, int borderMode, cudaStream_t stream); static const func_t funcs[4] = { nlm_bruteforce_gpu, nlm_bruteforce_gpu, nlm_bruteforce_gpu, 0/*nlm_bruteforce_gpu,*/ }; @@ -134,7 +134,7 @@ void cv::gpu::nonLocalMeans(const GpuMat& src, GpuMat& dst, float h, int search_ //// Non Local Means Denosing (fast approxinate) -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -163,10 +163,10 @@ void cv::gpu::FastNonLocalMeansDenoising::simpleMethod(const GpuMat& src, GpuMat GpuMat src_hdr = extended_src(Rect(Point2i(border_size, border_size), src.size())); int bcols, brows; - device::imgproc::nln_fast_get_buffer_size(src_hdr, search_window, block_window, bcols, brows); + cuda::imgproc::nln_fast_get_buffer_size(src_hdr, search_window, block_window, bcols, brows); buffer.create(brows, bcols, CV_32S); - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; typedef void (*nlm_fast_t)(const PtrStepSzb&, PtrStepSzb, PtrStepi, int, int, float, cudaStream_t); static const nlm_fast_t funcs[] = { nlm_fast_gpu, nlm_fast_gpu, nlm_fast_gpu, 0}; @@ -183,12 +183,12 @@ void cv::gpu::FastNonLocalMeansDenoising::labMethod( const GpuMat& src, GpuMat& l.create(src.size(), CV_8U); ab.create(src.size(), CV_8UC2); - device::imgproc::fnlm_split_channels(lab, l, ab, StreamAccessor::getStream(s)); + cuda::imgproc::fnlm_split_channels(lab, l, ab, StreamAccessor::getStream(s)); simpleMethod(l, l, h_luminance, search_window, block_window, s); simpleMethod(ab, ab, h_color, search_window, block_window, s); - device::imgproc::fnlm_merge_channels(l, ab, lab, StreamAccessor::getStream(s)); + cuda::imgproc::fnlm_merge_channels(l, ab, lab, StreamAccessor::getStream(s)); cv::gpu::cvtColor(lab, dst, CV_Lab2BGR, 0, s); } diff --git a/modules/gpu/src/fast.cpp b/modules/gpu/src/fast.cpp index 01ddb75ea..13a719b16 100644 --- a/modules/gpu/src/fast.cpp +++ b/modules/gpu/src/fast.cpp @@ -108,7 +108,7 @@ void cv::gpu::FAST_GPU::operator ()(const GpuMat& img, const GpuMat& mask, GpuMa keypoints.cols = getKeyPoints(keypoints); } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace fast { @@ -119,7 +119,7 @@ namespace cv { namespace gpu { namespace device int cv::gpu::FAST_GPU::calcKeyPointsLocation(const GpuMat& img, const GpuMat& mask) { - using namespace cv::gpu::device::fast; + using namespace cv::gpu::cuda::fast; CV_Assert(img.type() == CV_8UC1); CV_Assert(mask.empty() || (mask.type() == CV_8UC1 && mask.size() == img.size())); @@ -142,7 +142,7 @@ int cv::gpu::FAST_GPU::calcKeyPointsLocation(const GpuMat& img, const GpuMat& ma int cv::gpu::FAST_GPU::getKeyPoints(GpuMat& keypoints) { - using namespace cv::gpu::device::fast; + using namespace cv::gpu::cuda::fast; if (count_ == 0) return 0; diff --git a/modules/gpu/src/filtering.cpp b/modules/gpu/src/filtering.cpp index 8905eaed6..989f7359a 100644 --- a/modules/gpu/src/filtering.cpp +++ b/modules/gpu/src/filtering.cpp @@ -661,7 +661,7 @@ void cv::gpu::morphologyEx(const GpuMat& src, GpuMat& dst, int op, const Mat& ke //////////////////////////////////////////////////////////////////////////////////////////////////// // Linear Filter -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -723,7 +723,7 @@ namespace virtual void operator()(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null()) { - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; Point ofs; Size wholeSize; @@ -742,7 +742,7 @@ namespace Ptr cv::gpu::getLinearFilter_GPU(int srcType, int dstType, const Mat& kernel, Point anchor, int brd_type) { - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; int sdepth = CV_MAT_DEPTH(srcType); int scn = CV_MAT_CN(srcType); diff --git a/modules/gpu/src/gftt.cpp b/modules/gpu/src/gftt.cpp index 76aee561b..9ed4f770b 100644 --- a/modules/gpu/src/gftt.cpp +++ b/modules/gpu/src/gftt.cpp @@ -51,7 +51,7 @@ void cv::gpu::GoodFeaturesToTrackDetector_GPU::operator ()(const GpuMat&, GpuMat #else /* !defined (HAVE_CUDA) */ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace gfft { @@ -62,7 +62,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::GoodFeaturesToTrackDetector_GPU::operator ()(const GpuMat& image, GpuMat& corners, const GpuMat& mask) { - using namespace cv::gpu::device::gfft; + using namespace cv::gpu::cuda::gfft; CV_Assert(qualityLevel > 0 && minDistance >= 0 && maxCorners >= 0); CV_Assert(mask.empty() || (mask.type() == CV_8UC1 && mask.size() == image.size())); diff --git a/modules/gpu/src/global_motion.cpp b/modules/gpu/src/global_motion.cpp index f7da2e884..010bbd9a5 100644 --- a/modules/gpu/src/global_motion.cpp +++ b/modules/gpu/src/global_motion.cpp @@ -53,7 +53,7 @@ void cv::gpu::calcWobbleSuppressionMaps( #else -namespace cv { namespace gpu { namespace device { namespace globmotion { +namespace cv { namespace gpu { namespace cuda { namespace globmotion { int compactPoints(int N, float *points0, float *points1, const uchar *mask); @@ -70,7 +70,7 @@ void cv::gpu::compactPoints(GpuMat &points0, GpuMat &points1, const GpuMat &mask CV_Assert(points0.cols == mask.cols && points1.cols == mask.cols); int npoints = points0.cols; - int remaining = cv::gpu::device::globmotion::compactPoints( + int remaining = cv::gpu::cuda::globmotion::compactPoints( npoints, (float*)points0.data, (float*)points1.data, mask.data); points0 = points0.colRange(0, remaining); @@ -88,7 +88,7 @@ void cv::gpu::calcWobbleSuppressionMaps( mapx.create(size, CV_32F); mapy.create(size, CV_32F); - cv::gpu::device::globmotion::calcWobbleSuppressionMaps( + cv::gpu::cuda::globmotion::calcWobbleSuppressionMaps( left, idx, right, size.width, size.height, ml.ptr(), mr.ptr(), mapx, mapy); } diff --git a/modules/gpu/src/graphcuts.cpp b/modules/gpu/src/graphcuts.cpp index b8c0d4ff9..0513845aa 100644 --- a/modules/gpu/src/graphcuts.cpp +++ b/modules/gpu/src/graphcuts.cpp @@ -52,7 +52,7 @@ void cv::gpu::labelComponents(const GpuMat&, GpuMat&, int, Stream&) { throw_nogp #else /* !defined (HAVE_CUDA) */ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace ccl { @@ -81,12 +81,12 @@ void cv::gpu::connectivityMask(const GpuMat& image, GpuMat& mask, const cv::Scal static const func_t suppotLookup[8][4] = { // 1, 2, 3, 4 - { device::ccl::computeEdges, 0, device::ccl::computeEdges, device::ccl::computeEdges },// CV_8U + { cuda::ccl::computeEdges, 0, cuda::ccl::computeEdges, cuda::ccl::computeEdges },// CV_8U { 0, 0, 0, 0 },// CV_16U - { device::ccl::computeEdges, 0, device::ccl::computeEdges, device::ccl::computeEdges },// CV_8S + { cuda::ccl::computeEdges, 0, cuda::ccl::computeEdges, cuda::ccl::computeEdges },// CV_8S { 0, 0, 0, 0 },// CV_16S - { device::ccl::computeEdges, 0, 0, 0 },// CV_32S - { device::ccl::computeEdges, 0, 0, 0 },// CV_32F + { cuda::ccl::computeEdges, 0, 0, 0 },// CV_32S + { cuda::ccl::computeEdges, 0, 0, 0 },// CV_32F { 0, 0, 0, 0 },// CV_64F { 0, 0, 0, 0 } // CV_USRTYPE1 }; @@ -112,7 +112,7 @@ void cv::gpu::labelComponents(const GpuMat& mask, GpuMat& components, int flags, components.create(mask.size(), CV_32SC1); cudaStream_t stream = StreamAccessor::getStream(s); - device::ccl::labelComponents(mask, components, flags, stream); + cuda::ccl::labelComponents(mask, components, flags, stream); } namespace diff --git a/modules/gpu/src/hog.cpp b/modules/gpu/src/hog.cpp index 03ca0a5cd..b14c69b74 100644 --- a/modules/gpu/src/hog.cpp +++ b/modules/gpu/src/hog.cpp @@ -62,7 +62,7 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat&, std::vec #else -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace hog { @@ -102,7 +102,7 @@ namespace cv { namespace gpu { namespace device } }}} -using namespace ::cv::gpu::device; +using namespace ::cv::gpu::cuda; cv::gpu::HOGDescriptor::HOGDescriptor(Size win_size_, Size block_size_, Size block_stride_, Size cell_size_, int nbins_, double win_sigma_, double threshold_L2hys_, bool gamma_correction_, int nlevels_) diff --git a/modules/gpu/src/hough.cpp b/modules/gpu/src/hough.cpp index 610384e71..4a66b3282 100644 --- a/modules/gpu/src/hough.cpp +++ b/modules/gpu/src/hough.cpp @@ -70,7 +70,7 @@ void cv::gpu::GeneralizedHough_GPU::release() {} #include "opencv2/core/utility.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace hough { @@ -81,7 +81,7 @@ namespace cv { namespace gpu { namespace device ////////////////////////////////////////////////////////// // HoughLines -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace hough { @@ -98,7 +98,7 @@ void cv::gpu::HoughLines(const GpuMat& src, GpuMat& lines, float rho, float thet void cv::gpu::HoughLines(const GpuMat& src, GpuMat& lines, HoughLinesBuf& buf, float rho, float theta, int threshold, bool doSort, int maxLines) { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; CV_Assert(src.type() == CV_8UC1); CV_Assert(src.cols < std::numeric_limits::max()); @@ -161,7 +161,7 @@ void cv::gpu::HoughLinesDownload(const GpuMat& d_lines, OutputArray h_lines_, Ou ////////////////////////////////////////////////////////// // HoughLinesP -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace hough { @@ -171,7 +171,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::HoughLinesP(const GpuMat& src, GpuMat& lines, HoughLinesBuf& buf, float rho, float theta, int minLineLength, int maxLineGap, int maxLines) { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; CV_Assert( src.type() == CV_8UC1 ); CV_Assert( src.cols < std::numeric_limits::max() ); @@ -210,7 +210,7 @@ void cv::gpu::HoughLinesP(const GpuMat& src, GpuMat& lines, HoughLinesBuf& buf, ////////////////////////////////////////////////////////// // HoughCircles -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace hough { @@ -230,7 +230,7 @@ void cv::gpu::HoughCircles(const GpuMat& src, GpuMat& circles, int method, float void cv::gpu::HoughCircles(const GpuMat& src, GpuMat& circles, HoughCirclesBuf& buf, int method, float dp, float minDist, int cannyThreshold, int votesThreshold, int minRadius, int maxRadius, int maxCircles) { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; CV_Assert(src.type() == CV_8UC1); CV_Assert(src.cols < std::numeric_limits::max()); @@ -371,7 +371,7 @@ void cv::gpu::HoughCirclesDownload(const GpuMat& d_circles, cv::OutputArray h_ci ////////////////////////////////////////////////////////// // GeneralizedHough -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace hough { @@ -559,7 +559,7 @@ namespace void GHT_Pos::buildEdgePointList(const GpuMat& edges, const GpuMat& dx, const GpuMat& dy) { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; typedef int (*func_t)(PtrStepSzb edges, PtrStepSzb dx, PtrStepSzb dy, unsigned int* coordList, float* thetaList); static const func_t funcs[] = @@ -747,7 +747,7 @@ namespace void GHT_Ballard_Pos::processTempl() { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; CV_Assert(levels > 0); @@ -773,7 +773,7 @@ namespace void GHT_Ballard_Pos::calcHist() { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; CV_Assert(levels > 0 && r_table.rows == (levels + 1) && r_sizes.cols == (levels + 1)); CV_Assert(dp > 0.0); @@ -796,7 +796,7 @@ namespace void GHT_Ballard_Pos::findPosInHist() { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; CV_Assert(votesThreshold > 0); @@ -851,7 +851,7 @@ namespace void GHT_Ballard_PosScale::calcHist() { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; CV_Assert(levels > 0 && r_table.rows == (levels + 1) && r_sizes.cols == (levels + 1)); CV_Assert(dp > 0.0); @@ -879,7 +879,7 @@ namespace void GHT_Ballard_PosScale::findPosInHist() { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; CV_Assert(votesThreshold > 0); @@ -939,7 +939,7 @@ namespace void GHT_Ballard_PosRotation::calcHist() { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; CV_Assert(levels > 0 && r_table.rows == (levels + 1) && r_sizes.cols == (levels + 1)); CV_Assert(dp > 0.0); @@ -967,7 +967,7 @@ namespace void GHT_Ballard_PosRotation::findPosInHist() { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; CV_Assert(votesThreshold > 0); @@ -1146,7 +1146,7 @@ namespace void GHT_Guil_Full::processTempl() { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; buildFeatureList(templEdges, templDx, templDy, templFeatures, GHT_Guil_Full_setTemplFeatures, GHT_Guil_Full_buildTemplFeatureList_gpu, @@ -1159,7 +1159,7 @@ namespace void GHT_Guil_Full::processImage() { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; CV_Assert(levels > 0); CV_Assert(templFeatures.sizes.cols == levels + 1); @@ -1271,7 +1271,7 @@ namespace void GHT_Guil_Full::calcOrientation() { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; const double iAngleStep = 1.0 / angleStep; const int angleRange = cvCeil((maxAngle - minAngle) * iAngleStep); @@ -1295,7 +1295,7 @@ namespace void GHT_Guil_Full::calcScale(double angle) { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; const double iScaleStep = 1.0 / scaleStep; const int scaleRange = cvCeil((maxScale - minScale) * iScaleStep); @@ -1319,7 +1319,7 @@ namespace void GHT_Guil_Full::calcPosition(double angle, int angleVotes, double scale, int scaleVotes) { - using namespace cv::gpu::device::hough; + using namespace cv::gpu::cuda::hough; hist.setTo(Scalar::all(0)); GHT_Guil_Full_calcPHist_gpu(templFeatures.sizes.ptr(), imageFeatures.sizes.ptr(0), diff --git a/modules/gpu/src/imgproc.cpp b/modules/gpu/src/imgproc.cpp index 916dde0c7..ee2887cfa 100644 --- a/modules/gpu/src/imgproc.cpp +++ b/modules/gpu/src/imgproc.cpp @@ -98,7 +98,7 @@ cv::Ptr cv::gpu::createCLAHE(double, cv::Size) { throw_nogpu(); //////////////////////////////////////////////////////////////////////// // meanShiftFiltering_GPU -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -108,7 +108,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::meanShiftFiltering(const GpuMat& src, GpuMat& dst, int sp, int sr, TermCriteria criteria, Stream& stream) { - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; if( src.empty() ) CV_Error( CV_StsBadArg, "The input image is empty" ); @@ -134,7 +134,7 @@ void cv::gpu::meanShiftFiltering(const GpuMat& src, GpuMat& dst, int sp, int sr, //////////////////////////////////////////////////////////////////////// // meanShiftProc_GPU -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -144,7 +144,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::meanShiftProc(const GpuMat& src, GpuMat& dstr, GpuMat& dstsp, int sp, int sr, TermCriteria criteria, Stream& stream) { - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; if( src.empty() ) CV_Error( CV_StsBadArg, "The input image is empty" ); @@ -171,7 +171,7 @@ void cv::gpu::meanShiftProc(const GpuMat& src, GpuMat& dstr, GpuMat& dstsp, int //////////////////////////////////////////////////////////////////////// // drawColorDisp -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -185,7 +185,7 @@ namespace template void drawColorDisp_caller(const GpuMat& src, GpuMat& dst, int ndisp, const cudaStream_t& stream) { - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; dst.create(src.size(), CV_8UC4); @@ -207,7 +207,7 @@ void cv::gpu::drawColorDisp(const GpuMat& src, GpuMat& dst, int ndisp, Stream& s //////////////////////////////////////////////////////////////////////// // reprojectImageTo3D -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -218,7 +218,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::reprojectImageTo3D(const GpuMat& disp, GpuMat& xyz, const Mat& Q, int dst_cn, Stream& stream) { - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; typedef void (*func_t)(const PtrStepSzb disp, PtrStepSzb xyz, const float* q, cudaStream_t stream); static const func_t funcs[2][4] = @@ -239,7 +239,7 @@ void cv::gpu::reprojectImageTo3D(const GpuMat& disp, GpuMat& xyz, const Mat& Q, //////////////////////////////////////////////////////////////////////// // copyMakeBorder -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -251,7 +251,7 @@ namespace { template void copyMakeBorder_caller(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderType, const Scalar& value, cudaStream_t stream) { - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; Scalar_ val(saturate_cast(value[0]), saturate_cast(value[1]), saturate_cast(value[2]), saturate_cast(value[3])); @@ -348,7 +348,7 @@ void cv::gpu::copyMakeBorder(const GpuMat& src, GpuMat& dst, int top, int bottom ////////////////////////////////////////////////////////////////////////////// // buildWarpPlaneMaps -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -362,7 +362,7 @@ void cv::gpu::buildWarpPlaneMaps(Size src_size, Rect dst_roi, const Mat &K, cons float scale, GpuMat& map_x, GpuMat& map_y, Stream& stream) { (void)src_size; - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; CV_Assert(K.size() == Size(3,3) && K.type() == CV_32F); CV_Assert(R.size() == Size(3,3) && R.type() == CV_32F); @@ -375,14 +375,14 @@ void cv::gpu::buildWarpPlaneMaps(Size src_size, Rect dst_roi, const Mat &K, cons map_x.create(dst_roi.size(), CV_32F); map_y.create(dst_roi.size(), CV_32F); - device::imgproc::buildWarpPlaneMaps(dst_roi.tl().x, dst_roi.tl().y, map_x, map_y, K_Rinv.ptr(), R_Kinv.ptr(), + cuda::imgproc::buildWarpPlaneMaps(dst_roi.tl().x, dst_roi.tl().y, map_x, map_y, K_Rinv.ptr(), R_Kinv.ptr(), T.ptr(), scale, StreamAccessor::getStream(stream)); } ////////////////////////////////////////////////////////////////////////////// // buildWarpCylyndricalMaps -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -396,7 +396,7 @@ void cv::gpu::buildWarpCylindricalMaps(Size src_size, Rect dst_roi, const Mat &K GpuMat& map_x, GpuMat& map_y, Stream& stream) { (void)src_size; - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; CV_Assert(K.size() == Size(3,3) && K.type() == CV_32F); CV_Assert(R.size() == Size(3,3) && R.type() == CV_32F); @@ -408,14 +408,14 @@ void cv::gpu::buildWarpCylindricalMaps(Size src_size, Rect dst_roi, const Mat &K map_x.create(dst_roi.size(), CV_32F); map_y.create(dst_roi.size(), CV_32F); - device::imgproc::buildWarpCylindricalMaps(dst_roi.tl().x, dst_roi.tl().y, map_x, map_y, K_Rinv.ptr(), R_Kinv.ptr(), scale, StreamAccessor::getStream(stream)); + cuda::imgproc::buildWarpCylindricalMaps(dst_roi.tl().x, dst_roi.tl().y, map_x, map_y, K_Rinv.ptr(), R_Kinv.ptr(), scale, StreamAccessor::getStream(stream)); } ////////////////////////////////////////////////////////////////////////////// // buildWarpSphericalMaps -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -429,7 +429,7 @@ void cv::gpu::buildWarpSphericalMaps(Size src_size, Rect dst_roi, const Mat &K, GpuMat& map_x, GpuMat& map_y, Stream& stream) { (void)src_size; - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; CV_Assert(K.size() == Size(3,3) && K.type() == CV_32F); CV_Assert(R.size() == Size(3,3) && R.type() == CV_32F); @@ -441,7 +441,7 @@ void cv::gpu::buildWarpSphericalMaps(Size src_size, Rect dst_roi, const Mat &K, map_x.create(dst_roi.size(), CV_32F); map_y.create(dst_roi.size(), CV_32F); - device::imgproc::buildWarpSphericalMaps(dst_roi.tl().x, dst_roi.tl().y, map_x, map_y, K_Rinv.ptr(), R_Kinv.ptr(), scale, StreamAccessor::getStream(stream)); + cuda::imgproc::buildWarpSphericalMaps(dst_roi.tl().x, dst_roi.tl().y, map_x, map_y, K_Rinv.ptr(), R_Kinv.ptr(), scale, StreamAccessor::getStream(stream)); } //////////////////////////////////////////////////////////////////////// @@ -532,7 +532,7 @@ void cv::gpu::integral(const GpuMat& src, GpuMat& sum, Stream& s) integralBuffered(src, sum, buffer, s); } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -556,7 +556,7 @@ void cv::gpu::integralBuffered(const GpuMat& src, GpuMat& sum, GpuMat& buffer, S { ensureSizeIsEnough(((src.rows + 7) / 8) * 8, ((src.cols + 63) / 64) * 64, CV_32SC1, buffer); - cv::gpu::device::imgproc::shfl_integral_gpu(src, buffer, stream); + cv::gpu::cuda::imgproc::shfl_integral_gpu(src, buffer, stream); sum.create(src.rows + 1, src.cols + 1, CV_32SC1); if (s) @@ -631,7 +631,7 @@ void cv::gpu::sqrIntegral(const GpuMat& src, GpuMat& sqsum, Stream& s) ////////////////////////////////////////////////////////////////////////////// // columnSum -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -641,13 +641,13 @@ namespace cv { namespace gpu { namespace device void cv::gpu::columnSum(const GpuMat& src, GpuMat& dst) { - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; CV_Assert(src.type() == CV_32F); dst.create(src.size(), CV_32F); - device::imgproc::columnSum_32F(src, dst); + cuda::imgproc::columnSum_32F(src, dst); } void cv::gpu::rectStdDev(const GpuMat& src, const GpuMat& sqr, GpuMat& dst, const Rect& rect, Stream& s) @@ -1021,7 +1021,7 @@ void cv::gpu::equalizeHist(const GpuMat& src, GpuMat& dst, GpuMat& hist, GpuMat& //////////////////////////////////////////////////////////////////////// // cornerHarris & minEgenVal -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -1074,7 +1074,7 @@ void cv::gpu::cornerHarris(const GpuMat& src, GpuMat& dst, GpuMat& Dx, GpuMat& D void cv::gpu::cornerHarris(const GpuMat& src, GpuMat& dst, GpuMat& Dx, GpuMat& Dy, GpuMat& buf, int blockSize, int ksize, double k, int borderType, Stream& stream) { - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; CV_Assert(borderType == cv::BORDER_REFLECT101 || borderType == cv::BORDER_REPLICATE || borderType == cv::BORDER_REFLECT); @@ -1102,7 +1102,7 @@ void cv::gpu::cornerMinEigenVal(const GpuMat& src, GpuMat& dst, GpuMat& Dx, GpuM void cv::gpu::cornerMinEigenVal(const GpuMat& src, GpuMat& dst, GpuMat& Dx, GpuMat& Dy, GpuMat& buf, int blockSize, int ksize, int borderType, Stream& stream) { - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; CV_Assert(borderType == cv::BORDER_REFLECT101 || borderType == cv::BORDER_REPLICATE || borderType == cv::BORDER_REFLECT); @@ -1119,7 +1119,7 @@ void cv::gpu::cornerMinEigenVal(const GpuMat& src, GpuMat& dst, GpuMat& Dx, GpuM ////////////////////////////////////////////////////////////////////////////// // mulSpectrums -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -1132,11 +1132,11 @@ namespace cv { namespace gpu { namespace device void cv::gpu::mulSpectrums(const GpuMat& a, const GpuMat& b, GpuMat& c, int flags, bool conjB, Stream& stream) { (void)flags; - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; typedef void (*Caller)(const PtrStep, const PtrStep, PtrStepSz, cudaStream_t stream); - static Caller callers[] = { device::imgproc::mulSpectrums, device::imgproc::mulSpectrums_CONJ }; + static Caller callers[] = { cuda::imgproc::mulSpectrums, cuda::imgproc::mulSpectrums_CONJ }; CV_Assert(a.type() == b.type() && a.type() == CV_32FC2); CV_Assert(a.size() == b.size()); @@ -1150,7 +1150,7 @@ void cv::gpu::mulSpectrums(const GpuMat& a, const GpuMat& b, GpuMat& c, int flag ////////////////////////////////////////////////////////////////////////////// // mulAndScaleSpectrums -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -1163,10 +1163,10 @@ namespace cv { namespace gpu { namespace device void cv::gpu::mulAndScaleSpectrums(const GpuMat& a, const GpuMat& b, GpuMat& c, int flags, float scale, bool conjB, Stream& stream) { (void)flags; - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; typedef void (*Caller)(const PtrStep, const PtrStep, float scale, PtrStepSz, cudaStream_t stream); - static Caller callers[] = { device::imgproc::mulAndScaleSpectrums, device::imgproc::mulAndScaleSpectrums_CONJ }; + static Caller callers[] = { cuda::imgproc::mulAndScaleSpectrums, cuda::imgproc::mulAndScaleSpectrums_CONJ }; CV_Assert(a.type() == b.type() && a.type() == CV_32FC2); CV_Assert(a.size() == b.size()); @@ -1335,7 +1335,7 @@ void cv::gpu::convolve(const GpuMat& image, const GpuMat& templ, GpuMat& result, void cv::gpu::convolve(const GpuMat& image, const GpuMat& templ, GpuMat& result, bool ccorr, ConvolveBuf& buf, Stream& stream) { - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; #ifndef HAVE_CUFFT throw_nogpu(); diff --git a/modules/gpu/src/match_template.cpp b/modules/gpu/src/match_template.cpp index 26dcd4b9e..7115b00b6 100644 --- a/modules/gpu/src/match_template.cpp +++ b/modules/gpu/src/match_template.cpp @@ -51,7 +51,7 @@ void cv::gpu::matchTemplate(const GpuMat&, const GpuMat&, GpuMat&, int, Stream&) #else -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace match_template { @@ -137,7 +137,7 @@ namespace cv { namespace gpu { namespace device } }}} -using namespace ::cv::gpu::device::match_template; +using namespace ::cv::gpu::cuda::match_template; namespace { diff --git a/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu b/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu index 881d12692..986bfd57c 100644 --- a/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu +++ b/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu @@ -65,7 +65,7 @@ #include "NPP_staging/NPP_staging.hpp" #include "NCVBroxOpticalFlow.hpp" -#include "opencv2/core/device/utility.hpp" +#include "opencv2/core/cuda/utility.hpp" typedef NCVVectorAlloc FloatVector; @@ -1141,8 +1141,8 @@ NCVStatus NCVBroxOpticalFlow(const NCVBroxOpticalFlowDescriptor desc, ScaleVector(ptrVNew->ptr(), ptrVNew->ptr(), 1.0f/scale_factor, ns * nh, stream); ncvAssertCUDALastErrorReturn((int)NCV_CUDA_ERROR); - cv::gpu::device::swap(ptrU, ptrUNew); - cv::gpu::device::swap(ptrV, ptrVNew); + cv::gpu::cuda::swap(ptrU, ptrUNew); + cv::gpu::cuda::swap(ptrV, ptrVNew); } scale /= scale_factor; } diff --git a/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu b/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu index 4ff632b07..fae2b88a8 100644 --- a/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu +++ b/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu @@ -66,8 +66,8 @@ #include "NPP_staging/NPP_staging.hpp" #include "NCVRuntimeTemplates.hpp" #include "NCVHaarObjectDetection.hpp" -#include "opencv2/core/device/warp.hpp" -#include "opencv2/core/device/warp_shuffle.hpp" +#include "opencv2/core/cuda/warp.hpp" +#include "opencv2/core/cuda/warp_shuffle.hpp" //============================================================================== @@ -85,13 +85,13 @@ NCV_CT_ASSERT(K_WARP_SIZE == 32); //this is required for the manual unroll of th __device__ Ncv32u warpScanInclusive(Ncv32u idata, volatile Ncv32u *s_Data) { #if __CUDA_ARCH__ >= 300 - const unsigned int laneId = cv::gpu::device::Warp::laneId(); + const unsigned int laneId = cv::gpu::cuda::Warp::laneId(); // scan on shuffl functions #pragma unroll for (int i = 1; i <= (K_WARP_SIZE / 2); i *= 2) { - const Ncv32u n = cv::gpu::device::shfl_up(idata, i); + const Ncv32u n = cv::gpu::cuda::shfl_up(idata, i); if (laneId >= i) idata += n; } diff --git a/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu b/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu index 8d898175e..2830dcaef 100644 --- a/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu +++ b/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu @@ -45,8 +45,8 @@ #include #include #include "NPP_staging.hpp" -#include "opencv2/core/device/warp.hpp" -#include "opencv2/core/device/warp_shuffle.hpp" +#include "opencv2/core/cuda/warp.hpp" +#include "opencv2/core/cuda/warp_shuffle.hpp" texture tex8u; @@ -95,13 +95,13 @@ template inline __device__ T warpScanInclusive(T idata, volatile T *s_Data) { #if __CUDA_ARCH__ >= 300 - const unsigned int laneId = cv::gpu::device::Warp::laneId(); + const unsigned int laneId = cv::gpu::cuda::Warp::laneId(); // scan on shuffl functions #pragma unroll for (int i = 1; i <= (K_WARP_SIZE / 2); i *= 2) { - const T n = cv::gpu::device::shfl_up(idata, i); + const T n = cv::gpu::cuda::shfl_up(idata, i); if (laneId >= i) idata += n; } diff --git a/modules/gpu/src/nvidia/core/NCVPyramid.cu b/modules/gpu/src/nvidia/core/NCVPyramid.cu index 89d1d4b36..6eef5de96 100644 --- a/modules/gpu/src/nvidia/core/NCVPyramid.cu +++ b/modules/gpu/src/nvidia/core/NCVPyramid.cu @@ -48,7 +48,7 @@ #include "NCVAlg.hpp" #include "NCVPyramid.hpp" #include "NCVPixelOperations.hpp" -#include "opencv2/core/device/common.hpp" +#include "opencv2/core/cuda/common.hpp" template struct __average4_CN {static __host__ __device__ T _average4_CN(const T &p00, const T &p01, const T &p10, const T &p11);}; @@ -204,7 +204,7 @@ __global__ void kernelDownsampleX2(T *d_src, } } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace pyramid { @@ -279,7 +279,7 @@ __global__ void kernelInterpolateFrom1(T *d_srcTop, d_dst_line[j] = outPix; } } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace pyramid { diff --git a/modules/gpu/src/optical_flow.cpp b/modules/gpu/src/optical_flow.cpp index a06bbac26..662c7ad07 100644 --- a/modules/gpu/src/optical_flow.cpp +++ b/modules/gpu/src/optical_flow.cpp @@ -188,7 +188,7 @@ void cv::gpu::interpolateFrames(const GpuMat& frame0, const GpuMat& frame1, cons cudaSafeCall( cudaDeviceSynchronize() ); } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace optical_flow { @@ -199,7 +199,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::createOpticalFlowNeedleMap(const GpuMat& u, const GpuMat& v, GpuMat& vertex, GpuMat& colors) { - using namespace cv::gpu::device::optical_flow; + using namespace cv::gpu::cuda::optical_flow; CV_Assert(u.type() == CV_32FC1); CV_Assert(v.type() == u.type() && v.size() == u.size()); diff --git a/modules/gpu/src/optical_flow_farneback.cpp b/modules/gpu/src/optical_flow_farneback.cpp index 349ca0c5e..1f7148643 100644 --- a/modules/gpu/src/optical_flow_farneback.cpp +++ b/modules/gpu/src/optical_flow_farneback.cpp @@ -59,7 +59,7 @@ void cv::gpu::FarnebackOpticalFlow::operator ()(const GpuMat&, const GpuMat&, Gp #else -namespace cv { namespace gpu { namespace device { namespace optflow_farneback +namespace cv { namespace gpu { namespace cuda { namespace optflow_farneback { void setPolynomialExpansionConsts( int polyN, const float *g, const float *xg, const float *xxg, @@ -93,7 +93,7 @@ namespace cv { namespace gpu { namespace device { namespace optflow_farneback void gaussianBlur5Gpu_CC11( const PtrStepSzf src, int ksizeHalf, PtrStepSzf dst, int borderType, cudaStream_t stream); -}}}} // namespace cv { namespace gpu { namespace device { namespace optflow_farneback +}}}} // namespace cv { namespace gpu { namespace cuda { namespace optflow_farneback void cv::gpu::FarnebackOpticalFlow::prepareGaussian( @@ -163,7 +163,7 @@ void cv::gpu::FarnebackOpticalFlow::setPolynomialExpansionConsts(int n, double s double ig11, ig03, ig33, ig55; prepareGaussian(n, sigma, g, xg, xxg, ig11, ig03, ig33, ig55); - device::optflow_farneback::setPolynomialExpansionConsts(n, g, xg, xxg, static_cast(ig11), static_cast(ig03), static_cast(ig33), static_cast(ig55)); + cuda::optflow_farneback::setPolynomialExpansionConsts(n, g, xg, xxg, static_cast(ig11), static_cast(ig03), static_cast(ig33), static_cast(ig55)); } @@ -172,17 +172,17 @@ void cv::gpu::FarnebackOpticalFlow::updateFlow_boxFilter( GpuMat& M, GpuMat &bufM, int blockSize, bool updateMatrices, Stream streams[]) { if (deviceSupports(FEATURE_SET_COMPUTE_12)) - device::optflow_farneback::boxFilter5Gpu(M, blockSize/2, bufM, S(streams[0])); + cuda::optflow_farneback::boxFilter5Gpu(M, blockSize/2, bufM, S(streams[0])); else - device::optflow_farneback::boxFilter5Gpu_CC11(M, blockSize/2, bufM, S(streams[0])); + cuda::optflow_farneback::boxFilter5Gpu_CC11(M, blockSize/2, bufM, S(streams[0])); swap(M, bufM); for (int i = 1; i < 5; ++i) streams[i].waitForCompletion(); - device::optflow_farneback::updateFlowGpu(M, flowx, flowy, S(streams[0])); + cuda::optflow_farneback::updateFlowGpu(M, flowx, flowy, S(streams[0])); if (updateMatrices) - device::optflow_farneback::updateMatricesGpu(flowx, flowy, R0, R1, M, S(streams[0])); + cuda::optflow_farneback::updateMatricesGpu(flowx, flowy, R0, R1, M, S(streams[0])); } @@ -191,17 +191,17 @@ void cv::gpu::FarnebackOpticalFlow::updateFlow_gaussianBlur( GpuMat& M, GpuMat &bufM, int blockSize, bool updateMatrices, Stream streams[]) { if (deviceSupports(FEATURE_SET_COMPUTE_12)) - device::optflow_farneback::gaussianBlur5Gpu( + cuda::optflow_farneback::gaussianBlur5Gpu( M, blockSize/2, bufM, BORDER_REPLICATE_GPU, S(streams[0])); else - device::optflow_farneback::gaussianBlur5Gpu_CC11( + cuda::optflow_farneback::gaussianBlur5Gpu_CC11( M, blockSize/2, bufM, BORDER_REPLICATE_GPU, S(streams[0])); swap(M, bufM); - device::optflow_farneback::updateFlowGpu(M, flowx, flowy, S(streams[0])); + cuda::optflow_farneback::updateFlowGpu(M, flowx, flowy, S(streams[0])); if (updateMatrices) - device::optflow_farneback::updateMatricesGpu(flowx, flowy, R0, R1, M, S(streams[0])); + cuda::optflow_farneback::updateMatricesGpu(flowx, flowy, R0, R1, M, S(streams[0])); } @@ -253,7 +253,7 @@ void cv::gpu::FarnebackOpticalFlow::operator ()( } setPolynomialExpansionConsts(polyN, polySigma); - device::optflow_farneback::setUpdateMatricesConsts(); + cuda::optflow_farneback::setUpdateMatricesConsts(); for (int k = numLevelsCropped; k >= 0; k--) { @@ -344,8 +344,8 @@ void cv::gpu::FarnebackOpticalFlow::operator ()( if (fastPyramids) { - device::optflow_farneback::polynomialExpansionGpu(pyramid0_[k], polyN, R[0], S(streams[0])); - device::optflow_farneback::polynomialExpansionGpu(pyramid1_[k], polyN, R[1], S(streams[1])); + cuda::optflow_farneback::polynomialExpansionGpu(pyramid0_[k], polyN, R[0], S(streams[0])); + cuda::optflow_farneback::polynomialExpansionGpu(pyramid1_[k], polyN, R[1], S(streams[1])); } else { @@ -361,11 +361,11 @@ void cv::gpu::FarnebackOpticalFlow::operator ()( }; Mat g = getGaussianKernel(smoothSize, sigma, CV_32F); - device::optflow_farneback::setGaussianBlurKernel(g.ptr(smoothSize/2), smoothSize/2); + cuda::optflow_farneback::setGaussianBlurKernel(g.ptr(smoothSize/2), smoothSize/2); for (int i = 0; i < 2; i++) { - device::optflow_farneback::gaussianBlurGpu( + cuda::optflow_farneback::gaussianBlurGpu( frames_[i], smoothSize/2, blurredFrame[i], BORDER_REFLECT101_GPU, S(streams[i])); #if ENABLE_GPU_RESIZE resize(blurredFrame[i], pyrLevel[i], Size(width, height), INTER_LINEAR, streams[i]); @@ -375,17 +375,17 @@ void cv::gpu::FarnebackOpticalFlow::operator ()( resize(tmp1, tmp2, Size(width, height), INTER_LINEAR); I[i].upload(tmp2); #endif - device::optflow_farneback::polynomialExpansionGpu(pyrLevel[i], polyN, R[i], S(streams[i])); + cuda::optflow_farneback::polynomialExpansionGpu(pyrLevel[i], polyN, R[i], S(streams[i])); } } streams[1].waitForCompletion(); - device::optflow_farneback::updateMatricesGpu(curFlowX, curFlowY, R[0], R[1], M, S(streams[0])); + cuda::optflow_farneback::updateMatricesGpu(curFlowX, curFlowY, R[0], R[1], M, S(streams[0])); if (flags & OPTFLOW_FARNEBACK_GAUSSIAN) { Mat g = getGaussianKernel(winSize, winSize/2*0.3f, CV_32F); - device::optflow_farneback::setGaussianBlurKernel(g.ptr(winSize/2), winSize/2); + cuda::optflow_farneback::setGaussianBlurKernel(g.ptr(winSize/2), winSize/2); } for (int i = 0; i < numIters; i++) { diff --git a/modules/gpu/src/orb.cpp b/modules/gpu/src/orb.cpp index f59e545c4..46d96a78b 100644 --- a/modules/gpu/src/orb.cpp +++ b/modules/gpu/src/orb.cpp @@ -62,7 +62,7 @@ void cv::gpu::ORB_GPU::mergeKeyPoints(GpuMat&) { throw_nogpu(); } #else /* !defined (HAVE_CUDA) */ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace orb { @@ -431,7 +431,7 @@ cv::gpu::ORB_GPU::ORB_GPU(int nFeatures, float scaleFactor, int nLevels, int edg ++v_0; } CV_Assert(u_max.size() < 32); - cv::gpu::device::orb::loadUMax(&u_max[0], static_cast(u_max.size())); + cv::gpu::cuda::orb::loadUMax(&u_max[0], static_cast(u_max.size())); // Calc pattern const int npoints = 512; @@ -543,7 +543,7 @@ namespace //takes keypoints and culls them by the response void cull(GpuMat& keypoints, int& count, int n_points) { - using namespace cv::gpu::device::orb; + using namespace cv::gpu::cuda::orb; //this is only necessary if the keypoints size is greater than the number of desired points. if (count > n_points) @@ -561,7 +561,7 @@ namespace void cv::gpu::ORB_GPU::computeKeyPointsPyramid() { - using namespace cv::gpu::device::orb; + using namespace cv::gpu::cuda::orb; int half_patch_size = patchSize_ / 2; @@ -604,7 +604,7 @@ void cv::gpu::ORB_GPU::computeKeyPointsPyramid() void cv::gpu::ORB_GPU::computeDescriptors(GpuMat& descriptors) { - using namespace cv::gpu::device::orb; + using namespace cv::gpu::cuda::orb; int nAllkeypoints = 0; @@ -644,7 +644,7 @@ void cv::gpu::ORB_GPU::computeDescriptors(GpuMat& descriptors) void cv::gpu::ORB_GPU::mergeKeyPoints(GpuMat& keypoints) { - using namespace cv::gpu::device::orb; + using namespace cv::gpu::cuda::orb; int nAllkeypoints = 0; diff --git a/modules/gpu/src/pyramids.cpp b/modules/gpu/src/pyramids.cpp index 85fb99040..2c8e80a81 100644 --- a/modules/gpu/src/pyramids.cpp +++ b/modules/gpu/src/pyramids.cpp @@ -54,7 +54,7 @@ void cv::gpu::ImagePyramid::getLayer(GpuMat&, Size, Stream&) const { throw_nogpu ////////////////////////////////////////////////////////////////////////////// // pyrDown -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -64,7 +64,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::pyrDown(const GpuMat& src, GpuMat& dst, Stream& stream) { - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; typedef void (*func_t)(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); @@ -92,7 +92,7 @@ void cv::gpu::pyrDown(const GpuMat& src, GpuMat& dst, Stream& stream) ////////////////////////////////////////////////////////////////////////////// // pyrUp -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -102,7 +102,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::pyrUp(const GpuMat& src, GpuMat& dst, Stream& stream) { - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; typedef void (*func_t)(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); @@ -130,7 +130,7 @@ void cv::gpu::pyrUp(const GpuMat& src, GpuMat& dst, Stream& stream) ////////////////////////////////////////////////////////////////////////////// // ImagePyramid -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace pyramid { @@ -141,7 +141,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::ImagePyramid::build(const GpuMat& img, int numLayers, Stream& stream) { - using namespace cv::gpu::device::pyramid; + using namespace cv::gpu::cuda::pyramid; typedef void (*func_t)(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); @@ -189,7 +189,7 @@ void cv::gpu::ImagePyramid::build(const GpuMat& img, int numLayers, Stream& stre void cv::gpu::ImagePyramid::getLayer(GpuMat& outImg, Size outRoi, Stream& stream) const { - using namespace cv::gpu::device::pyramid; + using namespace cv::gpu::cuda::pyramid; typedef void (*func_t)(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); diff --git a/modules/gpu/src/remap.cpp b/modules/gpu/src/remap.cpp index 4b8728633..80ec2211c 100644 --- a/modules/gpu/src/remap.cpp +++ b/modules/gpu/src/remap.cpp @@ -48,7 +48,7 @@ void cv::gpu::remap(const GpuMat&, GpuMat&, const GpuMat&, const GpuMat&, int, i #else // HAVE_CUDA -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -60,7 +60,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::remap(const GpuMat& src, GpuMat& dst, const GpuMat& xmap, const GpuMat& ymap, int interpolation, int borderMode, Scalar borderValue, Stream& stream) { - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; typedef void (*func_t)(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20); diff --git a/modules/gpu/src/resize.cpp b/modules/gpu/src/resize.cpp index 685013542..c913e45e0 100644 --- a/modules/gpu/src/resize.cpp +++ b/modules/gpu/src/resize.cpp @@ -59,7 +59,7 @@ void cv::gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx, doub #else // HAVE_CUDA -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -137,7 +137,7 @@ void cv::gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx, doub } else { - using namespace ::cv::gpu::device::imgproc; + using namespace ::cv::gpu::cuda::imgproc; typedef void (*func_t)(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, float fx, float fy, PtrStepSzb dst, int interpolation, cudaStream_t stream); diff --git a/modules/gpu/src/split_merge.cpp b/modules/gpu/src/split_merge.cpp index 61a928cc0..fea53ad76 100644 --- a/modules/gpu/src/split_merge.cpp +++ b/modules/gpu/src/split_merge.cpp @@ -54,7 +54,7 @@ void cv::gpu::split(const GpuMat& /*src*/, std::vector& /*dst*/, Stream& #else /* !defined (HAVE_CUDA) */ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace split_merge { @@ -67,7 +67,7 @@ namespace { void merge(const GpuMat* src, size_t n, GpuMat& dst, const cudaStream_t& stream) { - using namespace ::cv::gpu::device::split_merge; + using namespace ::cv::gpu::cuda::split_merge; CV_Assert(src); CV_Assert(n > 0); @@ -112,7 +112,7 @@ namespace void split(const GpuMat& src, GpuMat* dst, const cudaStream_t& stream) { - using namespace ::cv::gpu::device::split_merge; + using namespace ::cv::gpu::cuda::split_merge; CV_Assert(dst); diff --git a/modules/gpu/src/stereobm.cpp b/modules/gpu/src/stereobm.cpp index e633bf0ad..f3a95cb19 100644 --- a/modules/gpu/src/stereobm.cpp +++ b/modules/gpu/src/stereobm.cpp @@ -55,7 +55,7 @@ void cv::gpu::StereoBM_GPU::operator() ( const GpuMat&, const GpuMat&, GpuMat&, #else /* !defined (HAVE_CUDA) */ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace stereobm { @@ -101,7 +101,7 @@ namespace { void stereo_bm_gpu_operator( GpuMat& minSSD, GpuMat& leBuf, GpuMat& riBuf, int preset, int ndisp, int winSize, float avergeTexThreshold, const GpuMat& left, const GpuMat& right, GpuMat& disparity, cudaStream_t stream) { - using namespace ::cv::gpu::device::stereobm; + using namespace ::cv::gpu::cuda::stereobm; CV_Assert(left.rows == right.rows && left.cols == right.cols); CV_Assert(left.type() == CV_8UC1); diff --git a/modules/gpu/src/stereobp.cpp b/modules/gpu/src/stereobp.cpp index 2a472e283..bc4ca9038 100644 --- a/modules/gpu/src/stereobp.cpp +++ b/modules/gpu/src/stereobp.cpp @@ -58,7 +58,7 @@ void cv::gpu::StereoBeliefPropagation::operator()(const GpuMat&, GpuMat&, Stream #else /* !defined (HAVE_CUDA) */ -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace stereobp { @@ -78,7 +78,7 @@ namespace cv { namespace gpu { namespace device } }}} -using namespace ::cv::gpu::device::stereobp; +using namespace ::cv::gpu::cuda::stereobp; namespace { diff --git a/modules/gpu/src/stereocsbp.cpp b/modules/gpu/src/stereocsbp.cpp index f3e55be4d..5c8f39ac3 100644 --- a/modules/gpu/src/stereocsbp.cpp +++ b/modules/gpu/src/stereocsbp.cpp @@ -57,7 +57,7 @@ void cv::gpu::StereoConstantSpaceBP::operator()(const GpuMat&, const GpuMat&, Gp #else /* !defined (HAVE_CUDA) */ #include "opencv2/core/utility.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace stereocsbp { @@ -89,7 +89,7 @@ namespace cv { namespace gpu { namespace device } }}} -using namespace ::cv::gpu::device::stereocsbp; +using namespace ::cv::gpu::cuda::stereocsbp; namespace { diff --git a/modules/gpu/src/video_reader.cpp b/modules/gpu/src/video_reader.cpp index 118eb9569..36afd533f 100644 --- a/modules/gpu/src/video_reader.cpp +++ b/modules/gpu/src/video_reader.cpp @@ -128,7 +128,7 @@ cv::gpu::VideoReader_GPU::Impl::~Impl() videoSource_->stop(); } -namespace cv { namespace gpu { namespace device { +namespace cv { namespace gpu { namespace cuda { namespace video_decoding { void loadHueCSC(float hueCSC[9]); @@ -189,7 +189,7 @@ namespace void cudaPostProcessFrame(const cv::gpu::GpuMat& decodedFrame, cv::gpu::GpuMat& interopFrame, int width, int height) { - using namespace cv::gpu::device::video_decoding; + using namespace cv::gpu::cuda::video_decoding; static bool updateCSC = true; static float hueColorSpaceMat[9]; diff --git a/modules/gpu/src/video_writer.cpp b/modules/gpu/src/video_writer.cpp index b134f5154..8f4d78e7a 100644 --- a/modules/gpu/src/video_writer.cpp +++ b/modules/gpu/src/video_writer.cpp @@ -501,7 +501,7 @@ void cv::gpu::VideoWriter_GPU::Impl::createHWEncoder() CV_Assert( err == 0 ); } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace video_encoding { @@ -674,7 +674,7 @@ void cv::gpu::VideoWriter_GPU::Impl::write(const cv::gpu::GpuMat& frame, bool la CV_Assert( res == CUDA_SUCCESS ); if (inputFormat_ == SF_BGR) - cv::gpu::device::video_encoding::YV12_gpu(frame, frame.channels(), videoFrame_); + cv::gpu::cuda::video_encoding::YV12_gpu(frame, frame.channels(), videoFrame_); else { switch (surfaceFormat_) diff --git a/modules/gpu/src/warp.cpp b/modules/gpu/src/warp.cpp index 827d5219f..874c9d279 100644 --- a/modules/gpu/src/warp.cpp +++ b/modules/gpu/src/warp.cpp @@ -53,7 +53,7 @@ void cv::gpu::buildWarpPerspectiveMaps(const Mat&, bool, Size, GpuMat&, GpuMat&, #else // HAVE_CUDA -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace imgproc { @@ -73,7 +73,7 @@ namespace cv { namespace gpu { namespace device void cv::gpu::buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, GpuMat& xmap, GpuMat& ymap, Stream& stream) { - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; CV_Assert(M.rows == 2 && M.cols == 3); @@ -97,7 +97,7 @@ void cv::gpu::buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, GpuMat void cv::gpu::buildWarpPerspectiveMaps(const Mat& M, bool inverse, Size dsize, GpuMat& xmap, GpuMat& ymap, Stream& stream) { - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; CV_Assert(M.rows == 3 && M.cols == 3); @@ -272,7 +272,7 @@ void cv::gpu::warpAffine(const GpuMat& src, GpuMat& dst, const Mat& M, Size dsiz } else { - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; typedef void (*func_t)(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, float coeffs[2 * 3], PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20); @@ -410,7 +410,7 @@ void cv::gpu::warpPerspective(const GpuMat& src, GpuMat& dst, const Mat& M, Size } else { - using namespace cv::gpu::device::imgproc; + using namespace cv::gpu::cuda::imgproc; typedef void (*func_t)(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, float coeffs[2 * 3], PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20); diff --git a/modules/nonfree/src/cuda/surf.cu b/modules/nonfree/src/cuda/surf.cu index 39de3c368..c78e11e98 100644 --- a/modules/nonfree/src/cuda/surf.cu +++ b/modules/nonfree/src/cuda/surf.cu @@ -44,15 +44,15 @@ #ifdef HAVE_OPENCV_GPU -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/limits.hpp" -#include "opencv2/core/device/saturate_cast.hpp" -#include "opencv2/core/device/reduce.hpp" -#include "opencv2/core/device/utility.hpp" -#include "opencv2/core/device/functional.hpp" -#include "opencv2/core/device/filters.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/limits.hpp" +#include "opencv2/core/cuda/saturate_cast.hpp" +#include "opencv2/core/cuda/reduce.hpp" +#include "opencv2/core/cuda/utility.hpp" +#include "opencv2/core/cuda/functional.hpp" +#include "opencv2/core/cuda/filters.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace surf { @@ -79,7 +79,7 @@ namespace cv { namespace gpu { namespace device } }}} -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace surf { @@ -626,7 +626,7 @@ namespace cv { namespace gpu { namespace device } plus op; - device::reduce<32>(smem_tuple(s_sumx + threadIdx.y * 32, s_sumy + threadIdx.y * 32), + cuda::reduce<32>(smem_tuple(s_sumx + threadIdx.y * 32, s_sumy + threadIdx.y * 32), thrust::tie(sumx, sumy), threadIdx.x, thrust::make_tuple(op, op)); const float temp_mod = sumx * sumx + sumy * sumy; @@ -955,7 +955,7 @@ namespace cv { namespace gpu { namespace device } } } // namespace surf -}}} // namespace cv { namespace gpu { namespace device +}}} // namespace cv { namespace gpu { namespace cuda #endif /* CUDA_DISABLER */ diff --git a/modules/nonfree/src/cuda/vibe.cu b/modules/nonfree/src/cuda/vibe.cu index 52cbed79c..3e1299bd8 100644 --- a/modules/nonfree/src/cuda/vibe.cu +++ b/modules/nonfree/src/cuda/vibe.cu @@ -44,9 +44,9 @@ #ifdef HAVE_OPENCV_GPU -#include "opencv2/core/device/common.hpp" +#include "opencv2/core/cuda/common.hpp" -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace vibe { @@ -58,7 +58,7 @@ namespace cv { namespace gpu { namespace device } }}} -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace vibe { diff --git a/modules/nonfree/src/precomp.hpp b/modules/nonfree/src/precomp.hpp index 51d2aba41..0d5c288af 100644 --- a/modules/nonfree/src/precomp.hpp +++ b/modules/nonfree/src/precomp.hpp @@ -56,7 +56,7 @@ #if defined(HAVE_CUDA) #include "opencv2/core/stream_accessor.hpp" - #include "opencv2/core/device/common.hpp" + #include "opencv2/core/cuda/common.hpp" static inline void throw_nogpu() { CV_Error(CV_StsNotImplemented, "The called functionality is disabled for current build or platform"); } #else diff --git a/modules/nonfree/src/surf_gpu.cpp b/modules/nonfree/src/surf_gpu.cpp index a5f7389c3..0fe3dfff6 100644 --- a/modules/nonfree/src/surf_gpu.cpp +++ b/modules/nonfree/src/surf_gpu.cpp @@ -64,7 +64,7 @@ void cv::gpu::SURF_GPU::releaseMemory() { throw_nogpu(); } #else // !defined (HAVE_CUDA) -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace surf { @@ -91,7 +91,7 @@ namespace cv { namespace gpu { namespace device } }}} -using namespace ::cv::gpu::device::surf; +using namespace ::cv::gpu::cuda::surf; namespace { diff --git a/modules/nonfree/src/vibe_gpu.cpp b/modules/nonfree/src/vibe_gpu.cpp index e34862765..7d7450602 100644 --- a/modules/nonfree/src/vibe_gpu.cpp +++ b/modules/nonfree/src/vibe_gpu.cpp @@ -53,7 +53,7 @@ void cv::gpu::VIBE_GPU::release() {} #else -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { namespace vibe { @@ -84,7 +84,7 @@ cv::gpu::VIBE_GPU::VIBE_GPU(unsigned long rngSeed) : void cv::gpu::VIBE_GPU::initialize(const GpuMat& firstFrame, Stream& s) { - using namespace cv::gpu::device::vibe; + using namespace cv::gpu::cuda::vibe; CV_Assert(firstFrame.type() == CV_8UC1 || firstFrame.type() == CV_8UC3 || firstFrame.type() == CV_8UC4); @@ -112,7 +112,7 @@ void cv::gpu::VIBE_GPU::initialize(const GpuMat& firstFrame, Stream& s) void cv::gpu::VIBE_GPU::operator()(const GpuMat& frame, GpuMat& fgmask, Stream& s) { - using namespace cv::gpu::device::vibe; + using namespace cv::gpu::cuda::vibe; CV_Assert(frame.depth() == CV_8U); diff --git a/modules/softcascade/src/cuda/channels.cu b/modules/softcascade/src/cuda/channels.cu index 782e243b5..558cbd488 100644 --- a/modules/softcascade/src/cuda/channels.cu +++ b/modules/softcascade/src/cuda/channels.cu @@ -61,7 +61,7 @@ __host__ __device__ __forceinline__ int divUp(int total, int grain) return (total + grain - 1) / grain; } -namespace cv { namespace softcascade { namespace device +namespace cv { namespace softcascade { namespace cuda { typedef unsigned int uint; typedef unsigned short ushort; diff --git a/modules/softcascade/src/cuda/icf-sc.cu b/modules/softcascade/src/cuda/icf-sc.cu index 6bea94987..1f6a0bc5d 100644 --- a/modules/softcascade/src/cuda/icf-sc.cu +++ b/modules/softcascade/src/cuda/icf-sc.cu @@ -62,7 +62,7 @@ static inline void ___cudaSafeCall(cudaError_t err, const char *file, const int #define CV_PI 3.1415926535897932384626433832795 #endif -namespace cv { namespace softcascade { namespace device { +namespace cv { namespace softcascade { namespace cuda { typedef unsigned char uchar; diff --git a/modules/softcascade/src/cuda_invoker.hpp b/modules/softcascade/src/cuda_invoker.hpp index 135f40546..c173b6aa4 100644 --- a/modules/softcascade/src/cuda_invoker.hpp +++ b/modules/softcascade/src/cuda_invoker.hpp @@ -54,7 +54,7 @@ #endif -namespace cv { namespace softcascade { namespace device { +namespace cv { namespace softcascade { namespace cuda { typedef unsigned char uchar; typedef unsigned int uint; diff --git a/modules/softcascade/src/detector_cuda.cpp b/modules/softcascade/src/detector_cuda.cpp index f0d71c60a..6f9c9070c 100644 --- a/modules/softcascade/src/detector_cuda.cpp +++ b/modules/softcascade/src/detector_cuda.cpp @@ -77,7 +77,7 @@ namespace } } -cv::softcascade::device::Level::Level(int idx, const Octave& oct, const float scale, const int w, const int h) +cv::softcascade::cuda::Level::Level(int idx, const Octave& oct, const float scale, const int w, const int h) : octave(idx), step(oct.stages), relScale(scale / oct.scale) { workRect.x = (unsigned char)cvRound(w / (float)oct.shrinkage); @@ -96,7 +96,7 @@ cv::softcascade::device::Level::Level(int idx, const Octave& oct, const float sc } } -namespace cv { namespace softcascade { namespace device { +namespace cv { namespace softcascade { namespace cuda { void fillBins(cv::gpu::PtrStepSzb hogluv, const cv::gpu::PtrStepSzf& nangle, const int fw, const int fh, const int bins, cudaStream_t stream); @@ -153,9 +153,9 @@ struct cv::softcascade::SCascade::Fields FileNode fn = root[SC_OCTAVES]; if (fn.empty()) return 0; - std::vector voctaves; + std::vector voctaves; std::vector vstages; - std::vector vnodes; + std::vector vnodes; std::vector vleaves; FileNodeIterator it = fn.begin(), it_end = fn.end(); @@ -171,7 +171,7 @@ struct cv::softcascade::SCascade::Fields size.x = (unsigned short)cvRound(origWidth * scale); size.y = (unsigned short)cvRound(origHeight * scale); - device::Octave octave(octIndex, nweaks, shrinkage, size, scale); + cuda::Octave octave(octIndex, nweaks, shrinkage, size, scale); CV_Assert(octave.stages > 0); voctaves.push_back(octave); @@ -240,7 +240,7 @@ struct cv::softcascade::SCascade::Fields rect.w = saturate_cast(r.height); unsigned int channel = saturate_cast(feature_channels[featureIdx]); - vnodes.push_back(device::Node(rect, channel, th)); + vnodes.push_back(cuda::Node(rect, channel, th)); } intfns = octfn[SC_LEAF]; @@ -252,13 +252,13 @@ struct cv::softcascade::SCascade::Fields } } - cv::Mat hoctaves(1, (int) (voctaves.size() * sizeof(device::Octave)), CV_8UC1, (uchar*)&(voctaves[0])); + cv::Mat hoctaves(1, (int) (voctaves.size() * sizeof(cuda::Octave)), CV_8UC1, (uchar*)&(voctaves[0])); CV_Assert(!hoctaves.empty()); cv::Mat hstages(cv::Mat(vstages).reshape(1,1)); CV_Assert(!hstages.empty()); - cv::Mat hnodes(1, (int) (vnodes.size() * sizeof(device::Node)), CV_8UC1, (uchar*)&(vnodes[0]) ); + cv::Mat hnodes(1, (int) (vnodes.size() * sizeof(cuda::Node)), CV_8UC1, (uchar*)&(vnodes[0]) ); CV_Assert(!hnodes.empty()); cv::Mat hleaves(cv::Mat(vleaves).reshape(1,1)); @@ -285,7 +285,7 @@ struct cv::softcascade::SCascade::Fields int createLevels(const int fh, const int fw) { - std::vector vlevels; + std::vector vlevels; float logFactor = (::log(maxScale) - ::log(minScale)) / (totals -1); float scale = minScale; @@ -298,7 +298,7 @@ struct cv::softcascade::SCascade::Fields float logScale = ::log(scale); int fit = fitOctave(voctaves, logScale); - device::Level level(fit, voctaves[fit], scale, width, height); + cuda::Level level(fit, voctaves[fit], scale, width, height); if (!width || !height) break; @@ -312,7 +312,7 @@ struct cv::softcascade::SCascade::Fields scale = ::std::min(maxScale, ::expf(::log(scale) + logFactor)); } - cv::Mat hlevels = cv::Mat(1, (int) (vlevels.size() * sizeof(device::Level)), CV_8UC1, (uchar*)&(vlevels[0]) ); + cv::Mat hlevels = cv::Mat(1, (int) (vlevels.size() * sizeof(cuda::Level)), CV_8UC1, (uchar*)&(vlevels[0]) ); CV_Assert(!hlevels.empty()); levels.upload(hlevels); downscales = dcs; @@ -355,8 +355,8 @@ struct cv::softcascade::SCascade::Fields cudaSafeCall( cudaGetLastError()); - device::CascadeInvoker invoker - = device::CascadeInvoker(levels, stages, nodes, leaves); + cuda::CascadeInvoker invoker + = cuda::CascadeInvoker(levels, stages, nodes, leaves); cudaStream_t stream = cv::gpu::StreamAccessor::getStream(s); invoker(mask, hogluv, objects, downscales, stream); @@ -379,19 +379,19 @@ struct cv::softcascade::SCascade::Fields } cudaStream_t stream = cv::gpu::StreamAccessor::getStream(s); - device::suppress(objects, overlaps, ndetections, suppressed, stream); + cuda::suppress(objects, overlaps, ndetections, suppressed, stream); } private: - typedef std::vector::const_iterator octIt_t; - static int fitOctave(const std::vector& octs, const float& logFactor) + typedef std::vector::const_iterator octIt_t; + static int fitOctave(const std::vector& octs, const float& logFactor) { float minAbsLog = FLT_MAX; int res = 0; for (int oct = 0; oct < (int)octs.size(); ++oct) { - const device::Octave& octave =octs[oct]; + const cuda::Octave& octave =octs[oct]; float logOctave = ::log(octave.scale); float logAbsScale = ::fabs(logFactor - logOctave); @@ -452,7 +452,7 @@ public: // cv::gpu::GpuMat collected; - std::vector voctaves; + std::vector voctaves; // DeviceInfo info; @@ -498,7 +498,7 @@ void integral(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& sum, cv::gpu::GpuMat& { ensureSizeIsEnough(((src.rows + 7) / 8) * 8, ((src.cols + 63) / 64) * 64, CV_32SC1, buffer); - cv::softcascade::device::shfl_integral(src, buffer, stream); + cv::softcascade::cuda::shfl_integral(src, buffer, stream); sum.create(src.rows + 1, src.cols + 1, CV_32SC1); if (s) @@ -539,7 +539,7 @@ void cv::softcascade::SCascade::detect(InputArray _image, InputArray _rois, Outp flds.mask.create( rois.cols / shr, rois.rows / shr, rois.type()); - device::shrink(rois, flds.mask); + cuda::shrink(rois, flds.mask); //cv::gpu::transpose(flds.genRoiTmp, flds.mask, s); if (type == CV_8UC3) @@ -607,12 +607,12 @@ struct SeparablePreprocessor : public cv::softcascade::ChannelsProcessor setZero(channels, s); gray.create(bgr.size(), CV_8UC1); - cv::softcascade::device::transform(bgr, gray); //cv::gpu::cvtColor(bgr, gray, CV_BGR2GRAY); - cv::softcascade::device::gray2hog(gray, channels(cv::Rect(0, 0, bgr.cols, bgr.rows * (bins + 1))), bins); + cv::softcascade::cuda::transform(bgr, gray); //cv::gpu::cvtColor(bgr, gray, CV_BGR2GRAY); + cv::softcascade::cuda::gray2hog(gray, channels(cv::Rect(0, 0, bgr.cols, bgr.rows * (bins + 1))), bins); cv::gpu::GpuMat luv(channels, cv::Rect(0, bgr.rows * (bins + 1), bgr.cols, bgr.rows * 3)); - cv::softcascade::device::bgr2Luv(bgr, luv); - cv::softcascade::device::shrink(channels, shrunk); + cv::softcascade::cuda::bgr2Luv(bgr, luv); + cv::softcascade::cuda::shrink(channels, shrunk); } private: diff --git a/modules/superres/src/btv_l1_gpu.cpp b/modules/superres/src/btv_l1_gpu.cpp index fffcb23fa..8fbbf1703 100644 --- a/modules/superres/src/btv_l1_gpu.cpp +++ b/modules/superres/src/btv_l1_gpu.cpp @@ -60,7 +60,7 @@ Ptr cv::superres::createSuperResolution_BTVL1_GPU() #else // HAVE_CUDA -namespace btv_l1_device +namespace btv_l1_cuda { void buildMotionMaps(PtrStepSzf forwardMotionX, PtrStepSzf forwardMotionY, PtrStepSzf backwardMotionX, PtrStepSzf bacwardMotionY, @@ -138,7 +138,7 @@ namespace backwardMap.first.create(forwardMotion.first.size(), CV_32FC1); backwardMap.second.create(forwardMotion.first.size(), CV_32FC1); - btv_l1_device::buildMotionMaps(forwardMotion.first, forwardMotion.second, + btv_l1_cuda::buildMotionMaps(forwardMotion.first, forwardMotion.second, backwardMotion.first, backwardMotion.second, forwardMap.first, forwardMap.second, backwardMap.first, backwardMap.second); @@ -149,7 +149,7 @@ namespace typedef void (*func_t)(const PtrStepSzb src, PtrStepSzb dst, int scale, cudaStream_t stream); static const func_t funcs[] = { - 0, btv_l1_device::upscale<1>, 0, btv_l1_device::upscale<3>, btv_l1_device::upscale<4> + 0, btv_l1_cuda::upscale<1>, 0, btv_l1_cuda::upscale<3>, btv_l1_cuda::upscale<4> }; CV_Assert( src.channels() == 1 || src.channels() == 3 || src.channels() == 4 ); @@ -166,7 +166,7 @@ namespace { dst.create(src1.size(), src1.type()); - btv_l1_device::diffSign(src1.reshape(1), src2.reshape(1), dst.reshape(1), StreamAccessor::getStream(stream)); + btv_l1_cuda::diffSign(src1.reshape(1), src2.reshape(1), dst.reshape(1), StreamAccessor::getStream(stream)); } void calcBtvWeights(int btvKernelSize, double alpha, std::vector& btvWeights) @@ -184,7 +184,7 @@ namespace btvWeights[ind] = pow(alpha_f, std::abs(m) + std::abs(l)); } - btv_l1_device::loadBtvWeights(&btvWeights[0], size); + btv_l1_cuda::loadBtvWeights(&btvWeights[0], size); } void calcBtvRegularization(const GpuMat& src, GpuMat& dst, int btvKernelSize) @@ -193,10 +193,10 @@ namespace static const func_t funcs[] = { 0, - btv_l1_device::calcBtvRegularization<1>, + btv_l1_cuda::calcBtvRegularization<1>, 0, - btv_l1_device::calcBtvRegularization<3>, - btv_l1_device::calcBtvRegularization<4> + btv_l1_cuda::calcBtvRegularization<3>, + btv_l1_cuda::calcBtvRegularization<4> }; dst.create(src.size(), src.type()); diff --git a/modules/superres/src/cuda/btv_l1_gpu.cu b/modules/superres/src/cuda/btv_l1_gpu.cu index 2bb93d131..09f67e6b1 100644 --- a/modules/superres/src/cuda/btv_l1_gpu.cu +++ b/modules/superres/src/cuda/btv_l1_gpu.cu @@ -40,15 +40,15 @@ // //M*/ -#include "opencv2/core/device/common.hpp" -#include "opencv2/core/device/transform.hpp" -#include "opencv2/core/device/vec_traits.hpp" -#include "opencv2/core/device/vec_math.hpp" +#include "opencv2/core/cuda/common.hpp" +#include "opencv2/core/cuda/transform.hpp" +#include "opencv2/core/cuda/vec_traits.hpp" +#include "opencv2/core/cuda/vec_math.hpp" using namespace cv::gpu; -using namespace cv::gpu::device; +using namespace cv::gpu::cuda; -namespace btv_l1_device +namespace btv_l1_cuda { void buildMotionMaps(PtrStepSzf forwardMotionX, PtrStepSzf forwardMotionY, PtrStepSzf backwardMotionX, PtrStepSzf bacwardMotionY, @@ -64,7 +64,7 @@ namespace btv_l1_device template void calcBtvRegularization(PtrStepSzb src, PtrStepSzb dst, int ksize); } -namespace btv_l1_device +namespace btv_l1_cuda { __global__ void buildMotionMapsKernel(const PtrStepSzf forwardMotionX, const PtrStepf forwardMotionY, PtrStepf backwardMotionX, PtrStepf backwardMotionY, @@ -169,16 +169,16 @@ namespace btv_l1_device }; } -namespace cv { namespace gpu { namespace device +namespace cv { namespace gpu { namespace cuda { - template <> struct TransformFunctorTraits : DefaultTransformFunctorTraits + template <> struct TransformFunctorTraits : DefaultTransformFunctorTraits { enum { smart_block_dim_y = 8 }; enum { smart_shift = 4 }; }; }}} -namespace btv_l1_device +namespace btv_l1_cuda { void diffSign(PtrStepSzf src1, PtrStepSzf src2, PtrStepSzf dst, cudaStream_t stream) { From 204a19b431855d896fd090cbe2c8be23b2688757 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Wed, 3 Apr 2013 17:09:31 +0400 Subject: [PATCH 03/12] moved common gpu utility functionality to gpu_private.hpp --- .../core/include/opencv2/core/cuda/common.hpp | 56 ++-- .../core/cuda/detail/transform_detail.hpp | 20 +- .../include/opencv2/core/cuda_devptrs.hpp | 3 - .../core/include/opencv2/core/gpu_private.hpp | 134 ++++++++++ modules/core/include/opencv2/core/gpumat.hpp | 5 - .../include/opencv2/core/stream_accessor.hpp | 15 +- modules/core/src/cuda/matrix_operations.cu | 26 +- modules/core/src/cudastream.cpp | 65 +++-- modules/core/src/gpumat.cpp | 253 +++++++++++------- modules/core/src/matrix_operations.cpp | 48 ++-- modules/core/src/opengl_interop.cpp | 120 ++++----- modules/core/src/precomp.hpp | 33 +-- modules/gpu/perf/perf_precomp.hpp | 6 +- modules/gpu/src/arithm.cpp | 34 +-- modules/gpu/src/bgfg_gmg.cpp | 6 +- modules/gpu/src/bgfg_mog.cpp | 16 +- modules/gpu/src/bilateral_filter.cpp | 6 +- modules/gpu/src/blend.cpp | 2 +- modules/gpu/src/brute_force_matcher.cpp | 62 ++--- modules/gpu/src/calib3d.cpp | 6 +- modules/gpu/src/cascadeclassifier.cpp | 28 +- modules/gpu/src/color.cpp | 12 +- modules/gpu/src/cuda/NV12ToARGB.cu | 6 +- modules/gpu/src/cuda/bf_knnmatch.cu | 36 +-- modules/gpu/src/cuda/bf_match.cu | 24 +- modules/gpu/src/cuda/bf_radius_match.cu | 16 +- modules/gpu/src/cuda/bgfg_gmg.cu | 24 +- modules/gpu/src/cuda/bgfg_mog.cu | 50 ++-- modules/gpu/src/cuda/bilateral_filter.cu | 6 +- modules/gpu/src/cuda/blend.cu | 8 +- modules/gpu/src/cuda/calib3d.cu | 28 +- modules/gpu/src/cuda/canny.cu | 28 +- modules/gpu/src/cuda/ccomponetns.cu | 12 +- modules/gpu/src/cuda/clahe.cu | 10 +- modules/gpu/src/cuda/column_filter.h | 8 +- modules/gpu/src/cuda/copy_make_border.cu | 4 +- modules/gpu/src/cuda/debayer.cu | 16 +- modules/gpu/src/cuda/disp_bilateral_filter.cu | 26 +- modules/gpu/src/cuda/element_operations.cu | 120 ++++----- modules/gpu/src/cuda/fast.cu | 20 +- modules/gpu/src/cuda/fgd_bgfg.cu | 24 +- modules/gpu/src/cuda/gftt.cu | 24 +- modules/gpu/src/cuda/global_motion.cu | 8 +- modules/gpu/src/cuda/hist.cu | 10 +- modules/gpu/src/cuda/hog.cu | 68 ++--- modules/gpu/src/cuda/hough.cu | 164 ++++++------ modules/gpu/src/cuda/imgproc.cu | 94 +++---- modules/gpu/src/cuda/integral_image.cu | 14 +- modules/gpu/src/cuda/internal_shared.hpp | 27 -- modules/gpu/src/cuda/lbp.cu | 2 +- modules/gpu/src/cuda/match_template.cu | 56 ++-- modules/gpu/src/cuda/mathfunc.cu | 8 +- modules/gpu/src/cuda/matrix_reductions.cu | 44 +-- modules/gpu/src/cuda/nlm.cu | 18 +- modules/gpu/src/cuda/optflowbm.cu | 8 +- modules/gpu/src/cuda/optical_flow.cu | 8 +- .../gpu/src/cuda/optical_flow_farneback.cu | 46 ++-- modules/gpu/src/cuda/orb.cu | 18 +- modules/gpu/src/cuda/pyr_down.cu | 4 +- modules/gpu/src/cuda/pyr_up.cu | 4 +- modules/gpu/src/cuda/pyrlk.cu | 20 +- modules/gpu/src/cuda/remap.cu | 14 +- modules/gpu/src/cuda/resize.cu | 18 +- modules/gpu/src/cuda/rgb_to_yv12.cu | 8 +- modules/gpu/src/cuda/row_filter.h | 8 +- modules/gpu/src/cuda/safe_call.hpp | 9 - modules/gpu/src/cuda/split_merge.cu | 28 +- modules/gpu/src/cuda/stereobm.cu | 34 +-- modules/gpu/src/cuda/stereobp.cu | 56 ++-- modules/gpu/src/cuda/stereocsbp.cu | 76 +++--- modules/gpu/src/cuda/tvl1flow.cu | 16 +- modules/gpu/src/cuda/warp.cu | 26 +- modules/gpu/src/denoising.cpp | 8 +- modules/gpu/src/element_operations.cpp | 94 +++---- modules/gpu/src/error.cpp | 71 +---- modules/gpu/src/fast.cpp | 16 +- modules/gpu/src/fgd_bgfg.cpp | 10 +- modules/gpu/src/filtering.cpp | 94 +++---- modules/gpu/src/gftt.cpp | 2 +- modules/gpu/src/global_motion.cpp | 4 +- modules/gpu/src/graphcuts.cpp | 12 +- modules/gpu/src/hog.cpp | 30 +-- modules/gpu/src/hough.cpp | 44 +-- modules/gpu/src/imgproc.cpp | 119 ++++---- modules/gpu/src/match_template.cpp | 2 +- modules/gpu/src/matrix_reductions.cpp | 56 ++-- modules/gpu/src/mssegmentation.cpp | 2 +- modules/gpu/src/nvidia/core/NCVPyramid.cu | 8 +- modules/gpu/src/optflowbm.cpp | 8 +- modules/gpu/src/optical_flow.cpp | 10 +- modules/gpu/src/optical_flow_farneback.cpp | 2 +- modules/gpu/src/orb.cpp | 24 +- modules/gpu/src/precomp.cpp | 33 --- modules/gpu/src/precomp.hpp | 53 +--- modules/gpu/src/pyramids.cpp | 8 +- modules/gpu/src/pyrlk.cpp | 6 +- modules/gpu/src/remap.cpp | 2 +- modules/gpu/src/resize.cpp | 4 +- modules/gpu/src/split_merge.cpp | 8 +- modules/gpu/src/stereobm.cpp | 8 +- modules/gpu/src/stereobp.cpp | 10 +- modules/gpu/src/stereocsbp.cpp | 8 +- modules/gpu/src/tvl1flow.cpp | 6 +- modules/gpu/src/video_reader.cpp | 18 +- modules/gpu/src/video_writer.cpp | 30 +-- modules/gpu/src/warp.cpp | 10 +- modules/gpu/test/test_precomp.hpp | 33 +-- modules/nonfree/perf/perf_precomp.hpp | 2 +- modules/nonfree/src/cuda/surf.cu | 54 ++-- modules/nonfree/src/cuda/vibe.cu | 20 +- modules/nonfree/src/precomp.hpp | 14 +- modules/nonfree/src/surf_gpu.cpp | 28 +- modules/nonfree/src/vibe_gpu.cpp | 6 +- modules/softcascade/src/detector_cuda.cpp | 33 +-- modules/softcascade/src/precomp.hpp | 1 + modules/superres/src/cuda/btv_l1_gpu.cu | 14 +- modules/superres/src/precomp.hpp | 6 +- 117 files changed, 1670 insertions(+), 1721 deletions(-) create mode 100644 modules/core/include/opencv2/core/gpu_private.hpp diff --git a/modules/core/include/opencv2/core/cuda/common.hpp b/modules/core/include/opencv2/core/cuda/common.hpp index 680ec497c..203efae1e 100644 --- a/modules/core/include/opencv2/core/cuda/common.hpp +++ b/modules/core/include/opencv2/core/cuda/common.hpp @@ -45,10 +45,8 @@ #include #include "opencv2/core/cuda_devptrs.hpp" - -#ifndef CV_PI - #define CV_PI 3.1415926535897932384626433832795 -#endif +#include "opencv2/core/cvdef.h" +#include "opencv2/core/base.hpp" #ifndef CV_PI_F #ifndef CV_PI @@ -58,16 +56,22 @@ #endif #endif +namespace cv { namespace gpu { namespace cuda { + static inline void checkError(cudaError_t err, const char* file, const int line, const char* func) + { + if (cudaSuccess != err) + cv::error(cv::Error::GpuApiCallError, cudaGetErrorString(err), func, file, line); + } +}}} + #if defined(__GNUC__) - #define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__, __func__) + #define cvCudaSafeCall(expr) cv::gpu::cuda::checkError((expr), __FILE__, __LINE__, __func__) #else /* defined(__CUDACC__) || defined(__MSVC__) */ - #define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__) + #define cvCudaSafeCall(expr) cv::gpu::cuda::checkError((expr), __FILE__, __LINE__, "") #endif namespace cv { namespace gpu { - void error(const char *error_string, const char *file, const int line, const char *func); - template static inline bool isAligned(const T* ptr, size_t size) { return reinterpret_cast(ptr) % size == 0; @@ -79,38 +83,32 @@ namespace cv { namespace gpu } }} -static inline void ___cudaSafeCall(cudaError_t err, const char *file, const int line, const char *func = "") -{ - if (cudaSuccess != err) - cv::gpu::error(cudaGetErrorString(err), file, line, func); -} - namespace cv { namespace gpu { - __host__ __device__ __forceinline__ int divUp(int total, int grain) + enum { - return (total + grain - 1) / grain; - } - - namespace cuda - { - using cv::gpu::divUp; + BORDER_REFLECT101_GPU = 0, + BORDER_REPLICATE_GPU, + BORDER_CONSTANT_GPU, + BORDER_REFLECT_GPU, + BORDER_WRAP_GPU + }; #ifdef __CUDACC__ - typedef unsigned char uchar; - typedef unsigned short ushort; - typedef signed char schar; - #if defined (_WIN32) || defined (__APPLE__) - typedef unsigned int uint; - #endif + namespace cuda + { + __host__ __device__ __forceinline__ int divUp(int total, int grain) + { + return (total + grain - 1) / grain; + } template inline void bindTexture(const textureReference* tex, const PtrStepSz& img) { cudaChannelFormatDesc desc = cudaCreateChannelDesc(); - cudaSafeCall( cudaBindTexture2D(0, tex, img.ptr(), &desc, img.cols, img.rows, img.step) ); + cvCudaSafeCall( cudaBindTexture2D(0, tex, img.ptr(), &desc, img.cols, img.rows, img.step) ); } -#endif // __CUDACC__ } +#endif // __CUDACC__ }} diff --git a/modules/core/include/opencv2/core/cuda/detail/transform_detail.hpp b/modules/core/include/opencv2/core/cuda/detail/transform_detail.hpp index 0ed8d64db..731aa15ce 100644 --- a/modules/core/include/opencv2/core/cuda/detail/transform_detail.hpp +++ b/modules/core/include/opencv2/core/cuda/detail/transform_detail.hpp @@ -317,10 +317,10 @@ namespace cv { namespace gpu { namespace cuda const dim3 grid(divUp(src.cols, threads.x), divUp(src.rows, threads.y), 1); transformSimple<<>>(src, dst, mask, op); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -332,10 +332,10 @@ namespace cv { namespace gpu { namespace cuda const dim3 grid(divUp(src1.cols, threads.x), divUp(src1.rows, threads.y), 1); transformSimple<<>>(src1, src2, dst, mask, op); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } }; template<> struct TransformDispatcher @@ -345,7 +345,7 @@ namespace cv { namespace gpu { namespace cuda { typedef TransformFunctorTraits ft; - StaticAssert::check(); + CV_StaticAssert(ft::smart_shift != 1, ""); if (!isAligned(src.data, ft::smart_shift * sizeof(T)) || !isAligned(src.step, ft::smart_shift * sizeof(T)) || !isAligned(dst.data, ft::smart_shift * sizeof(D)) || !isAligned(dst.step, ft::smart_shift * sizeof(D))) @@ -358,10 +358,10 @@ namespace cv { namespace gpu { namespace cuda const dim3 grid(divUp(src.cols, threads.x * ft::smart_shift), divUp(src.rows, threads.y), 1); transformSmart<<>>(src, dst, mask, op); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -369,7 +369,7 @@ namespace cv { namespace gpu { namespace cuda { typedef TransformFunctorTraits ft; - StaticAssert::check(); + CV_StaticAssert(ft::smart_shift != 1, ""); if (!isAligned(src1.data, ft::smart_shift * sizeof(T1)) || !isAligned(src1.step, ft::smart_shift * sizeof(T1)) || !isAligned(src2.data, ft::smart_shift * sizeof(T2)) || !isAligned(src2.step, ft::smart_shift * sizeof(T2)) || @@ -383,10 +383,10 @@ namespace cv { namespace gpu { namespace cuda const dim3 grid(divUp(src1.cols, threads.x * ft::smart_shift), divUp(src1.rows, threads.y), 1); transformSmart<<>>(src1, src2, dst, mask, op); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } }; } // namespace transform_detail diff --git a/modules/core/include/opencv2/core/cuda_devptrs.hpp b/modules/core/include/opencv2/core/cuda_devptrs.hpp index 9e0ba11da..c82ce61b3 100644 --- a/modules/core/include/opencv2/core/cuda_devptrs.hpp +++ b/modules/core/include/opencv2/core/cuda_devptrs.hpp @@ -58,9 +58,6 @@ namespace cv // Simple lightweight structures that encapsulates information about an image on device. // It is intended to pass to nvcc-compiled code. GpuMat depends on headers that nvcc can't compile - template struct StaticAssert; - template <> struct StaticAssert {static __CV_GPU_HOST_DEVICE__ void check(){}}; - template struct DevPtr { typedef T elem_type; diff --git a/modules/core/include/opencv2/core/gpu_private.hpp b/modules/core/include/opencv2/core/gpu_private.hpp new file mode 100644 index 000000000..31ea5e6e9 --- /dev/null +++ b/modules/core/include/opencv2/core/gpu_private.hpp @@ -0,0 +1,134 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. +// Copyright (C) 2009, Willow Garage Inc., all rights reserved. +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_CORE_GPU_PRIVATE_HPP__ +#define __OPENCV_CORE_GPU_PRIVATE_HPP__ + +#ifndef __OPENCV_BUILD +# error this is a private header which should not be used from outside of the OpenCV library +#endif + +#include "cvconfig.h" + +#include "opencv2/core/cvdef.h" +#include "opencv2/core/base.hpp" + +#ifdef HAVE_CUDA +# include +# include +# include +# include "opencv2/core/stream_accessor.hpp" +# include "opencv2/core/cuda/common.hpp" + +# define CUDART_MINIMUM_REQUIRED_VERSION 4020 + +# if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION) +# error "Insufficient Cuda Runtime library version, please update it." +# endif + +# if defined(CUDA_ARCH_BIN_OR_PTX_10) +# error "OpenCV GPU module doesn't support NVIDIA compute capability 1.0" +# endif +#endif + +namespace cv { namespace gpu { + CV_EXPORTS cv::String getNppErrorMessage(int code); + + static inline void checkNppError(int code, const char* file, const int line, const char* func) + { + if (code < 0) + cv::error(cv::Error::GpuApiCallError, getNppErrorMessage(code), func, file, line); + } + + // Converts CPU border extrapolation mode into GPU internal analogue. + // Returns true if the GPU analogue exists, false otherwise. + CV_EXPORTS bool tryConvertToGpuBorderType(int cpuBorderType, int& gpuBorderType); +}} + +#ifndef HAVE_CUDA + +static inline void throw_no_cuda() { CV_Error(cv::Error::GpuNotSupported, "The library is compiled without GPU support"); } + +#else // HAVE_CUDA + +static inline void throw_no_cuda() { CV_Error(cv::Error::StsNotImplemented, "The called functionality is disabled for current build or platform"); } + +#if defined(__GNUC__) + #define nppSafeCall(expr) cv::gpu::checkNppError(expr, __FILE__, __LINE__, __func__) +#else /* defined(__CUDACC__) || defined(__MSVC__) */ + #define nppSafeCall(expr) cv::gpu::checkNppError(expr, __FILE__, __LINE__, "") +#endif + +namespace cv { namespace gpu +{ + template struct NPPTypeTraits; + template<> struct NPPTypeTraits { typedef Npp8u npp_type; }; + template<> struct NPPTypeTraits { typedef Npp8s npp_type; }; + template<> struct NPPTypeTraits { typedef Npp16u npp_type; }; + template<> struct NPPTypeTraits { typedef Npp16s npp_type; }; + template<> struct NPPTypeTraits { typedef Npp32s npp_type; }; + template<> struct NPPTypeTraits { typedef Npp32f npp_type; }; + template<> struct NPPTypeTraits { typedef Npp64f npp_type; }; + + class NppStreamHandler + { + public: + inline explicit NppStreamHandler(cudaStream_t newStream) + { + oldStream = nppGetStream(); + nppSetStream(newStream); + } + + inline ~NppStreamHandler() + { + nppSetStream(oldStream); + } + + private: + cudaStream_t oldStream; + }; +}} + +#endif // HAVE_CUDA + +#endif // __OPENCV_CORE_GPU_PRIVATE_HPP__ diff --git a/modules/core/include/opencv2/core/gpumat.hpp b/modules/core/include/opencv2/core/gpumat.hpp index 60d37e500..52b87b000 100644 --- a/modules/core/include/opencv2/core/gpumat.hpp +++ b/modules/core/include/opencv2/core/gpumat.hpp @@ -454,11 +454,6 @@ CV_EXPORTS void ensureSizeIsEnough(int rows, int cols, int type, GpuMat& m); CV_EXPORTS GpuMat allocMatFromBuf(int rows, int cols, int type, GpuMat &mat); -//////////////////////////////////////////////////////////////////////// -// Error handling - -CV_EXPORTS void error(const char* error_string, const char* file, const int line, const char* func = ""); - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// diff --git a/modules/core/include/opencv2/core/stream_accessor.hpp b/modules/core/include/opencv2/core/stream_accessor.hpp index 9b87470e7..3f98eb0a3 100644 --- a/modules/core/include/opencv2/core/stream_accessor.hpp +++ b/modules/core/include/opencv2/core/stream_accessor.hpp @@ -43,17 +43,20 @@ #ifndef __OPENCV_CUDA_STREAM_ACCESSOR_HPP__ #define __OPENCV_CUDA_STREAM_ACCESSOR_HPP__ -#include "opencv2/core/gpumat.hpp" -#include "cuda_runtime_api.h" +#include +#include "opencv2/core/cvdef.h" + +// This is only header file that depends on Cuda. All other headers are independent. +// So if you use OpenCV binaries you do noot need to install Cuda Toolkit. +// But of you wanna use GPU by yourself, may get cuda stream instance using the class below. +// In this case you have to install Cuda Toolkit. namespace cv { namespace gpu { - // This is only header file that depends on Cuda. All other headers are independent. - // So if you use OpenCV binaries you do noot need to install Cuda Toolkit. - // But of you wanna use GPU by yourself, may get cuda stream instance using the class below. - // In this case you have to install Cuda Toolkit. + class Stream; + struct StreamAccessor { CV_EXPORTS static cudaStream_t getStream(const Stream& stream); diff --git a/modules/core/src/cuda/matrix_operations.cu b/modules/core/src/cuda/matrix_operations.cu index 2cb82184c..725321286 100644 --- a/modules/core/src/cuda/matrix_operations.cu +++ b/modules/core/src/cuda/matrix_operations.cu @@ -124,31 +124,31 @@ namespace cv { namespace gpu { namespace cuda void writeScalar(const uchar* vals) { - cudaSafeCall( cudaMemcpyToSymbol(scalar_8u, vals, sizeof(uchar) * 4) ); + cvCudaSafeCall( cudaMemcpyToSymbol(scalar_8u, vals, sizeof(uchar) * 4) ); } void writeScalar(const schar* vals) { - cudaSafeCall( cudaMemcpyToSymbol(scalar_8s, vals, sizeof(schar) * 4) ); + cvCudaSafeCall( cudaMemcpyToSymbol(scalar_8s, vals, sizeof(schar) * 4) ); } void writeScalar(const ushort* vals) { - cudaSafeCall( cudaMemcpyToSymbol(scalar_16u, vals, sizeof(ushort) * 4) ); + cvCudaSafeCall( cudaMemcpyToSymbol(scalar_16u, vals, sizeof(ushort) * 4) ); } void writeScalar(const short* vals) { - cudaSafeCall( cudaMemcpyToSymbol(scalar_16s, vals, sizeof(short) * 4) ); + cvCudaSafeCall( cudaMemcpyToSymbol(scalar_16s, vals, sizeof(short) * 4) ); } void writeScalar(const int* vals) { - cudaSafeCall( cudaMemcpyToSymbol(scalar_32s, vals, sizeof(int) * 4) ); + cvCudaSafeCall( cudaMemcpyToSymbol(scalar_32s, vals, sizeof(int) * 4) ); } void writeScalar(const float* vals) { - cudaSafeCall( cudaMemcpyToSymbol(scalar_32f, vals, sizeof(float) * 4) ); + cvCudaSafeCall( cudaMemcpyToSymbol(scalar_32f, vals, sizeof(float) * 4) ); } void writeScalar(const double* vals) { - cudaSafeCall( cudaMemcpyToSymbol(scalar_64f, vals, sizeof(double) * 4) ); + cvCudaSafeCall( cudaMemcpyToSymbol(scalar_64f, vals, sizeof(double) * 4) ); } template @@ -186,10 +186,10 @@ namespace cv { namespace gpu { namespace cuda dim3 numBlocks (mat.cols * channels / threadsPerBlock.x + 1, mat.rows / threadsPerBlock.y + 1, 1); set_to_with_mask<<>>((T*)mat.data, (uchar*)mask.data, mat.cols, mat.rows, mat.step, channels, mask.step); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall ( cudaDeviceSynchronize() ); + cvCudaSafeCall ( cudaDeviceSynchronize() ); } template void set_to_gpu(PtrStepSzb mat, const uchar* scalar, PtrStepSzb mask, int channels, cudaStream_t stream); @@ -209,10 +209,10 @@ namespace cv { namespace gpu { namespace cuda dim3 numBlocks (mat.cols * channels / threadsPerBlock.x + 1, mat.rows / threadsPerBlock.y + 1, 1); set_to_without_mask<<>>((T*)mat.data, mat.cols, mat.rows, mat.step, channels); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall ( cudaDeviceSynchronize() ); + cvCudaSafeCall ( cudaDeviceSynchronize() ); } template void set_to_gpu(PtrStepSzb mat, const uchar* scalar, int channels, cudaStream_t stream); @@ -290,8 +290,8 @@ namespace cv { namespace gpu { namespace cuda template void cvt_(PtrStepSzb src, PtrStepSzb dst, double alpha, double beta, cudaStream_t stream) { - cudaSafeCall( cudaSetDoubleForDevice(&alpha) ); - cudaSafeCall( cudaSetDoubleForDevice(&beta) ); + cvCudaSafeCall( cudaSetDoubleForDevice(&alpha) ); + cvCudaSafeCall( cudaSetDoubleForDevice(&beta) ); Convertor op(static_cast(alpha), static_cast(beta)); cv::gpu::cuda::transform((PtrStepSz)src, (PtrStepSz)dst, op, WithOutMask(), stream); } diff --git a/modules/core/src/cudastream.cpp b/modules/core/src/cudastream.cpp index 270865a9d..a6d1a41e6 100644 --- a/modules/core/src/cudastream.cpp +++ b/modules/core/src/cudastream.cpp @@ -46,33 +46,30 @@ using namespace cv; using namespace cv::gpu; #if !defined (HAVE_CUDA) -#define throw_nogpu() CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support") -cv::gpu::Stream::Stream() { throw_nogpu(); } +cv::gpu::Stream::Stream() { throw_no_cuda(); } cv::gpu::Stream::~Stream() {} -cv::gpu::Stream::Stream(const Stream&) { throw_nogpu(); } -Stream& cv::gpu::Stream::operator=(const Stream&) { throw_nogpu(); return *this; } -bool cv::gpu::Stream::queryIfComplete() { throw_nogpu(); return false; } -void cv::gpu::Stream::waitForCompletion() { throw_nogpu(); } -void cv::gpu::Stream::enqueueDownload(const GpuMat&, Mat&) { throw_nogpu(); } -void cv::gpu::Stream::enqueueDownload(const GpuMat&, CudaMem&) { throw_nogpu(); } -void cv::gpu::Stream::enqueueUpload(const CudaMem&, GpuMat&) { throw_nogpu(); } -void cv::gpu::Stream::enqueueUpload(const Mat&, GpuMat&) { throw_nogpu(); } -void cv::gpu::Stream::enqueueCopy(const GpuMat&, GpuMat&) { throw_nogpu(); } -void cv::gpu::Stream::enqueueMemSet(GpuMat&, Scalar) { throw_nogpu(); } -void cv::gpu::Stream::enqueueMemSet(GpuMat&, Scalar, const GpuMat&) { throw_nogpu(); } -void cv::gpu::Stream::enqueueConvert(const GpuMat&, GpuMat&, int, double, double) { throw_nogpu(); } -void cv::gpu::Stream::enqueueHostCallback(StreamCallback, void*) { throw_nogpu(); } -Stream& cv::gpu::Stream::Null() { throw_nogpu(); static Stream s; return s; } -cv::gpu::Stream::operator bool() const { throw_nogpu(); return false; } -cv::gpu::Stream::Stream(Impl*) { throw_nogpu(); } -void cv::gpu::Stream::create() { throw_nogpu(); } -void cv::gpu::Stream::release() { throw_nogpu(); } +cv::gpu::Stream::Stream(const Stream&) { throw_no_cuda(); } +Stream& cv::gpu::Stream::operator=(const Stream&) { throw_no_cuda(); return *this; } +bool cv::gpu::Stream::queryIfComplete() { throw_no_cuda(); return false; } +void cv::gpu::Stream::waitForCompletion() { throw_no_cuda(); } +void cv::gpu::Stream::enqueueDownload(const GpuMat&, Mat&) { throw_no_cuda(); } +void cv::gpu::Stream::enqueueDownload(const GpuMat&, CudaMem&) { throw_no_cuda(); } +void cv::gpu::Stream::enqueueUpload(const CudaMem&, GpuMat&) { throw_no_cuda(); } +void cv::gpu::Stream::enqueueUpload(const Mat&, GpuMat&) { throw_no_cuda(); } +void cv::gpu::Stream::enqueueCopy(const GpuMat&, GpuMat&) { throw_no_cuda(); } +void cv::gpu::Stream::enqueueMemSet(GpuMat&, Scalar) { throw_no_cuda(); } +void cv::gpu::Stream::enqueueMemSet(GpuMat&, Scalar, const GpuMat&) { throw_no_cuda(); } +void cv::gpu::Stream::enqueueConvert(const GpuMat&, GpuMat&, int, double, double) { throw_no_cuda(); } +void cv::gpu::Stream::enqueueHostCallback(StreamCallback, void*) { throw_no_cuda(); } +Stream& cv::gpu::Stream::Null() { throw_no_cuda(); static Stream s; return s; } +cv::gpu::Stream::operator bool() const { throw_no_cuda(); return false; } +cv::gpu::Stream::Stream(Impl*) { throw_no_cuda(); } +void cv::gpu::Stream::create() { throw_no_cuda(); } +void cv::gpu::Stream::release() { throw_no_cuda(); } #else /* !defined (HAVE_CUDA) */ -#include "opencv2/core/stream_accessor.hpp" - namespace cv { namespace gpu { void copyWithMask(const GpuMat& src, GpuMat& dst, const GpuMat& mask, cudaStream_t stream); @@ -134,14 +131,14 @@ bool cv::gpu::Stream::queryIfComplete() if (err == cudaErrorNotReady || err == cudaSuccess) return err == cudaSuccess; - cudaSafeCall(err); + cvCudaSafeCall(err); return false; } void cv::gpu::Stream::waitForCompletion() { cudaStream_t stream = Impl::getStream(impl); - cudaSafeCall( cudaStreamSynchronize(stream) ); + cvCudaSafeCall( cudaStreamSynchronize(stream) ); } void cv::gpu::Stream::enqueueDownload(const GpuMat& src, Mat& dst) @@ -151,7 +148,7 @@ void cv::gpu::Stream::enqueueDownload(const GpuMat& src, Mat& dst) cudaStream_t stream = Impl::getStream(impl); size_t bwidth = src.cols * src.elemSize(); - cudaSafeCall( cudaMemcpy2DAsync(dst.data, dst.step, src.data, src.step, bwidth, src.rows, cudaMemcpyDeviceToHost, stream) ); + cvCudaSafeCall( cudaMemcpy2DAsync(dst.data, dst.step, src.data, src.step, bwidth, src.rows, cudaMemcpyDeviceToHost, stream) ); } void cv::gpu::Stream::enqueueDownload(const GpuMat& src, CudaMem& dst) @@ -160,7 +157,7 @@ void cv::gpu::Stream::enqueueDownload(const GpuMat& src, CudaMem& dst) cudaStream_t stream = Impl::getStream(impl); size_t bwidth = src.cols * src.elemSize(); - cudaSafeCall( cudaMemcpy2DAsync(dst.data, dst.step, src.data, src.step, bwidth, src.rows, cudaMemcpyDeviceToHost, stream) ); + cvCudaSafeCall( cudaMemcpy2DAsync(dst.data, dst.step, src.data, src.step, bwidth, src.rows, cudaMemcpyDeviceToHost, stream) ); } void cv::gpu::Stream::enqueueUpload(const CudaMem& src, GpuMat& dst) @@ -169,7 +166,7 @@ void cv::gpu::Stream::enqueueUpload(const CudaMem& src, GpuMat& dst) cudaStream_t stream = Impl::getStream(impl); size_t bwidth = src.cols * src.elemSize(); - cudaSafeCall( cudaMemcpy2DAsync(dst.data, dst.step, src.data, src.step, bwidth, src.rows, cudaMemcpyHostToDevice, stream) ); + cvCudaSafeCall( cudaMemcpy2DAsync(dst.data, dst.step, src.data, src.step, bwidth, src.rows, cudaMemcpyHostToDevice, stream) ); } void cv::gpu::Stream::enqueueUpload(const Mat& src, GpuMat& dst) @@ -178,7 +175,7 @@ void cv::gpu::Stream::enqueueUpload(const Mat& src, GpuMat& dst) cudaStream_t stream = Impl::getStream(impl); size_t bwidth = src.cols * src.elemSize(); - cudaSafeCall( cudaMemcpy2DAsync(dst.data, dst.step, src.data, src.step, bwidth, src.rows, cudaMemcpyHostToDevice, stream) ); + cvCudaSafeCall( cudaMemcpy2DAsync(dst.data, dst.step, src.data, src.step, bwidth, src.rows, cudaMemcpyHostToDevice, stream) ); } void cv::gpu::Stream::enqueueCopy(const GpuMat& src, GpuMat& dst) @@ -187,7 +184,7 @@ void cv::gpu::Stream::enqueueCopy(const GpuMat& src, GpuMat& dst) cudaStream_t stream = Impl::getStream(impl); size_t bwidth = src.cols * src.elemSize(); - cudaSafeCall( cudaMemcpy2DAsync(dst.data, dst.step, src.data, src.step, bwidth, src.rows, cudaMemcpyDeviceToDevice, stream) ); + cvCudaSafeCall( cudaMemcpy2DAsync(dst.data, dst.step, src.data, src.step, bwidth, src.rows, cudaMemcpyDeviceToDevice, stream) ); } void cv::gpu::Stream::enqueueMemSet(GpuMat& src, Scalar val) @@ -204,7 +201,7 @@ void cv::gpu::Stream::enqueueMemSet(GpuMat& src, Scalar val) if (val[0] == 0.0 && val[1] == 0.0 && val[2] == 0.0 && val[3] == 0.0) { - cudaSafeCall( cudaMemset2DAsync(src.data, src.step, 0, src.cols * src.elemSize(), src.rows, stream) ); + cvCudaSafeCall( cudaMemset2DAsync(src.data, src.step, 0, src.cols * src.elemSize(), src.rows, stream) ); return; } @@ -215,7 +212,7 @@ void cv::gpu::Stream::enqueueMemSet(GpuMat& src, Scalar val) if (cn == 1 || (cn == 2 && val[0] == val[1]) || (cn == 3 && val[0] == val[1] && val[0] == val[2]) || (cn == 4 && val[0] == val[1] && val[0] == val[2] && val[0] == val[3])) { int ival = saturate_cast(val[0]); - cudaSafeCall( cudaMemset2DAsync(src.data, src.step, ival, src.cols * src.elemSize(), src.rows, stream) ); + cvCudaSafeCall( cudaMemset2DAsync(src.data, src.step, ival, src.cols * src.elemSize(), src.rows, stream) ); return; } } @@ -302,7 +299,7 @@ void cv::gpu::Stream::enqueueHostCallback(StreamCallback callback, void* userDat cudaStream_t stream = Impl::getStream(impl); - cudaSafeCall( cudaStreamAddCallback(stream, cudaStreamCallback, data, 0) ); + cvCudaSafeCall( cudaStreamAddCallback(stream, cudaStreamCallback, data, 0) ); #else (void) callback; (void) userData; @@ -331,7 +328,7 @@ void cv::gpu::Stream::create() release(); cudaStream_t stream; - cudaSafeCall( cudaStreamCreate( &stream ) ); + cvCudaSafeCall( cudaStreamCreate( &stream ) ); impl = (Stream::Impl*) fastMalloc(sizeof(Stream::Impl)); @@ -343,7 +340,7 @@ void cv::gpu::Stream::release() { if (impl && CV_XADD(&impl->ref_counter, -1) == 1) { - cudaSafeCall( cudaStreamDestroy(impl->stream) ); + cvCudaSafeCall( cudaStreamDestroy(impl->stream) ); cv::fastFree(impl); } } diff --git a/modules/core/src/gpumat.cpp b/modules/core/src/gpumat.cpp index 12252b538..3e1f3fe0b 100644 --- a/modules/core/src/gpumat.cpp +++ b/modules/core/src/gpumat.cpp @@ -45,64 +45,38 @@ using namespace cv; using namespace cv::gpu; -#ifndef HAVE_CUDA - -#define throw_nogpu CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support") - -#else // HAVE_CUDA - -namespace -{ -#if defined(__GNUC__) - #define nppSafeCall(expr) ___nppSafeCall(expr, __FILE__, __LINE__, __func__) -#else /* defined(__CUDACC__) || defined(__MSVC__) */ - #define nppSafeCall(expr) ___nppSafeCall(expr, __FILE__, __LINE__) -#endif - - inline void ___nppSafeCall(int err, const char *file, const int line, const char *func = "") - { - if (err < 0) - { - String msg = cv::format("NPP API Call Error: %d", err); - cv::gpu::error(msg.c_str(), file, line, func); - } - } -} - -#endif // HAVE_CUDA - //////////////////////////////// Initialization & Info //////////////////////// #ifndef HAVE_CUDA int cv::gpu::getCudaEnabledDeviceCount() { return 0; } -void cv::gpu::setDevice(int) { throw_nogpu; } -int cv::gpu::getDevice() { throw_nogpu; return 0; } +void cv::gpu::setDevice(int) { throw_no_cuda(); } +int cv::gpu::getDevice() { throw_no_cuda(); return 0; } -void cv::gpu::resetDevice() { throw_nogpu; } +void cv::gpu::resetDevice() { throw_no_cuda(); } -bool cv::gpu::deviceSupports(FeatureSet) { throw_nogpu; return false; } +bool cv::gpu::deviceSupports(FeatureSet) { throw_no_cuda(); return false; } -bool cv::gpu::TargetArchs::builtWith(FeatureSet) { throw_nogpu; return false; } -bool cv::gpu::TargetArchs::has(int, int) { throw_nogpu; return false; } -bool cv::gpu::TargetArchs::hasPtx(int, int) { throw_nogpu; return false; } -bool cv::gpu::TargetArchs::hasBin(int, int) { throw_nogpu; return false; } -bool cv::gpu::TargetArchs::hasEqualOrLessPtx(int, int) { throw_nogpu; return false; } -bool cv::gpu::TargetArchs::hasEqualOrGreater(int, int) { throw_nogpu; return false; } -bool cv::gpu::TargetArchs::hasEqualOrGreaterPtx(int, int) { throw_nogpu; return false; } -bool cv::gpu::TargetArchs::hasEqualOrGreaterBin(int, int) { throw_nogpu; return false; } +bool cv::gpu::TargetArchs::builtWith(FeatureSet) { throw_no_cuda(); return false; } +bool cv::gpu::TargetArchs::has(int, int) { throw_no_cuda(); return false; } +bool cv::gpu::TargetArchs::hasPtx(int, int) { throw_no_cuda(); return false; } +bool cv::gpu::TargetArchs::hasBin(int, int) { throw_no_cuda(); return false; } +bool cv::gpu::TargetArchs::hasEqualOrLessPtx(int, int) { throw_no_cuda(); return false; } +bool cv::gpu::TargetArchs::hasEqualOrGreater(int, int) { throw_no_cuda(); return false; } +bool cv::gpu::TargetArchs::hasEqualOrGreaterPtx(int, int) { throw_no_cuda(); return false; } +bool cv::gpu::TargetArchs::hasEqualOrGreaterBin(int, int) { throw_no_cuda(); return false; } -size_t cv::gpu::DeviceInfo::sharedMemPerBlock() const { throw_nogpu; return 0; } -void cv::gpu::DeviceInfo::queryMemory(size_t&, size_t&) const { throw_nogpu; } -size_t cv::gpu::DeviceInfo::freeMemory() const { throw_nogpu; return 0; } -size_t cv::gpu::DeviceInfo::totalMemory() const { throw_nogpu; return 0; } -bool cv::gpu::DeviceInfo::supports(FeatureSet) const { throw_nogpu; return false; } -bool cv::gpu::DeviceInfo::isCompatible() const { throw_nogpu; return false; } -void cv::gpu::DeviceInfo::query() { throw_nogpu; } +size_t cv::gpu::DeviceInfo::sharedMemPerBlock() const { throw_no_cuda(); return 0; } +void cv::gpu::DeviceInfo::queryMemory(size_t&, size_t&) const { throw_no_cuda(); } +size_t cv::gpu::DeviceInfo::freeMemory() const { throw_no_cuda(); return 0; } +size_t cv::gpu::DeviceInfo::totalMemory() const { throw_no_cuda(); return 0; } +bool cv::gpu::DeviceInfo::supports(FeatureSet) const { throw_no_cuda(); return false; } +bool cv::gpu::DeviceInfo::isCompatible() const { throw_no_cuda(); return false; } +void cv::gpu::DeviceInfo::query() { throw_no_cuda(); } -void cv::gpu::printCudaDeviceInfo(int) { throw_nogpu; } -void cv::gpu::printShortCudaDeviceInfo(int) { throw_nogpu; } +void cv::gpu::printCudaDeviceInfo(int) { throw_no_cuda(); } +void cv::gpu::printShortCudaDeviceInfo(int) { throw_no_cuda(); } #else // HAVE_CUDA @@ -117,25 +91,25 @@ int cv::gpu::getCudaEnabledDeviceCount() if (error == cudaErrorNoDevice) return 0; - cudaSafeCall( error ); + cvCudaSafeCall( error ); return count; } void cv::gpu::setDevice(int device) { - cudaSafeCall( cudaSetDevice( device ) ); + cvCudaSafeCall( cudaSetDevice( device ) ); } int cv::gpu::getDevice() { int device; - cudaSafeCall( cudaGetDevice( &device ) ); + cvCudaSafeCall( cudaGetDevice( &device ) ); return device; } void cv::gpu::resetDevice() { - cudaSafeCall( cudaDeviceReset() ); + cvCudaSafeCall( cudaDeviceReset() ); } namespace @@ -328,7 +302,7 @@ namespace if (!props_[devID]) { props_[devID] = new cudaDeviceProp; - cudaSafeCall( cudaGetDeviceProperties(props_[devID], devID) ); + cvCudaSafeCall( cudaGetDeviceProperties(props_[devID], devID) ); } return props_[devID]; @@ -348,7 +322,7 @@ void cv::gpu::DeviceInfo::queryMemory(size_t& _totalMemory, size_t& _freeMemory) if (prevDeviceID != device_id_) setDevice(device_id_); - cudaSafeCall( cudaMemGetInfo(&_freeMemory, &_totalMemory) ); + cvCudaSafeCall( cudaMemGetInfo(&_freeMemory, &_totalMemory) ); if (prevDeviceID != device_id_) setDevice(prevDeviceID); @@ -434,8 +408,8 @@ void cv::gpu::printCudaDeviceInfo(int device) printf("Device count: %d\n", count); int driverVersion = 0, runtimeVersion = 0; - cudaSafeCall( cudaDriverGetVersion(&driverVersion) ); - cudaSafeCall( cudaRuntimeGetVersion(&runtimeVersion) ); + cvCudaSafeCall( cudaDriverGetVersion(&driverVersion) ); + cvCudaSafeCall( cudaRuntimeGetVersion(&runtimeVersion) ); const char *computeMode[] = { "Default (multiple host threads can use ::cudaSetDevice() with device simultaneously)", @@ -449,7 +423,7 @@ void cv::gpu::printCudaDeviceInfo(int device) for(int dev = beg; dev < end; ++dev) { cudaDeviceProp prop; - cudaSafeCall( cudaGetDeviceProperties(&prop, dev) ); + cvCudaSafeCall( cudaGetDeviceProperties(&prop, dev) ); printf("\nDevice %d: \"%s\"\n", dev, prop.name); printf(" CUDA Driver Version / Runtime Version %d.%d / %d.%d\n", driverVersion/1000, driverVersion%100, runtimeVersion/1000, runtimeVersion%100); @@ -511,13 +485,13 @@ void cv::gpu::printShortCudaDeviceInfo(int device) int end = valid ? device+1 : count; int driverVersion = 0, runtimeVersion = 0; - cudaSafeCall( cudaDriverGetVersion(&driverVersion) ); - cudaSafeCall( cudaRuntimeGetVersion(&runtimeVersion) ); + cvCudaSafeCall( cudaDriverGetVersion(&driverVersion) ); + cvCudaSafeCall( cudaRuntimeGetVersion(&runtimeVersion) ); for(int dev = beg; dev < end; ++dev) { cudaDeviceProp prop; - cudaSafeCall( cudaGetDeviceProperties(&prop, dev) ); + cvCudaSafeCall( cudaGetDeviceProperties(&prop, dev) ); const char *arch_str = prop.major < 2 ? " (not Fermi)" : ""; printf("Device %d: \"%s\" %.0fMb", dev, prop.name, (float)prop.totalGlobalMem/1048576.0f); @@ -846,18 +820,18 @@ namespace class EmptyFuncTable : public GpuFuncTable { public: - void copy(const Mat&, GpuMat&) const { throw_nogpu; } - void copy(const GpuMat&, Mat&) const { throw_nogpu; } - void copy(const GpuMat&, GpuMat&) const { throw_nogpu; } + void copy(const Mat&, GpuMat&) const { throw_no_cuda(); } + void copy(const GpuMat&, Mat&) const { throw_no_cuda(); } + void copy(const GpuMat&, GpuMat&) const { throw_no_cuda(); } - void copyWithMask(const GpuMat&, GpuMat&, const GpuMat&) const { throw_nogpu; } + void copyWithMask(const GpuMat&, GpuMat&, const GpuMat&) const { throw_no_cuda(); } - void convert(const GpuMat&, GpuMat&) const { throw_nogpu; } - void convert(const GpuMat&, GpuMat&, double, double) const { throw_nogpu; } + void convert(const GpuMat&, GpuMat&) const { throw_no_cuda(); } + void convert(const GpuMat&, GpuMat&, double, double) const { throw_no_cuda(); } - void setTo(GpuMat&, Scalar, const GpuMat&) const { throw_nogpu; } + void setTo(GpuMat&, Scalar, const GpuMat&) const { throw_no_cuda(); } - void mallocPitch(void**, size_t*, size_t, size_t) const { throw_nogpu; } + void mallocPitch(void**, size_t*, size_t, size_t) const { throw_no_cuda(); } void free(void*) const {} }; @@ -1009,7 +983,7 @@ namespace nppSafeCall( func(src.ptr(), static_cast(src.step), dst.ptr(), static_cast(dst.step), sz) ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } }; template::func_ptr func> struct NppCvt @@ -1024,7 +998,7 @@ namespace nppSafeCall( func(src.ptr(), static_cast(src.step), dst.ptr(), static_cast(dst.step), sz, NPP_RND_NEAR) ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } }; @@ -1066,7 +1040,7 @@ namespace nppSafeCall( func(nppS.val, src.ptr(), static_cast(src.step), sz) ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } }; template::func_ptr func> struct NppSet @@ -1083,7 +1057,7 @@ namespace nppSafeCall( func(nppS[0], src.ptr(), static_cast(src.step), sz) ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } }; @@ -1114,7 +1088,7 @@ namespace nppSafeCall( func(nppS.val, src.ptr(), static_cast(src.step), sz, mask.ptr(), static_cast(mask.step)) ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } }; template::func_ptr func> struct NppSetMask @@ -1131,7 +1105,7 @@ namespace nppSafeCall( func(nppS[0], src.ptr(), static_cast(src.step), sz, mask.ptr(), static_cast(mask.step)) ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } }; @@ -1157,7 +1131,7 @@ namespace nppSafeCall( func(src.ptr(), static_cast(src.step), dst.ptr(), static_cast(dst.step), sz, mask.ptr(), static_cast(mask.step)) ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } }; @@ -1174,15 +1148,15 @@ namespace public: void copy(const Mat& src, GpuMat& dst) const { - cudaSafeCall( cudaMemcpy2D(dst.data, dst.step, src.data, src.step, src.cols * src.elemSize(), src.rows, cudaMemcpyHostToDevice) ); + cvCudaSafeCall( cudaMemcpy2D(dst.data, dst.step, src.data, src.step, src.cols * src.elemSize(), src.rows, cudaMemcpyHostToDevice) ); } void copy(const GpuMat& src, Mat& dst) const { - cudaSafeCall( cudaMemcpy2D(dst.data, dst.step, src.data, src.step, src.cols * src.elemSize(), src.rows, cudaMemcpyDeviceToHost) ); + cvCudaSafeCall( cudaMemcpy2D(dst.data, dst.step, src.data, src.step, src.cols * src.elemSize(), src.rows, cudaMemcpyDeviceToHost) ); } void copy(const GpuMat& src, GpuMat& dst) const { - cudaSafeCall( cudaMemcpy2D(dst.data, dst.step, src.data, src.step, src.cols * src.elemSize(), src.rows, cudaMemcpyDeviceToDevice) ); + cvCudaSafeCall( cudaMemcpy2D(dst.data, dst.step, src.data, src.step, src.cols * src.elemSize(), src.rows, cudaMemcpyDeviceToDevice) ); } void copyWithMask(const GpuMat& src, GpuMat& dst, const GpuMat& mask) const @@ -1327,7 +1301,7 @@ namespace { if (s[0] == 0.0 && s[1] == 0.0 && s[2] == 0.0 && s[3] == 0.0) { - cudaSafeCall( cudaMemset2D(m.data, m.step, 0, m.cols * m.elemSize(), m.rows) ); + cvCudaSafeCall( cudaMemset2D(m.data, m.step, 0, m.cols * m.elemSize(), m.rows) ); return; } @@ -1338,7 +1312,7 @@ namespace if (cn == 1 || (cn == 2 && s[0] == s[1]) || (cn == 3 && s[0] == s[1] && s[0] == s[2]) || (cn == 4 && s[0] == s[1] && s[0] == s[2] && s[0] == s[3])) { int val = saturate_cast(s[0]); - cudaSafeCall( cudaMemset2D(m.data, m.step, val, m.cols * m.elemSize(), m.rows) ); + cvCudaSafeCall( cudaMemset2D(m.data, m.step, val, m.cols * m.elemSize(), m.rows) ); return; } } @@ -1393,7 +1367,7 @@ namespace void mallocPitch(void** devPtr, size_t* step, size_t width, size_t height) const { - cudaSafeCall( cudaMallocPitch(devPtr, step, width, height) ); + cvCudaSafeCall( cudaMallocPitch(devPtr, step, width, height) ); } void free(void* devPtr) const @@ -1551,18 +1525,117 @@ void cv::gpu::GpuMat::release() //////////////////////////////////////////////////////////////////////// // Error handling -void cv::gpu::error(const char *error_string, const char *file, const int line, const char *func) +#ifdef HAVE_CUDA + +namespace { - int code = CV_GpuApiCallError; + #define error_entry(entry) { entry, #entry } - if (std::uncaught_exception()) + struct ErrorEntry { - const char* errorStr = cvErrorStr(code); - const char* function = func ? func : "unknown function"; + int code; + const char* str; + }; - fprintf(stderr, "OpenCV Error: %s(%s) in %s, file %s, line %d", errorStr, error_string, function, file, line); - fflush(stderr); - } - else - cv::error( cv::Exception(code, error_string, func, file, line) ); + struct ErrorEntryComparer + { + int code; + ErrorEntryComparer(int code_) : code(code_) {} + bool operator()(const ErrorEntry& e) const { return e.code == code; } + }; + + const ErrorEntry npp_errors [] = + { + error_entry( NPP_NOT_SUPPORTED_MODE_ERROR ), + error_entry( NPP_ROUND_MODE_NOT_SUPPORTED_ERROR ), + error_entry( NPP_RESIZE_NO_OPERATION_ERROR ), + +#if defined (_MSC_VER) + error_entry( NPP_NOT_SUFFICIENT_COMPUTE_CAPABILITY ), +#endif + + error_entry( NPP_BAD_ARG_ERROR ), + error_entry( NPP_LUT_NUMBER_OF_LEVELS_ERROR ), + error_entry( NPP_TEXTURE_BIND_ERROR ), + error_entry( NPP_COEFF_ERROR ), + error_entry( NPP_RECT_ERROR ), + error_entry( NPP_QUAD_ERROR ), + error_entry( NPP_WRONG_INTERSECTION_ROI_ERROR ), + error_entry( NPP_NOT_EVEN_STEP_ERROR ), + error_entry( NPP_INTERPOLATION_ERROR ), + error_entry( NPP_RESIZE_FACTOR_ERROR ), + error_entry( NPP_HAAR_CLASSIFIER_PIXEL_MATCH_ERROR ), + error_entry( NPP_MEMFREE_ERR ), + error_entry( NPP_MEMSET_ERR ), + error_entry( NPP_MEMCPY_ERROR ), + error_entry( NPP_MEM_ALLOC_ERR ), + error_entry( NPP_HISTO_NUMBER_OF_LEVELS_ERROR ), + error_entry( NPP_MIRROR_FLIP_ERR ), + error_entry( NPP_INVALID_INPUT ), + error_entry( NPP_ALIGNMENT_ERROR ), + error_entry( NPP_STEP_ERROR ), + error_entry( NPP_SIZE_ERROR ), + error_entry( NPP_POINTER_ERROR ), + error_entry( NPP_NULL_POINTER_ERROR ), + error_entry( NPP_CUDA_KERNEL_EXECUTION_ERROR ), + error_entry( NPP_NOT_IMPLEMENTED_ERROR ), + error_entry( NPP_ERROR ), + error_entry( NPP_NO_ERROR ), + error_entry( NPP_SUCCESS ), + error_entry( NPP_WARNING ), + error_entry( NPP_WRONG_INTERSECTION_QUAD_WARNING ), + error_entry( NPP_MISALIGNED_DST_ROI_WARNING ), + error_entry( NPP_AFFINE_QUAD_INCORRECT_WARNING ), + error_entry( NPP_DOUBLE_SIZE_WARNING ), + error_entry( NPP_ODD_ROI_WARNING ) + }; + + const size_t npp_error_num = sizeof(npp_errors) / sizeof(npp_errors[0]); +} + +#endif + +String cv::gpu::getNppErrorMessage(int code) +{ +#ifndef HAVE_CUDA + (void) code; + return String(); +#else + size_t idx = std::find_if(npp_errors, npp_errors + npp_error_num, ErrorEntryComparer(code)) - npp_errors; + + const char* msg = (idx != npp_error_num) ? npp_errors[idx].str : "Unknown error code"; + String str = cv::format("%s [Code = %d]", msg, code); + + return str; +#endif +} + +bool cv::gpu::tryConvertToGpuBorderType(int cpuBorderType, int& gpuBorderType) +{ +#ifndef HAVE_CUDA + (void) cpuBorderType; + (void) gpuBorderType; + return false; +#else + switch (cpuBorderType) + { + case IPL_BORDER_REFLECT_101: + gpuBorderType = cv::gpu::BORDER_REFLECT101_GPU; + return true; + case IPL_BORDER_REPLICATE: + gpuBorderType = cv::gpu::BORDER_REPLICATE_GPU; + return true; + case IPL_BORDER_CONSTANT: + gpuBorderType = cv::gpu::BORDER_CONSTANT_GPU; + return true; + case IPL_BORDER_REFLECT: + gpuBorderType = cv::gpu::BORDER_REFLECT_GPU; + return true; + case IPL_BORDER_WRAP: + gpuBorderType = cv::gpu::BORDER_WRAP_GPU; + return true; + default: + return false; + }; +#endif } diff --git a/modules/core/src/matrix_operations.cpp b/modules/core/src/matrix_operations.cpp index 53764a168..ef09ef62a 100644 --- a/modules/core/src/matrix_operations.cpp +++ b/modules/core/src/matrix_operations.cpp @@ -41,7 +41,6 @@ //M*/ #include "precomp.hpp" -#include "opencv2/core/gpumat.hpp" using namespace cv; using namespace cv::gpu; @@ -181,30 +180,29 @@ bool cv::gpu::CudaMem::empty() const #if !defined (HAVE_CUDA) -void cv::gpu::registerPageLocked(Mat&) { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); } -void cv::gpu::unregisterPageLocked(Mat&) { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); } -void cv::gpu::CudaMem::create(int /*_rows*/, int /*_cols*/, int /*_type*/, int /*type_alloc*/) -{ CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); } -bool cv::gpu::CudaMem::canMapHostMemory() { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); return false; } -void cv::gpu::CudaMem::release() { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); } -GpuMat cv::gpu::CudaMem::createGpuMatHeader () const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); return GpuMat(); } +void cv::gpu::registerPageLocked(Mat&) { throw_no_cuda(); } +void cv::gpu::unregisterPageLocked(Mat&) { throw_no_cuda(); } +void cv::gpu::CudaMem::create(int, int, int, int) { throw_no_cuda(); } +bool cv::gpu::CudaMem::canMapHostMemory() { throw_no_cuda(); return false; } +void cv::gpu::CudaMem::release() { throw_no_cuda(); } +GpuMat cv::gpu::CudaMem::createGpuMatHeader () const { throw_no_cuda(); return GpuMat(); } #else /* !defined (HAVE_CUDA) */ void cv::gpu::registerPageLocked(Mat& m) { - cudaSafeCall( cudaHostRegister(m.ptr(), m.step * m.rows, cudaHostRegisterPortable) ); + cvCudaSafeCall( cudaHostRegister(m.ptr(), m.step * m.rows, cudaHostRegisterPortable) ); } void cv::gpu::unregisterPageLocked(Mat& m) { - cudaSafeCall( cudaHostUnregister(m.ptr()) ); + cvCudaSafeCall( cudaHostUnregister(m.ptr()) ); } bool cv::gpu::CudaMem::canMapHostMemory() { cudaDeviceProp prop; - cudaSafeCall( cudaGetDeviceProperties(&prop, getDevice()) ); + cvCudaSafeCall( cudaGetDeviceProperties(&prop, getDevice()) ); return (prop.canMapHostMemory != 0) ? true : false; } @@ -222,7 +220,7 @@ namespace void cv::gpu::CudaMem::create(int _rows, int _cols, int _type, int _alloc_type) { if (_alloc_type == ALLOC_ZEROCOPY && !canMapHostMemory()) - cv::gpu::error("ZeroCopy is not supported by current device", __FILE__, __LINE__); + CV_Error(cv::Error::GpuApiCallError, "ZeroCopy is not supported by current device"); _type &= Mat::TYPE_MASK; if( rows == _rows && cols == _cols && type() == _type && data ) @@ -239,7 +237,7 @@ void cv::gpu::CudaMem::create(int _rows, int _cols, int _type, int _alloc_type) if (_alloc_type == ALLOC_ZEROCOPY) { cudaDeviceProp prop; - cudaSafeCall( cudaGetDeviceProperties(&prop, getDevice()) ); + cvCudaSafeCall( cudaGetDeviceProperties(&prop, getDevice()) ); step = alignUpStep(step, prop.textureAlignment); } int64 _nettosize = (int64)step*rows; @@ -254,10 +252,10 @@ void cv::gpu::CudaMem::create(int _rows, int _cols, int _type, int _alloc_type) switch (alloc_type) { - case ALLOC_PAGE_LOCKED: cudaSafeCall( cudaHostAlloc( &ptr, datasize, cudaHostAllocDefault) ); break; - case ALLOC_ZEROCOPY: cudaSafeCall( cudaHostAlloc( &ptr, datasize, cudaHostAllocMapped) ); break; - case ALLOC_WRITE_COMBINED: cudaSafeCall( cudaHostAlloc( &ptr, datasize, cudaHostAllocWriteCombined) ); break; - default: cv::gpu::error("Invalid alloc type", __FILE__, __LINE__); + case ALLOC_PAGE_LOCKED: cvCudaSafeCall( cudaHostAlloc( &ptr, datasize, cudaHostAllocDefault) ); break; + case ALLOC_ZEROCOPY: cvCudaSafeCall( cudaHostAlloc( &ptr, datasize, cudaHostAllocMapped) ); break; + case ALLOC_WRITE_COMBINED: cvCudaSafeCall( cudaHostAlloc( &ptr, datasize, cudaHostAllocWriteCombined) ); break; + default: CV_Error(cv::Error::StsBadFlag, "Invalid alloc type"); } datastart = data = (uchar*)ptr; @@ -270,15 +268,13 @@ void cv::gpu::CudaMem::create(int _rows, int _cols, int _type, int _alloc_type) GpuMat cv::gpu::CudaMem::createGpuMatHeader () const { + CV_Assert( alloc_type == ALLOC_ZEROCOPY ); + GpuMat res; - if (alloc_type == ALLOC_ZEROCOPY) - { - void *pdev; - cudaSafeCall( cudaHostGetDevicePointer( &pdev, data, 0 ) ); - res = GpuMat(rows, cols, type(), pdev, step); - } - else - cv::gpu::error("Zero-copy is not supported or memory was allocated without zero-copy flag", __FILE__, __LINE__); + + void *pdev; + cvCudaSafeCall( cudaHostGetDevicePointer( &pdev, data, 0 ) ); + res = GpuMat(rows, cols, type(), pdev, step); return res; } @@ -287,7 +283,7 @@ void cv::gpu::CudaMem::release() { if( refcount && CV_XADD(refcount, -1) == 1 ) { - cudaSafeCall( cudaFreeHost(datastart ) ); + cvCudaSafeCall( cudaFreeHost(datastart ) ); fastFree(refcount); } data = datastart = dataend = 0; diff --git a/modules/core/src/opengl_interop.cpp b/modules/core/src/opengl_interop.cpp index cfed9fcec..19eabfa7d 100644 --- a/modules/core/src/opengl_interop.cpp +++ b/modules/core/src/opengl_interop.cpp @@ -41,16 +41,12 @@ //M*/ #include "precomp.hpp" -#include "opencv2/core/opengl.hpp" -#include "opencv2/core/gpumat.hpp" #ifdef HAVE_OPENGL - #include "gl_core_3_1.hpp" - - #ifdef HAVE_CUDA - #include - #include - #endif +# include "gl_core_3_1.hpp" +# ifdef HAVE_CUDA +# include +# endif #endif using namespace cv; @@ -59,15 +55,9 @@ using namespace cv::gpu; namespace { #ifndef HAVE_OPENGL - void throw_nogl() { CV_Error(CV_OpenGlNotSupported, "The library is compiled without OpenGL support"); } + void throw_no_ogl() { CV_Error(CV_OpenGlNotSupported, "The library is compiled without OpenGL support"); } #else - void throw_nogl() { CV_Error(CV_OpenGlApiCallError, "OpenGL context doesn't exist"); } - - #ifndef HAVE_CUDA - void throw_nocuda() { CV_Error(CV_GpuNotSupported, "The library is compiled without GPU support"); } - #else - void throw_nocuda() { CV_Error(CV_StsNotImplemented, "The called functionality is disabled for current build or platform"); } - #endif + void throw_no_ogl() { CV_Error(CV_OpenGlApiCallError, "OpenGL context doesn't exist"); } #endif bool checkError(const char* file, const int line, const char* func = 0) @@ -137,13 +127,13 @@ void cv::gpu::setGlDevice(int device) { #ifndef HAVE_OPENGL (void) device; - throw_nogl(); + throw_no_ogl(); #else #if !defined(HAVE_CUDA) || defined(CUDA_DISABLER) (void) device; - throw_nocuda(); + throw_no_cuda(); #else - cudaSafeCall( cudaGLSetGLDevice(device) ); + cvCudaSafeCall( cudaGLSetGLDevice(device) ); #endif #endif } @@ -194,7 +184,7 @@ namespace return; cudaGraphicsResource_t resource; - cudaSafeCall( cudaGraphicsGLRegisterBuffer(&resource, buffer, cudaGraphicsMapFlagsNone) ); + cvCudaSafeCall( cudaGraphicsGLRegisterBuffer(&resource, buffer, cudaGraphicsMapFlagsNone) ); release(); @@ -227,7 +217,7 @@ namespace CudaResource::GraphicsMapHolder::GraphicsMapHolder(cudaGraphicsResource_t* resource, cudaStream_t stream) : resource_(resource), stream_(stream) { if (resource_) - cudaSafeCall( cudaGraphicsMapResources(1, resource_, stream_) ); + cvCudaSafeCall( cudaGraphicsMapResources(1, resource_, stream_) ); } CudaResource::GraphicsMapHolder::~GraphicsMapHolder() @@ -250,14 +240,14 @@ namespace void* dst; size_t size; - cudaSafeCall( cudaGraphicsResourceGetMappedPointer(&dst, &size, resource_) ); + cvCudaSafeCall( cudaGraphicsResourceGetMappedPointer(&dst, &size, resource_) ); CV_DbgAssert( width * height == size ); if (stream == 0) - cudaSafeCall( cudaMemcpy2D(dst, width, src, spitch, width, height, cudaMemcpyDeviceToDevice) ); + cvCudaSafeCall( cudaMemcpy2D(dst, width, src, spitch, width, height, cudaMemcpyDeviceToDevice) ); else - cudaSafeCall( cudaMemcpy2DAsync(dst, width, src, spitch, width, height, cudaMemcpyDeviceToDevice, stream) ); + cvCudaSafeCall( cudaMemcpy2DAsync(dst, width, src, spitch, width, height, cudaMemcpyDeviceToDevice, stream) ); } void CudaResource::copyTo(void* dst, size_t dpitch, size_t width, size_t height, cudaStream_t stream) @@ -269,14 +259,14 @@ namespace void* src; size_t size; - cudaSafeCall( cudaGraphicsResourceGetMappedPointer(&src, &size, resource_) ); + cvCudaSafeCall( cudaGraphicsResourceGetMappedPointer(&src, &size, resource_) ); CV_DbgAssert( width * height == size ); if (stream == 0) - cudaSafeCall( cudaMemcpy2D(dst, dpitch, src, width, width, height, cudaMemcpyDeviceToDevice) ); + cvCudaSafeCall( cudaMemcpy2D(dst, dpitch, src, width, width, height, cudaMemcpyDeviceToDevice) ); else - cudaSafeCall( cudaMemcpy2DAsync(dst, dpitch, src, width, width, height, cudaMemcpyDeviceToDevice, stream) ); + cvCudaSafeCall( cudaMemcpy2DAsync(dst, dpitch, src, width, width, height, cudaMemcpyDeviceToDevice, stream) ); } void* CudaResource::map(cudaStream_t stream) @@ -287,7 +277,7 @@ namespace void* ptr; size_t size; - cudaSafeCall( cudaGraphicsResourceGetMappedPointer(&ptr, &size, resource_) ); + cvCudaSafeCall( cudaGraphicsResourceGetMappedPointer(&ptr, &size, resource_) ); h.reset(); @@ -476,7 +466,7 @@ void cv::ogl::Buffer::Impl::unmapHost() cv::ogl::Buffer::Buffer() : rows_(0), cols_(0), type_(0) { #ifndef HAVE_OPENGL - throw_nogl(); + throw_no_ogl(); #else impl_ = Impl::empty(); #endif @@ -490,7 +480,7 @@ cv::ogl::Buffer::Buffer(int arows, int acols, int atype, unsigned int abufId, bo (void) atype; (void) abufId; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else impl_ = new Impl(abufId, autoRelease); rows_ = arows; @@ -506,7 +496,7 @@ cv::ogl::Buffer::Buffer(Size asize, int atype, unsigned int abufId, bool autoRel (void) atype; (void) abufId; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else impl_ = new Impl(abufId, autoRelease); rows_ = asize.height; @@ -531,7 +521,7 @@ cv::ogl::Buffer::Buffer(InputArray arr, Target target, bool autoRelease) : rows_ (void) arr; (void) target; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else const int kind = arr.kind(); @@ -578,7 +568,7 @@ void cv::ogl::Buffer::create(int arows, int acols, int atype, Target target, boo (void) atype; (void) target; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else if (rows_ != arows || cols_ != acols || type_ != atype) { @@ -607,7 +597,7 @@ void cv::ogl::Buffer::setAutoRelease(bool flag) { #ifndef HAVE_OPENGL (void) flag; - throw_nogl(); + throw_no_ogl(); #else impl_->setAutoRelease(flag); #endif @@ -619,7 +609,7 @@ void cv::ogl::Buffer::copyFrom(InputArray arr, Target target, bool autoRelease) (void) arr; (void) target; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else const int kind = arr.kind(); @@ -647,7 +637,7 @@ void cv::ogl::Buffer::copyFrom(InputArray arr, Target target, bool autoRelease) case _InputArray::GPU_MAT: { #if !defined HAVE_CUDA || defined(CUDA_DISABLER) - throw_nocuda(); + throw_no_cuda(); #else GpuMat dmat = arr.getGpuMat(); impl_->copyFrom(dmat.data, dmat.step, dmat.cols * dmat.elemSize(), dmat.rows); @@ -672,7 +662,7 @@ void cv::ogl::Buffer::copyTo(OutputArray arr, Target target, bool autoRelease) c (void) arr; (void) target; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else const int kind = arr.kind(); @@ -693,7 +683,7 @@ void cv::ogl::Buffer::copyTo(OutputArray arr, Target target, bool autoRelease) c case _InputArray::GPU_MAT: { #if !defined HAVE_CUDA || defined(CUDA_DISABLER) - throw_nocuda(); + throw_no_cuda(); #else GpuMat& dmat = arr.getGpuMatRef(); dmat.create(rows_, cols_, type_); @@ -719,7 +709,7 @@ cv::ogl::Buffer cv::ogl::Buffer::clone(Target target, bool autoRelease) const #ifndef HAVE_OPENGL (void) target; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); return cv::ogl::Buffer(); #else ogl::Buffer buf; @@ -732,7 +722,7 @@ void cv::ogl::Buffer::bind(Target target) const { #ifndef HAVE_OPENGL (void) target; - throw_nogl(); + throw_no_ogl(); #else impl_->bind(target); #endif @@ -742,7 +732,7 @@ void cv::ogl::Buffer::unbind(Target target) { #ifndef HAVE_OPENGL (void) target; - throw_nogl(); + throw_no_ogl(); #else gl::BindBuffer(target, 0); CV_CheckGlError(); @@ -753,7 +743,7 @@ Mat cv::ogl::Buffer::mapHost(Access access) { #ifndef HAVE_OPENGL (void) access; - throw_nogl(); + throw_no_ogl(); return Mat(); #else return Mat(rows_, cols_, type_, impl_->mapHost(access)); @@ -763,7 +753,7 @@ Mat cv::ogl::Buffer::mapHost(Access access) void cv::ogl::Buffer::unmapHost() { #ifndef HAVE_OPENGL - throw_nogl(); + throw_no_ogl(); #else return impl_->unmapHost(); #endif @@ -772,11 +762,11 @@ void cv::ogl::Buffer::unmapHost() GpuMat cv::ogl::Buffer::mapDevice() { #ifndef HAVE_OPENGL - throw_nogl(); + throw_no_ogl(); return GpuMat(); #else #if !defined HAVE_CUDA || defined(CUDA_DISABLER) - throw_nocuda(); + throw_no_cuda(); return GpuMat(); #else return GpuMat(rows_, cols_, type_, impl_->mapDevice()); @@ -787,10 +777,10 @@ GpuMat cv::ogl::Buffer::mapDevice() void cv::ogl::Buffer::unmapDevice() { #ifndef HAVE_OPENGL - throw_nogl(); + throw_no_ogl(); #else #if !defined HAVE_CUDA || defined(CUDA_DISABLER) - throw_nocuda(); + throw_no_cuda(); #else impl_->unmapDevice(); #endif @@ -800,7 +790,7 @@ void cv::ogl::Buffer::unmapDevice() unsigned int cv::ogl::Buffer::bufId() const { #ifndef HAVE_OPENGL - throw_nogl(); + throw_no_ogl(); return 0; #else return impl_->bufId(); @@ -926,7 +916,7 @@ void cv::ogl::Texture2D::Impl::bind() const cv::ogl::Texture2D::Texture2D() : rows_(0), cols_(0), format_(NONE) { #ifndef HAVE_OPENGL - throw_nogl(); + throw_no_ogl(); #else impl_ = Impl::empty(); #endif @@ -940,7 +930,7 @@ cv::ogl::Texture2D::Texture2D(int arows, int acols, Format aformat, unsigned int (void) aformat; (void) atexId; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else impl_ = new Impl(atexId, autoRelease); rows_ = arows; @@ -956,7 +946,7 @@ cv::ogl::Texture2D::Texture2D(Size asize, Format aformat, unsigned int atexId, b (void) aformat; (void) atexId; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else impl_ = new Impl(atexId, autoRelease); rows_ = asize.height; @@ -980,7 +970,7 @@ cv::ogl::Texture2D::Texture2D(InputArray arr, bool autoRelease) : rows_(0), cols #ifndef HAVE_OPENGL (void) arr; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else const int kind = arr.kind(); @@ -1016,7 +1006,7 @@ cv::ogl::Texture2D::Texture2D(InputArray arr, bool autoRelease) : rows_(0), cols case _InputArray::GPU_MAT: { #if !defined HAVE_CUDA || defined(CUDA_DISABLER) - throw_nocuda(); + throw_no_cuda(); #else GpuMat dmat = arr.getGpuMat(); ogl::Buffer buf(dmat, ogl::Buffer::PIXEL_UNPACK_BUFFER); @@ -1051,7 +1041,7 @@ void cv::ogl::Texture2D::create(int arows, int acols, Format aformat, bool autoR (void) acols; (void) aformat; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else if (rows_ != arows || cols_ != acols || format_ != aformat) { @@ -1080,7 +1070,7 @@ void cv::ogl::Texture2D::setAutoRelease(bool flag) { #ifndef HAVE_OPENGL (void) flag; - throw_nogl(); + throw_no_ogl(); #else impl_->setAutoRelease(flag); #endif @@ -1091,7 +1081,7 @@ void cv::ogl::Texture2D::copyFrom(InputArray arr, bool autoRelease) #ifndef HAVE_OPENGL (void) arr; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else const int kind = arr.kind(); @@ -1129,7 +1119,7 @@ void cv::ogl::Texture2D::copyFrom(InputArray arr, bool autoRelease) case _InputArray::GPU_MAT: { #if !defined HAVE_CUDA || defined(CUDA_DISABLER) - throw_nocuda(); + throw_no_cuda(); #else GpuMat dmat = arr.getGpuMat(); ogl::Buffer buf(dmat, ogl::Buffer::PIXEL_UNPACK_BUFFER); @@ -1158,7 +1148,7 @@ void cv::ogl::Texture2D::copyTo(OutputArray arr, int ddepth, bool autoRelease) c (void) arr; (void) ddepth; (void) autoRelease; - throw_nogl(); + throw_no_ogl(); #else const int kind = arr.kind(); @@ -1180,7 +1170,7 @@ void cv::ogl::Texture2D::copyTo(OutputArray arr, int ddepth, bool autoRelease) c case _InputArray::GPU_MAT: { #if !defined HAVE_CUDA || defined(CUDA_DISABLER) - throw_nocuda(); + throw_no_cuda(); #else ogl::Buffer buf(rows_, cols_, CV_MAKE_TYPE(ddepth, cn), ogl::Buffer::PIXEL_PACK_BUFFER); buf.bind(ogl::Buffer::PIXEL_PACK_BUFFER); @@ -1207,7 +1197,7 @@ void cv::ogl::Texture2D::copyTo(OutputArray arr, int ddepth, bool autoRelease) c void cv::ogl::Texture2D::bind() const { #ifndef HAVE_OPENGL - throw_nogl(); + throw_no_ogl(); #else impl_->bind(); #endif @@ -1216,7 +1206,7 @@ void cv::ogl::Texture2D::bind() const unsigned int cv::ogl::Texture2D::texId() const { #ifndef HAVE_OPENGL - throw_nogl(); + throw_no_ogl(); return 0; #else return impl_->texId(); @@ -1331,7 +1321,7 @@ void cv::ogl::Arrays::setAutoRelease(bool flag) void cv::ogl::Arrays::bind() const { #ifndef HAVE_OPENGL - throw_nogl(); + throw_no_ogl(); #else CV_Assert( texCoord_.empty() || texCoord_.size().area() == size_ ); CV_Assert( normal_.empty() || normal_.size().area() == size_ ); @@ -1416,7 +1406,7 @@ void cv::ogl::render(const ogl::Texture2D& tex, Rect_ wndRect, Rect_ #include @@ -64,37 +66,6 @@ #define GET_OPTIMIZED(func) (func) #endif -#ifdef HAVE_CUDA - -# include -# include - -# define CUDART_MINIMUM_REQUIRED_VERSION 4020 -# define NPP_MINIMUM_REQUIRED_VERSION 4200 - -# if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION) -# error "Insufficient Cuda Runtime library version, please update it." -# endif - -# if (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION) -# error "Insufficient NPP version, please update it." -# endif - -# if defined(__GNUC__) -# define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__, __func__) -# else -# define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__) -# endif - -static inline void ___cudaSafeCall(cudaError_t err, const char *file, const int line, const char *func = "") -{ - if (cudaSuccess != err) cv::gpu::error(cudaGetErrorString(err), file, line, func); -} - -#else -# define cudaSafeCall(expr) -#endif //HAVE_CUDA - namespace cv { diff --git a/modules/gpu/perf/perf_precomp.hpp b/modules/gpu/perf/perf_precomp.hpp index 56227223a..40930f7c0 100644 --- a/modules/gpu/perf/perf_precomp.hpp +++ b/modules/gpu/perf/perf_precomp.hpp @@ -54,10 +54,6 @@ #include #include -#ifdef HAVE_CUDA -#include -#endif - #include "opencv2/ts.hpp" #include "opencv2/ts/gpu_perf.hpp" @@ -70,7 +66,7 @@ #include "opencv2/legacy.hpp" #include "opencv2/photo.hpp" -#include "opencv2/core/private.hpp" +#include "opencv2/core/gpu_private.hpp" #ifdef GTEST_CREATE_SHARED_LIBRARY #error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined diff --git a/modules/gpu/src/arithm.cpp b/modules/gpu/src/arithm.cpp index cefc29f20..8f9113991 100644 --- a/modules/gpu/src/arithm.cpp +++ b/modules/gpu/src/arithm.cpp @@ -47,19 +47,19 @@ using namespace cv::gpu; #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) -void cv::gpu::gemm(const GpuMat&, const GpuMat&, double, const GpuMat&, double, GpuMat&, int, Stream&) { throw_nogpu(); } -void cv::gpu::transpose(const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } -void cv::gpu::flip(const GpuMat&, GpuMat&, int, Stream&) { throw_nogpu(); } -void cv::gpu::LUT(const GpuMat&, const Mat&, GpuMat&, Stream&) { throw_nogpu(); } -void cv::gpu::magnitude(const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } -void cv::gpu::magnitudeSqr(const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } -void cv::gpu::magnitude(const GpuMat&, const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } -void cv::gpu::magnitudeSqr(const GpuMat&, const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } -void cv::gpu::phase(const GpuMat&, const GpuMat&, GpuMat&, bool, Stream&) { throw_nogpu(); } -void cv::gpu::cartToPolar(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, bool, Stream&) { throw_nogpu(); } -void cv::gpu::polarToCart(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, bool, Stream&) { throw_nogpu(); } -void cv::gpu::normalize(const GpuMat&, GpuMat&, double, double, int, int, const GpuMat&) { throw_nogpu(); } -void cv::gpu::normalize(const GpuMat&, GpuMat&, double, double, int, int, const GpuMat&, GpuMat&, GpuMat&) { throw_nogpu(); } +void cv::gpu::gemm(const GpuMat&, const GpuMat&, double, const GpuMat&, double, GpuMat&, int, Stream&) { throw_no_cuda(); } +void cv::gpu::transpose(const GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); } +void cv::gpu::flip(const GpuMat&, GpuMat&, int, Stream&) { throw_no_cuda(); } +void cv::gpu::LUT(const GpuMat&, const Mat&, GpuMat&, Stream&) { throw_no_cuda(); } +void cv::gpu::magnitude(const GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); } +void cv::gpu::magnitudeSqr(const GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); } +void cv::gpu::magnitude(const GpuMat&, const GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); } +void cv::gpu::magnitudeSqr(const GpuMat&, const GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); } +void cv::gpu::phase(const GpuMat&, const GpuMat&, GpuMat&, bool, Stream&) { throw_no_cuda(); } +void cv::gpu::cartToPolar(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, bool, Stream&) { throw_no_cuda(); } +void cv::gpu::polarToCart(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, bool, Stream&) { throw_no_cuda(); } +void cv::gpu::normalize(const GpuMat&, GpuMat&, double, double, int, int, const GpuMat&) { throw_no_cuda(); } +void cv::gpu::normalize(const GpuMat&, GpuMat&, double, double, int, int, const GpuMat&, GpuMat&, GpuMat&) { throw_no_cuda(); } #else /* !defined (HAVE_CUDA) */ @@ -246,7 +246,7 @@ void cv::gpu::transpose(const GpuMat& src, GpuMat& dst, Stream& s) } if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } //////////////////////////////////////////////////////////////////////// @@ -287,7 +287,7 @@ namespace (flipCode == 0 ? NPP_HORIZONTAL_AXIS : (flipCode > 0 ? NPP_VERTICAL_AXIS : NPP_BOTH_AXIS))) ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } }; } @@ -402,7 +402,7 @@ void cv::gpu::LUT(const GpuMat& src, const Mat& lut, GpuMat& dst, Stream& s) } if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } //////////////////////////////////////////////////////////////////////// @@ -427,7 +427,7 @@ namespace nppSafeCall( func(src.ptr(), static_cast(src.step), dst.ptr(), static_cast(dst.step), sz) ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } } diff --git a/modules/gpu/src/bgfg_gmg.cpp b/modules/gpu/src/bgfg_gmg.cpp index b474823a5..79777fcb7 100644 --- a/modules/gpu/src/bgfg_gmg.cpp +++ b/modules/gpu/src/bgfg_gmg.cpp @@ -44,9 +44,9 @@ #if !defined HAVE_CUDA || defined(CUDA_DISABLER) -cv::gpu::GMG_GPU::GMG_GPU() { throw_nogpu(); } -void cv::gpu::GMG_GPU::initialize(cv::Size, float, float) { throw_nogpu(); } -void cv::gpu::GMG_GPU::operator ()(const cv::gpu::GpuMat&, cv::gpu::GpuMat&, float, cv::gpu::Stream&) { throw_nogpu(); } +cv::gpu::GMG_GPU::GMG_GPU() { throw_no_cuda(); } +void cv::gpu::GMG_GPU::initialize(cv::Size, float, float) { throw_no_cuda(); } +void cv::gpu::GMG_GPU::operator ()(const cv::gpu::GpuMat&, cv::gpu::GpuMat&, float, cv::gpu::Stream&) { throw_no_cuda(); } void cv::gpu::GMG_GPU::release() {} #else diff --git a/modules/gpu/src/bgfg_mog.cpp b/modules/gpu/src/bgfg_mog.cpp index 13db07911..78cd9a4a0 100644 --- a/modules/gpu/src/bgfg_mog.cpp +++ b/modules/gpu/src/bgfg_mog.cpp @@ -44,16 +44,16 @@ #if !defined HAVE_CUDA || defined(CUDA_DISABLER) -cv::gpu::MOG_GPU::MOG_GPU(int) { throw_nogpu(); } -void cv::gpu::MOG_GPU::initialize(cv::Size, int) { throw_nogpu(); } -void cv::gpu::MOG_GPU::operator()(const cv::gpu::GpuMat&, cv::gpu::GpuMat&, float, Stream&) { throw_nogpu(); } -void cv::gpu::MOG_GPU::getBackgroundImage(GpuMat&, Stream&) const { throw_nogpu(); } +cv::gpu::MOG_GPU::MOG_GPU(int) { throw_no_cuda(); } +void cv::gpu::MOG_GPU::initialize(cv::Size, int) { throw_no_cuda(); } +void cv::gpu::MOG_GPU::operator()(const cv::gpu::GpuMat&, cv::gpu::GpuMat&, float, Stream&) { throw_no_cuda(); } +void cv::gpu::MOG_GPU::getBackgroundImage(GpuMat&, Stream&) const { throw_no_cuda(); } void cv::gpu::MOG_GPU::release() {} -cv::gpu::MOG2_GPU::MOG2_GPU(int) { throw_nogpu(); } -void cv::gpu::MOG2_GPU::initialize(cv::Size, int) { throw_nogpu(); } -void cv::gpu::MOG2_GPU::operator()(const GpuMat&, GpuMat&, float, Stream&) { throw_nogpu(); } -void cv::gpu::MOG2_GPU::getBackgroundImage(GpuMat&, Stream&) const { throw_nogpu(); } +cv::gpu::MOG2_GPU::MOG2_GPU(int) { throw_no_cuda(); } +void cv::gpu::MOG2_GPU::initialize(cv::Size, int) { throw_no_cuda(); } +void cv::gpu::MOG2_GPU::operator()(const GpuMat&, GpuMat&, float, Stream&) { throw_no_cuda(); } +void cv::gpu::MOG2_GPU::getBackgroundImage(GpuMat&, Stream&) const { throw_no_cuda(); } void cv::gpu::MOG2_GPU::release() {} #else diff --git a/modules/gpu/src/bilateral_filter.cpp b/modules/gpu/src/bilateral_filter.cpp index 41640a556..41b6275f2 100644 --- a/modules/gpu/src/bilateral_filter.cpp +++ b/modules/gpu/src/bilateral_filter.cpp @@ -47,10 +47,10 @@ using namespace cv::gpu; #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) -cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter(int, int, int) { throw_nogpu(); } -cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter(int, int, int, float, float, float) { throw_nogpu(); } +cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter(int, int, int) { throw_no_cuda(); } +cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter(int, int, int, float, float, float) { throw_no_cuda(); } -void cv::gpu::DisparityBilateralFilter::operator()(const GpuMat&, const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } +void cv::gpu::DisparityBilateralFilter::operator()(const GpuMat&, const GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); } #else /* !defined (HAVE_CUDA) */ diff --git a/modules/gpu/src/blend.cpp b/modules/gpu/src/blend.cpp index 08193386b..97469f6b8 100644 --- a/modules/gpu/src/blend.cpp +++ b/modules/gpu/src/blend.cpp @@ -47,7 +47,7 @@ using namespace cv::gpu; #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) -void cv::gpu::blendLinear(const GpuMat&, const GpuMat&, const GpuMat&, const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } +void cv::gpu::blendLinear(const GpuMat&, const GpuMat&, const GpuMat&, const GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); } #else diff --git a/modules/gpu/src/brute_force_matcher.cpp b/modules/gpu/src/brute_force_matcher.cpp index 1f9c11cd0..8fd4e11fd 100644 --- a/modules/gpu/src/brute_force_matcher.cpp +++ b/modules/gpu/src/brute_force_matcher.cpp @@ -47,37 +47,37 @@ using namespace cv::gpu; #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) -cv::gpu::BFMatcher_GPU::BFMatcher_GPU(int) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::add(const std::vector&) { throw_nogpu(); } -const std::vector& cv::gpu::BFMatcher_GPU::getTrainDescriptors() const { throw_nogpu(); return trainDescCollection; } -void cv::gpu::BFMatcher_GPU::clear() { throw_nogpu(); } -bool cv::gpu::BFMatcher_GPU::empty() const { throw_nogpu(); return true; } -bool cv::gpu::BFMatcher_GPU::isMaskSupported() const { throw_nogpu(); return true; } -void cv::gpu::BFMatcher_GPU::matchSingle(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, const GpuMat&, Stream&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat&, const GpuMat&, std::vector&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::matchConvert(const Mat&, const Mat&, std::vector&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::match(const GpuMat&, const GpuMat&, std::vector&, const GpuMat&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::makeGpuCollection(GpuMat&, GpuMat&, const std::vector&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::matchCollection(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, const GpuMat&, Stream&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat&, const GpuMat&, const GpuMat&, std::vector&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::matchConvert(const Mat&, const Mat&, const Mat&, std::vector&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::match(const GpuMat&, std::vector&, const std::vector&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::knnMatchSingle(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, int, const GpuMat&, Stream&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::knnMatchDownload(const GpuMat&, const GpuMat&, std::vector< std::vector >&, bool) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::knnMatchConvert(const Mat&, const Mat&, std::vector< std::vector >&, bool) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat&, const GpuMat&, std::vector< std::vector >&, int, const GpuMat&, bool) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::knnMatch2Collection(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, const GpuMat&, Stream&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::knnMatch2Download(const GpuMat&, const GpuMat&, const GpuMat&, std::vector< std::vector >&, bool) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::knnMatch2Convert(const Mat&, const Mat&, const Mat&, std::vector< std::vector >&, bool) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat&, std::vector< std::vector >&, int, const std::vector&, bool) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::radiusMatchSingle(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, float, const GpuMat&, Stream&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat&, const GpuMat&, const GpuMat&, std::vector< std::vector >&, bool) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat&, const Mat&, const Mat&, std::vector< std::vector >&, bool) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat&, const GpuMat&, std::vector< std::vector >&, float, const GpuMat&, bool) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::radiusMatchCollection(const GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, float, const std::vector&, Stream&) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat&, const GpuMat&, const GpuMat&, const GpuMat&, std::vector< std::vector >&, bool) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat&, const Mat&, const Mat&, const Mat&, std::vector< std::vector >&, bool) { throw_nogpu(); } -void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat&, std::vector< std::vector >&, float, const std::vector&, bool) { throw_nogpu(); } +cv::gpu::BFMatcher_GPU::BFMatcher_GPU(int) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::add(const std::vector&) { throw_no_cuda(); } +const std::vector& cv::gpu::BFMatcher_GPU::getTrainDescriptors() const { throw_no_cuda(); return trainDescCollection; } +void cv::gpu::BFMatcher_GPU::clear() { throw_no_cuda(); } +bool cv::gpu::BFMatcher_GPU::empty() const { throw_no_cuda(); return true; } +bool cv::gpu::BFMatcher_GPU::isMaskSupported() const { throw_no_cuda(); return true; } +void cv::gpu::BFMatcher_GPU::matchSingle(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, const GpuMat&, Stream&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat&, const GpuMat&, std::vector&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::matchConvert(const Mat&, const Mat&, std::vector&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::match(const GpuMat&, const GpuMat&, std::vector&, const GpuMat&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::makeGpuCollection(GpuMat&, GpuMat&, const std::vector&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::matchCollection(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, const GpuMat&, Stream&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat&, const GpuMat&, const GpuMat&, std::vector&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::matchConvert(const Mat&, const Mat&, const Mat&, std::vector&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::match(const GpuMat&, std::vector&, const std::vector&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::knnMatchSingle(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, int, const GpuMat&, Stream&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::knnMatchDownload(const GpuMat&, const GpuMat&, std::vector< std::vector >&, bool) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::knnMatchConvert(const Mat&, const Mat&, std::vector< std::vector >&, bool) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat&, const GpuMat&, std::vector< std::vector >&, int, const GpuMat&, bool) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::knnMatch2Collection(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, const GpuMat&, Stream&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::knnMatch2Download(const GpuMat&, const GpuMat&, const GpuMat&, std::vector< std::vector >&, bool) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::knnMatch2Convert(const Mat&, const Mat&, const Mat&, std::vector< std::vector >&, bool) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat&, std::vector< std::vector >&, int, const std::vector&, bool) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::radiusMatchSingle(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, float, const GpuMat&, Stream&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat&, const GpuMat&, const GpuMat&, std::vector< std::vector >&, bool) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat&, const Mat&, const Mat&, std::vector< std::vector >&, bool) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat&, const GpuMat&, std::vector< std::vector >&, float, const GpuMat&, bool) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::radiusMatchCollection(const GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, float, const std::vector&, Stream&) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat&, const GpuMat&, const GpuMat&, const GpuMat&, std::vector< std::vector >&, bool) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat&, const Mat&, const Mat&, const Mat&, std::vector< std::vector >&, bool) { throw_no_cuda(); } +void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat&, std::vector< std::vector >&, float, const std::vector&, bool) { throw_no_cuda(); } #else /* !defined (HAVE_CUDA) */ diff --git a/modules/gpu/src/calib3d.cpp b/modules/gpu/src/calib3d.cpp index 78408c73b..8c8f753b6 100644 --- a/modules/gpu/src/calib3d.cpp +++ b/modules/gpu/src/calib3d.cpp @@ -47,11 +47,11 @@ using namespace cv::gpu; #if !defined HAVE_CUDA || defined(CUDA_DISABLER) -void cv::gpu::transformPoints(const GpuMat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_nogpu(); } +void cv::gpu::transformPoints(const GpuMat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_no_cuda(); } -void cv::gpu::projectPoints(const GpuMat&, const Mat&, const Mat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_nogpu(); } +void cv::gpu::projectPoints(const GpuMat&, const Mat&, const Mat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_no_cuda(); } -void cv::gpu::solvePnPRansac(const Mat&, const Mat&, const Mat&, const Mat&, Mat&, Mat&, bool, int, float, int, std::vector*) { throw_nogpu(); } +void cv::gpu::solvePnPRansac(const Mat&, const Mat&, const Mat&, const Mat&, Mat&, Mat&, bool, int, float, int, std::vector*) { throw_no_cuda(); } #else diff --git a/modules/gpu/src/cascadeclassifier.cpp b/modules/gpu/src/cascadeclassifier.cpp index 3ba8368d1..4ccc86a69 100644 --- a/modules/gpu/src/cascadeclassifier.cpp +++ b/modules/gpu/src/cascadeclassifier.cpp @@ -49,15 +49,15 @@ using namespace cv::gpu; #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) -cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU() { throw_nogpu(); } -cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const String&) { throw_nogpu(); } -cv::gpu::CascadeClassifier_GPU::~CascadeClassifier_GPU() { throw_nogpu(); } -bool cv::gpu::CascadeClassifier_GPU::empty() const { throw_nogpu(); return true; } -bool cv::gpu::CascadeClassifier_GPU::load(const String&) { throw_nogpu(); return true; } -Size cv::gpu::CascadeClassifier_GPU::getClassifierSize() const { throw_nogpu(); return Size();} -void cv::gpu::CascadeClassifier_GPU::release() { throw_nogpu(); } -int cv::gpu::CascadeClassifier_GPU::detectMultiScale( const GpuMat&, GpuMat&, double, int, Size) {throw_nogpu(); return -1;} -int cv::gpu::CascadeClassifier_GPU::detectMultiScale( const GpuMat&, GpuMat&, Size, Size, double, int) {throw_nogpu(); return -1;} +cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU() { throw_no_cuda(); } +cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const String&) { throw_no_cuda(); } +cv::gpu::CascadeClassifier_GPU::~CascadeClassifier_GPU() { throw_no_cuda(); } +bool cv::gpu::CascadeClassifier_GPU::empty() const { throw_no_cuda(); return true; } +bool cv::gpu::CascadeClassifier_GPU::load(const String&) { throw_no_cuda(); return true; } +Size cv::gpu::CascadeClassifier_GPU::getClassifierSize() const { throw_no_cuda(); return Size();} +void cv::gpu::CascadeClassifier_GPU::release() { throw_no_cuda(); } +int cv::gpu::CascadeClassifier_GPU::detectMultiScale( const GpuMat&, GpuMat&, double, int, Size) {throw_no_cuda(); return -1;} +int cv::gpu::CascadeClassifier_GPU::detectMultiScale( const GpuMat&, GpuMat&, Size, Size, double, int) {throw_no_cuda(); return -1;} #else @@ -403,7 +403,7 @@ public: unsigned int classified = 0; GpuMat dclassified(1, 1, CV_32S); - cudaSafeCall( cudaMemcpy(dclassified.ptr(), &classified, sizeof(int), cudaMemcpyHostToDevice) ); + cvCudaSafeCall( cudaMemcpy(dclassified.ptr(), &classified, sizeof(int), cudaMemcpyHostToDevice) ); PyrLavel level(0, 1.0f, image.size(), NxM, minObjectSize); @@ -448,11 +448,11 @@ public: if (groupThreshold <= 0 || objects.empty()) return 0; - cudaSafeCall( cudaMemcpy(&classified, dclassified.ptr(), sizeof(int), cudaMemcpyDeviceToHost) ); + cvCudaSafeCall( cudaMemcpy(&classified, dclassified.ptr(), sizeof(int), cudaMemcpyDeviceToHost) ); cuda::lbp::connectedConmonents(candidates, classified, objects, groupThreshold, grouping_eps, dclassified.ptr()); - cudaSafeCall( cudaMemcpy(&classified, dclassified.ptr(), sizeof(int), cudaMemcpyDeviceToHost) ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaMemcpy(&classified, dclassified.ptr(), sizeof(int), cudaMemcpyDeviceToHost) ); + cvCudaSafeCall( cudaDeviceSynchronize() ); return classified; } @@ -481,7 +481,7 @@ private: roiSize.height = frame.height; cudaDeviceProp prop; - cudaSafeCall( cudaGetDeviceProperties(&prop, cv::gpu::getDevice()) ); + cvCudaSafeCall( cudaGetDeviceProperties(&prop, cv::gpu::getDevice()) ); Ncv32u bufSize; ncvSafeCall( nppiStIntegralGetSize_8u32u(roiSize, &bufSize, prop) ); diff --git a/modules/gpu/src/color.cpp b/modules/gpu/src/color.cpp index 9f6ca2598..33d57360c 100644 --- a/modules/gpu/src/color.cpp +++ b/modules/gpu/src/color.cpp @@ -47,10 +47,10 @@ using namespace cv::gpu; #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) -void cv::gpu::cvtColor(const GpuMat&, GpuMat&, int, int, Stream&) { throw_nogpu(); } -void cv::gpu::demosaicing(const GpuMat&, GpuMat&, int, int, Stream&) { throw_nogpu(); } -void cv::gpu::swapChannels(GpuMat&, const int[], Stream&) { throw_nogpu(); } -void cv::gpu::gammaCorrection(const GpuMat&, GpuMat&, bool, Stream&) { throw_nogpu(); } +void cv::gpu::cvtColor(const GpuMat&, GpuMat&, int, int, Stream&) { throw_no_cuda(); } +void cv::gpu::demosaicing(const GpuMat&, GpuMat&, int, int, Stream&) { throw_no_cuda(); } +void cv::gpu::swapChannels(GpuMat&, const int[], Stream&) { throw_no_cuda(); } +void cv::gpu::gammaCorrection(const GpuMat&, GpuMat&, bool, Stream&) { throw_no_cuda(); } #else /* !defined (HAVE_CUDA) */ @@ -1600,7 +1600,7 @@ namespace nppSafeCall( nppiAlphaPremul_16u_AC4R(src.ptr(), static_cast(src.step), dst.ptr(), static_cast(dst.step), oSizeROI) ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); #endif } @@ -1942,7 +1942,7 @@ void cv::gpu::swapChannels(GpuMat& image, const int dstOrder[4], Stream& s) nppSafeCall( nppiSwapChannels_8u_C4IR(image.ptr(), static_cast(image.step), sz, dstOrder) ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } void cv::gpu::gammaCorrection(const GpuMat& src, GpuMat& dst, bool forward, Stream& stream) diff --git a/modules/gpu/src/cuda/NV12ToARGB.cu b/modules/gpu/src/cuda/NV12ToARGB.cu index 4110dbc2a..cccf6eb46 100644 --- a/modules/gpu/src/cuda/NV12ToARGB.cu +++ b/modules/gpu/src/cuda/NV12ToARGB.cu @@ -60,7 +60,7 @@ namespace cv { namespace gpu { namespace cuda { void loadHueCSC(float hueCSC[9]) { - cudaSafeCall( cudaMemcpyToSymbol(constHueColorSpaceMat, hueCSC, 9 * sizeof(float)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(constHueColorSpaceMat, hueCSC, 9 * sizeof(float)) ); } __device__ void YUV2RGB(const uint* yuvi, float* red, float* green, float* blue) @@ -190,10 +190,10 @@ namespace cv { namespace gpu { namespace cuda { NV12ToARGB<<>>(decodedFrame.data, decodedFrame.step, interopFrame.data, interopFrame.step, interopFrame.cols, interopFrame.rows); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } } }}} diff --git a/modules/gpu/src/cuda/bf_knnmatch.cu b/modules/gpu/src/cuda/bf_knnmatch.cu index 629ac694a..f03b1c499 100644 --- a/modules/gpu/src/cuda/bf_knnmatch.cu +++ b/modules/gpu/src/cuda/bf_knnmatch.cu @@ -417,10 +417,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (BLOCK_SIZE * (MAX_DESC_LEN >= BLOCK_SIZE ? MAX_DESC_LEN : BLOCK_SIZE) + BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); matchUnrolledCached<<>>(query, train, mask, trainIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -478,10 +478,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (BLOCK_SIZE * (MAX_DESC_LEN >= 2 * BLOCK_SIZE ? MAX_DESC_LEN : 2 * BLOCK_SIZE) + BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); matchUnrolledCached<<>>(query, trains, n, mask, trainIdx.data, imgIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } /////////////////////////////////////////////////////////////////////////////// @@ -594,10 +594,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (2 * BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); matchUnrolled<<>>(query, train, mask, trainIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -653,10 +653,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (3 * BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); matchUnrolled<<>>(query, trains, n, mask, trainIdx.data, imgIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } /////////////////////////////////////////////////////////////////////////////// @@ -768,10 +768,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (2 * BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); match<<>>(query, train, mask, trainIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -827,10 +827,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (3 * BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); match<<>>(query, trains, n, mask, trainIdx.data, imgIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } /////////////////////////////////////////////////////////////////////////////// @@ -959,10 +959,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (2 * BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); calcDistanceUnrolled<<>>(query, train, mask, allDist); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -1022,10 +1022,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (2 * BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); calcDistance<<>>(query, train, mask, allDist); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } /////////////////////////////////////////////////////////////////////////////// @@ -1115,11 +1115,11 @@ namespace cv { namespace gpu { namespace cuda for (int i = 0; i < k; ++i) { findBestMatch<<>>(allDist, i, trainIdx, distance); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); } if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } void findKnnMatchDispatcher(int k, const PtrStepSzb& trainIdx, const PtrStepSzb& distance, const PtrStepSzf& allDist, cudaStream_t stream) diff --git a/modules/gpu/src/cuda/bf_match.cu b/modules/gpu/src/cuda/bf_match.cu index 1e7cf8ab8..2ecb48ead 100644 --- a/modules/gpu/src/cuda/bf_match.cu +++ b/modules/gpu/src/cuda/bf_match.cu @@ -177,10 +177,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (BLOCK_SIZE * (MAX_DESC_LEN >= BLOCK_SIZE ? MAX_DESC_LEN : BLOCK_SIZE) + BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); matchUnrolledCached<<>>(query, train, mask, trainIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -236,10 +236,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (BLOCK_SIZE * (MAX_DESC_LEN >= 2 * BLOCK_SIZE ? MAX_DESC_LEN : 2 * BLOCK_SIZE) + BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); matchUnrolledCached<<>>(query, trains, n, mask, trainIdx.data, imgIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } /////////////////////////////////////////////////////////////////////////////// @@ -335,10 +335,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (2 * BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); matchUnrolled<<>>(query, train, mask, trainIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -392,10 +392,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (3 * BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); matchUnrolled<<>>(query, trains, n, mask, trainIdx.data, imgIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } /////////////////////////////////////////////////////////////////////////////// @@ -490,10 +490,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (2 * BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); match<<>>(query, train, mask, trainIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -546,10 +546,10 @@ namespace cv { namespace gpu { namespace cuda const size_t smemSize = (3 * BLOCK_SIZE * BLOCK_SIZE) * sizeof(int); match<<>>(query, trains, n, mask, trainIdx.data, imgIdx.data, distance.data); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } /////////////////////////////////////////////////////////////////////////////// diff --git a/modules/gpu/src/cuda/bf_radius_match.cu b/modules/gpu/src/cuda/bf_radius_match.cu index 1c0857748..56b99faf5 100644 --- a/modules/gpu/src/cuda/bf_radius_match.cu +++ b/modules/gpu/src/cuda/bf_radius_match.cu @@ -122,10 +122,10 @@ namespace cv { namespace gpu { namespace cuda matchUnrolled<<>>(query, 0, train, maxDistance, mask, trainIdx, PtrStepi(), distance, nMatches.data, trainIdx.cols); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -153,11 +153,11 @@ namespace cv { namespace gpu { namespace cuda matchUnrolled<<>>(query, i, train, maxDistance, WithOutMask(), trainIdx, imgIdx, distance, nMatches.data, trainIdx.cols); } - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); } if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } /////////////////////////////////////////////////////////////////////////////// @@ -230,10 +230,10 @@ namespace cv { namespace gpu { namespace cuda match<<>>(query, 0, train, maxDistance, mask, trainIdx, PtrStepi(), distance, nMatches.data, trainIdx.cols); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -261,11 +261,11 @@ namespace cv { namespace gpu { namespace cuda match<<>>(query, i, train, maxDistance, WithOutMask(), trainIdx, imgIdx, distance, nMatches.data, trainIdx.cols); } - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); } if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } /////////////////////////////////////////////////////////////////////////////// diff --git a/modules/gpu/src/cuda/bgfg_gmg.cu b/modules/gpu/src/cuda/bgfg_gmg.cu index 0047fe53e..14e23df94 100644 --- a/modules/gpu/src/cuda/bgfg_gmg.cu +++ b/modules/gpu/src/cuda/bgfg_gmg.cu @@ -62,15 +62,15 @@ namespace cv { namespace gpu { namespace cuda { void loadConstants(int width, int height, float minVal, float maxVal, int quantizationLevels, float backgroundPrior, float decisionThreshold, int maxFeatures, int numInitializationFrames) { - cudaSafeCall( cudaMemcpyToSymbol(c_width, &width, sizeof(width)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_height, &height, sizeof(height)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_minVal, &minVal, sizeof(minVal)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_maxVal, &maxVal, sizeof(maxVal)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_quantizationLevels, &quantizationLevels, sizeof(quantizationLevels)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_backgroundPrior, &backgroundPrior, sizeof(backgroundPrior)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_decisionThreshold, &decisionThreshold, sizeof(decisionThreshold)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_maxFeatures, &maxFeatures, sizeof(maxFeatures)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_numInitializationFrames, &numInitializationFrames, sizeof(numInitializationFrames)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_width, &width, sizeof(width)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_height, &height, sizeof(height)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_minVal, &minVal, sizeof(minVal)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_maxVal, &maxVal, sizeof(maxVal)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_quantizationLevels, &quantizationLevels, sizeof(quantizationLevels)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_backgroundPrior, &backgroundPrior, sizeof(backgroundPrior)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_decisionThreshold, &decisionThreshold, sizeof(decisionThreshold)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_maxFeatures, &maxFeatures, sizeof(maxFeatures)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_numInitializationFrames, &numInitializationFrames, sizeof(numInitializationFrames)) ); } __device__ float findFeature(const int color, const PtrStepi& colors, const PtrStepf& weights, const int x, const int y, const int nfeatures) @@ -230,14 +230,14 @@ namespace cv { namespace gpu { namespace cuda { const dim3 block(32, 8); const dim3 grid(divUp(frame.cols, block.x), divUp(frame.rows, block.y)); - cudaSafeCall( cudaFuncSetCacheConfig(update, cudaFuncCachePreferL1) ); + cvCudaSafeCall( cudaFuncSetCacheConfig(update, cudaFuncCachePreferL1) ); update<<>>((PtrStepSz) frame, fgmask, colors, weights, nfeatures, frameNum, learningRate, updateBackgroundModel); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template void update_gpu(PtrStepSzb frame, PtrStepb fgmask, PtrStepSzi colors, PtrStepf weights, PtrStepi nfeatures, int frameNum, float learningRate, bool updateBackgroundModel, cudaStream_t stream); diff --git a/modules/gpu/src/cuda/bgfg_mog.cu b/modules/gpu/src/cuda/bgfg_mog.cu index 6a514f7d3..771f367ce 100644 --- a/modules/gpu/src/cuda/bgfg_mog.cu +++ b/modules/gpu/src/cuda/bgfg_mog.cu @@ -180,16 +180,16 @@ namespace cv { namespace gpu { namespace cuda dim3 block(32, 8); dim3 grid(divUp(frame.cols, block.x), divUp(frame.rows, block.y)); - cudaSafeCall( cudaFuncSetCacheConfig(mog_withoutLearning, cudaFuncCachePreferL1) ); + cvCudaSafeCall( cudaFuncSetCacheConfig(mog_withoutLearning, cudaFuncCachePreferL1) ); mog_withoutLearning<<>>((PtrStepSz) frame, fgmask, weight, (PtrStepSz) mean, (PtrStepSz) var, nmixtures, varThreshold, backgroundRatio); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } /////////////////////////////////////////////////////////////// @@ -333,16 +333,16 @@ namespace cv { namespace gpu { namespace cuda dim3 block(32, 8); dim3 grid(divUp(frame.cols, block.x), divUp(frame.rows, block.y)); - cudaSafeCall( cudaFuncSetCacheConfig(mog_withLearning, cudaFuncCachePreferL1) ); + cvCudaSafeCall( cudaFuncSetCacheConfig(mog_withLearning, cudaFuncCachePreferL1) ); mog_withLearning<<>>((PtrStepSz) frame, fgmask, weight, sortKey, (PtrStepSz) mean, (PtrStepSz) var, nmixtures, varThreshold, backgroundRatio, learningRate, minVar); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } /////////////////////////////////////////////////////////////// @@ -406,13 +406,13 @@ namespace cv { namespace gpu { namespace cuda dim3 block(32, 8); dim3 grid(divUp(dst.cols, block.x), divUp(dst.rows, block.y)); - cudaSafeCall( cudaFuncSetCacheConfig(getBackgroundImage, cudaFuncCachePreferL1) ); + cvCudaSafeCall( cudaFuncSetCacheConfig(getBackgroundImage, cudaFuncCachePreferL1) ); getBackgroundImage<<>>(weight, (PtrStepSz) mean, (PtrStepSz) dst, nmixtures, backgroundRatio); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } void getBackgroundImage_gpu(int cn, PtrStepSzf weight, PtrStepSzb mean, PtrStepSzb dst, int nmixtures, float backgroundRatio, cudaStream_t stream) @@ -445,15 +445,15 @@ namespace cv { namespace gpu { namespace cuda varMin = ::fminf(varMin, varMax); varMax = ::fmaxf(varMin, varMax); - cudaSafeCall( cudaMemcpyToSymbol(c_nmixtures, &nmixtures, sizeof(int)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_Tb, &Tb, sizeof(float)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_TB, &TB, sizeof(float)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_Tg, &Tg, sizeof(float)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_varInit, &varInit, sizeof(float)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_varMin, &varMin, sizeof(float)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_varMax, &varMax, sizeof(float)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_tau, &tau, sizeof(float)) ); - cudaSafeCall( cudaMemcpyToSymbol(c_shadowVal, &shadowVal, sizeof(unsigned char)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_nmixtures, &nmixtures, sizeof(int)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_Tb, &Tb, sizeof(float)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_TB, &TB, sizeof(float)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_Tg, &Tg, sizeof(float)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_varInit, &varInit, sizeof(float)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_varMin, &varMin, sizeof(float)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_varMax, &varMax, sizeof(float)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_tau, &tau, sizeof(float)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(c_shadowVal, &shadowVal, sizeof(unsigned char)) ); } template @@ -665,7 +665,7 @@ namespace cv { namespace gpu { namespace cuda if (detectShadows) { - cudaSafeCall( cudaFuncSetCacheConfig(mog2, cudaFuncCachePreferL1) ); + cvCudaSafeCall( cudaFuncSetCacheConfig(mog2, cudaFuncCachePreferL1) ); mog2<<>>((PtrStepSz) frame, fgmask, modesUsed, weight, variance, (PtrStepSz) mean, @@ -673,17 +673,17 @@ namespace cv { namespace gpu { namespace cuda } else { - cudaSafeCall( cudaFuncSetCacheConfig(mog2, cudaFuncCachePreferL1) ); + cvCudaSafeCall( cudaFuncSetCacheConfig(mog2, cudaFuncCachePreferL1) ); mog2<<>>((PtrStepSz) frame, fgmask, modesUsed, weight, variance, (PtrStepSz) mean, alphaT, alpha1, prune); } - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } void mog2_gpu(PtrStepSzb frame, int cn, PtrStepSzb fgmask, PtrStepSzb modesUsed, PtrStepSzf weight, PtrStepSzf variance, PtrStepSzb mean, @@ -737,13 +737,13 @@ namespace cv { namespace gpu { namespace cuda dim3 block(32, 8); dim3 grid(divUp(modesUsed.cols, block.x), divUp(modesUsed.rows, block.y)); - cudaSafeCall( cudaFuncSetCacheConfig(getBackgroundImage2, cudaFuncCachePreferL1) ); + cvCudaSafeCall( cudaFuncSetCacheConfig(getBackgroundImage2, cudaFuncCachePreferL1) ); getBackgroundImage2<<>>(modesUsed, weight, (PtrStepSz) mean, (PtrStepSz) dst); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } void getBackgroundImage2_gpu(int cn, PtrStepSzb modesUsed, PtrStepSzf weight, PtrStepSzb mean, PtrStepSzb dst, cudaStream_t stream) diff --git a/modules/gpu/src/cuda/bilateral_filter.cu b/modules/gpu/src/cuda/bilateral_filter.cu index 17c7c1d8e..8a6f78111 100644 --- a/modules/gpu/src/cuda/bilateral_filter.cu +++ b/modules/gpu/src/cuda/bilateral_filter.cu @@ -135,12 +135,12 @@ namespace cv { namespace gpu { namespace cuda float sigma_spatial2_inv_half = -0.5f/(sigma_spatial * sigma_spatial); float sigma_color2_inv_half = -0.5f/(sigma_color * sigma_color); - cudaSafeCall( cudaFuncSetCacheConfig (bilateral_kernel >, cudaFuncCachePreferL1) ); + cvCudaSafeCall( cudaFuncSetCacheConfig (bilateral_kernel >, cudaFuncCachePreferL1) ); bilateral_kernel<<>>((PtrStepSz)src, (PtrStepSz)dst, b, kernel_size, sigma_spatial2_inv_half, sigma_color2_inv_half); - cudaSafeCall ( cudaGetLastError () ); + cvCudaSafeCall ( cudaGetLastError () ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template diff --git a/modules/gpu/src/cuda/blend.cu b/modules/gpu/src/cuda/blend.cu index b4ecfbb7f..f5f734cc5 100644 --- a/modules/gpu/src/cuda/blend.cu +++ b/modules/gpu/src/cuda/blend.cu @@ -73,10 +73,10 @@ namespace cv { namespace gpu { namespace cuda dim3 grid(divUp(cols * cn, threads.x), divUp(rows, threads.y)); blendLinearKernel<<>>(rows, cols * cn, cn, img1, img2, weights1, weights2, result); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall(cudaDeviceSynchronize()); + cvCudaSafeCall(cudaDeviceSynchronize()); } template void blendLinearCaller(int, int, int, PtrStep, PtrStep, PtrStepf, PtrStepf, PtrStep, cudaStream_t stream); @@ -109,10 +109,10 @@ namespace cv { namespace gpu { namespace cuda dim3 grid(divUp(cols, threads.x), divUp(rows, threads.y)); blendLinearKernel8UC4<<>>(rows, cols, img1, img2, weights1, weights2, result); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall(cudaDeviceSynchronize()); + cvCudaSafeCall(cudaDeviceSynchronize()); } } // namespace blend }}} // namespace cv { namespace gpu { namespace cuda diff --git a/modules/gpu/src/cuda/calib3d.cu b/modules/gpu/src/cuda/calib3d.cu index 5d12405d5..f8882cfc2 100644 --- a/modules/gpu/src/cuda/calib3d.cu +++ b/modules/gpu/src/cuda/calib3d.cu @@ -75,10 +75,10 @@ namespace cv { namespace gpu { namespace cuda const float* transl, PtrStepSz dst, cudaStream_t stream) { - cudaSafeCall(cudaMemcpyToSymbol(crot0, rot, sizeof(float) * 3)); - cudaSafeCall(cudaMemcpyToSymbol(crot1, rot + 3, sizeof(float) * 3)); - cudaSafeCall(cudaMemcpyToSymbol(crot2, rot + 6, sizeof(float) * 3)); - cudaSafeCall(cudaMemcpyToSymbol(ctransl, transl, sizeof(float) * 3)); + cvCudaSafeCall(cudaMemcpyToSymbol(crot0, rot, sizeof(float) * 3)); + cvCudaSafeCall(cudaMemcpyToSymbol(crot1, rot + 3, sizeof(float) * 3)); + cvCudaSafeCall(cudaMemcpyToSymbol(crot2, rot + 6, sizeof(float) * 3)); + cvCudaSafeCall(cudaMemcpyToSymbol(ctransl, transl, sizeof(float) * 3)); cv::gpu::cuda::transform(src, dst, TransformOp(), WithOutMask(), stream); } } // namespace transform_points @@ -114,12 +114,12 @@ namespace cv { namespace gpu { namespace cuda const float* transl, const float* proj, PtrStepSz dst, cudaStream_t stream) { - cudaSafeCall(cudaMemcpyToSymbol(crot0, rot, sizeof(float) * 3)); - cudaSafeCall(cudaMemcpyToSymbol(crot1, rot + 3, sizeof(float) * 3)); - cudaSafeCall(cudaMemcpyToSymbol(crot2, rot + 6, sizeof(float) * 3)); - cudaSafeCall(cudaMemcpyToSymbol(ctransl, transl, sizeof(float) * 3)); - cudaSafeCall(cudaMemcpyToSymbol(cproj0, proj, sizeof(float) * 3)); - cudaSafeCall(cudaMemcpyToSymbol(cproj1, proj + 3, sizeof(float) * 3)); + cvCudaSafeCall(cudaMemcpyToSymbol(crot0, rot, sizeof(float) * 3)); + cvCudaSafeCall(cudaMemcpyToSymbol(crot1, rot + 3, sizeof(float) * 3)); + cvCudaSafeCall(cudaMemcpyToSymbol(crot2, rot + 6, sizeof(float) * 3)); + cvCudaSafeCall(cudaMemcpyToSymbol(ctransl, transl, sizeof(float) * 3)); + cvCudaSafeCall(cudaMemcpyToSymbol(cproj0, proj, sizeof(float) * 3)); + cvCudaSafeCall(cudaMemcpyToSymbol(cproj1, proj + 3, sizeof(float) * 3)); cv::gpu::cuda::transform(src, dst, ProjectOp(), WithOutMask(), stream); } } // namespace project_points @@ -174,17 +174,17 @@ namespace cv { namespace gpu { namespace cuda const float3* transl_vectors, const float3* object, const float2* image, const float dist_threshold, int* hypothesis_scores) { - cudaSafeCall(cudaMemcpyToSymbol(crot_matrices, rot_matrices, num_hypotheses * 3 * sizeof(float3))); - cudaSafeCall(cudaMemcpyToSymbol(ctransl_vectors, transl_vectors, num_hypotheses * sizeof(float3))); + cvCudaSafeCall(cudaMemcpyToSymbol(crot_matrices, rot_matrices, num_hypotheses * 3 * sizeof(float3))); + cvCudaSafeCall(cudaMemcpyToSymbol(ctransl_vectors, transl_vectors, num_hypotheses * sizeof(float3))); dim3 threads(256); dim3 grid(num_hypotheses); computeHypothesisScoresKernel<256><<>>( num_points, object, image, dist_threshold, hypothesis_scores); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } } // namespace solvepnp_ransac }}} // namespace cv { namespace gpu { namespace cuda diff --git a/modules/gpu/src/cuda/canny.cu b/modules/gpu/src/cuda/canny.cu index 151f234f0..62c7242ed 100644 --- a/modules/gpu/src/cuda/canny.cu +++ b/modules/gpu/src/cuda/canny.cu @@ -141,9 +141,9 @@ namespace canny calcMagnitudeKernel<<>>(src, dx, dy, mag, norm); } - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); - cudaSafeCall(cudaThreadSynchronize()); + cvCudaSafeCall(cudaThreadSynchronize()); } void calcMagnitude(PtrStepSzi dx, PtrStepSzi dy, PtrStepSzf mag, bool L2Grad) @@ -227,9 +227,9 @@ namespace canny bindTexture(&tex_mag, mag); calcMapKernel<<>>(dx, dy, map, low_thresh, high_thresh); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } } @@ -324,17 +324,17 @@ namespace canny void edgesHysteresisLocal(PtrStepSzi map, ushort2* st1) { void* counter_ptr; - cudaSafeCall( cudaGetSymbolAddress(&counter_ptr, counter) ); + cvCudaSafeCall( cudaGetSymbolAddress(&counter_ptr, counter) ); - cudaSafeCall( cudaMemset(counter_ptr, 0, sizeof(int)) ); + cvCudaSafeCall( cudaMemset(counter_ptr, 0, sizeof(int)) ); const dim3 block(16, 16); const dim3 grid(divUp(map.cols, block.x), divUp(map.rows, block.y)); edgesHysteresisLocalKernel<<>>(map, st1); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } } @@ -435,24 +435,24 @@ namespace canny void edgesHysteresisGlobal(PtrStepSzi map, ushort2* st1, ushort2* st2) { void* counter_ptr; - cudaSafeCall( cudaGetSymbolAddress(&counter_ptr, canny::counter) ); + cvCudaSafeCall( cudaGetSymbolAddress(&counter_ptr, canny::counter) ); int count; - cudaSafeCall( cudaMemcpy(&count, counter_ptr, sizeof(int), cudaMemcpyDeviceToHost) ); + cvCudaSafeCall( cudaMemcpy(&count, counter_ptr, sizeof(int), cudaMemcpyDeviceToHost) ); while (count > 0) { - cudaSafeCall( cudaMemset(counter_ptr, 0, sizeof(int)) ); + cvCudaSafeCall( cudaMemset(counter_ptr, 0, sizeof(int)) ); const dim3 block(128); const dim3 grid(::min(count, 65535u), divUp(count, 65535), 1); edgesHysteresisGlobalKernel<<>>(map, st1, st2, count); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); - cudaSafeCall( cudaMemcpy(&count, counter_ptr, sizeof(int), cudaMemcpyDeviceToHost) ); + cvCudaSafeCall( cudaMemcpy(&count, counter_ptr, sizeof(int), cudaMemcpyDeviceToHost) ); std::swap(st1, st2); } diff --git a/modules/gpu/src/cuda/ccomponetns.cu b/modules/gpu/src/cuda/ccomponetns.cu index 2e52ff2bf..45928a084 100644 --- a/modules/gpu/src/cuda/ccomponetns.cu +++ b/modules/gpu/src/cuda/ccomponetns.cu @@ -215,9 +215,9 @@ namespace cv { namespace gpu { namespace cuda Int_t inInt(lo, hi); computeConnectivity<<>>(static_cast >(image), edges, inInt); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template void computeEdges (const PtrStepSzb& image, PtrStepSzb edges, const float4& lo, const float4& hi, cudaStream_t stream); @@ -503,7 +503,7 @@ namespace cv { namespace gpu { namespace cuda dim3 grid(divUp(edges.cols, TILE_COLS), divUp(edges.rows, TILE_ROWS)); lableTiles<<>>(edges, comps); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); int tileSizeX = TILE_COLS, tileSizeY = TILE_ROWS; while (grid.x > 1 || grid.y > 1) @@ -517,16 +517,16 @@ namespace cv { namespace gpu { namespace cuda tileSizeY <<= 1; grid = mergeGrid; - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); } grid.x = divUp(edges.cols, block.x); grid.y = divUp(edges.rows, block.y); flatten<<>>(edges, comps); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } } } } } diff --git a/modules/gpu/src/cuda/clahe.cu b/modules/gpu/src/cuda/clahe.cu index c5ecbf4e8..340e15b45 100644 --- a/modules/gpu/src/cuda/clahe.cu +++ b/modules/gpu/src/cuda/clahe.cu @@ -128,10 +128,10 @@ namespace clahe calcLutKernel<<>>(src, lut, tileSize, tilesX, clipLimit, lutScale); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } __global__ void tranformKernel(const PtrStepSzb src, PtrStepb dst, const PtrStepb lut, const int2 tileSize, const int tilesX, const int tilesY) @@ -173,13 +173,13 @@ namespace clahe const dim3 block(32, 8); const dim3 grid(divUp(src.cols, block.x), divUp(src.rows, block.y)); - cudaSafeCall( cudaFuncSetCacheConfig(tranformKernel, cudaFuncCachePreferL1) ); + cvCudaSafeCall( cudaFuncSetCacheConfig(tranformKernel, cudaFuncCachePreferL1) ); tranformKernel<<>>(src, dst, lut, tileSize, tilesX, tilesY); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } } diff --git a/modules/gpu/src/cuda/column_filter.h b/modules/gpu/src/cuda/column_filter.h index 00278103e..1f4276740 100644 --- a/modules/gpu/src/cuda/column_filter.h +++ b/modules/gpu/src/cuda/column_filter.h @@ -169,10 +169,10 @@ namespace column_filter linearColumnFilter<<>>(src, dst, anchor, brd); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } } @@ -363,9 +363,9 @@ namespace filter }; if (stream == 0) - cudaSafeCall( cudaMemcpyToSymbol(column_filter::c_kernel, kernel, ksize * sizeof(float), 0, cudaMemcpyDeviceToDevice) ); + cvCudaSafeCall( cudaMemcpyToSymbol(column_filter::c_kernel, kernel, ksize * sizeof(float), 0, cudaMemcpyDeviceToDevice) ); else - cudaSafeCall( cudaMemcpyToSymbolAsync(column_filter::c_kernel, kernel, ksize * sizeof(float), 0, cudaMemcpyDeviceToDevice, stream) ); + cvCudaSafeCall( cudaMemcpyToSymbolAsync(column_filter::c_kernel, kernel, ksize * sizeof(float), 0, cudaMemcpyDeviceToDevice, stream) ); callers[brd_type][ksize]((PtrStepSz)src, (PtrStepSz)dst, anchor, cc, stream); } diff --git a/modules/gpu/src/cuda/copy_make_border.cu b/modules/gpu/src/cuda/copy_make_border.cu index 43544658f..30bbe0f40 100644 --- a/modules/gpu/src/cuda/copy_make_border.cu +++ b/modules/gpu/src/cuda/copy_make_border.cu @@ -70,10 +70,10 @@ namespace cv { namespace gpu { namespace cuda BorderReader< PtrStep, B > brdSrc(src, brd); copyMakeBorder<<>>(brdSrc, dst, top, left); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } }; diff --git a/modules/gpu/src/cuda/debayer.cu b/modules/gpu/src/cuda/debayer.cu index a079bd583..6ade873f3 100644 --- a/modules/gpu/src/cuda/debayer.cu +++ b/modules/gpu/src/cuda/debayer.cu @@ -347,13 +347,13 @@ namespace cv { namespace gpu { namespace cuda const dim3 block(32, 8); const dim3 grid(divUp(src.cols, 4 * block.x), divUp(src.rows, block.y)); - cudaSafeCall( cudaFuncSetCacheConfig(Bayer2BGR_8u, cudaFuncCachePreferL1) ); + cvCudaSafeCall( cudaFuncSetCacheConfig(Bayer2BGR_8u, cudaFuncCachePreferL1) ); Bayer2BGR_8u<<>>(src, (PtrStepSz)dst, blue_last, start_with_green); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template @@ -364,13 +364,13 @@ namespace cv { namespace gpu { namespace cuda const dim3 block(32, 8); const dim3 grid(divUp(src.cols, 2 * block.x), divUp(src.rows, block.y)); - cudaSafeCall( cudaFuncSetCacheConfig(Bayer2BGR_16u, cudaFuncCachePreferL1) ); + cvCudaSafeCall( cudaFuncSetCacheConfig(Bayer2BGR_16u, cudaFuncCachePreferL1) ); Bayer2BGR_16u<<>>(src, (PtrStepSz)dst, blue_last, start_with_green); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template void Bayer2BGR_8u_gpu<1>(PtrStepSzb src, PtrStepSzb dst, bool blue_last, bool start_with_green, cudaStream_t stream); @@ -530,10 +530,10 @@ namespace cv { namespace gpu { namespace cuda bindTexture(&sourceTex, src); MHCdemosaic<<>>((PtrStepSz)dst, sourceOffset, firstRed); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template void MHCdemosaic<1>(PtrStepSzb src, int2 sourceOffset, PtrStepSzb dst, int2 firstRed, cudaStream_t stream); diff --git a/modules/gpu/src/cuda/disp_bilateral_filter.cu b/modules/gpu/src/cuda/disp_bilateral_filter.cu index c3edff320..7758e4ce0 100644 --- a/modules/gpu/src/cuda/disp_bilateral_filter.cu +++ b/modules/gpu/src/cuda/disp_bilateral_filter.cu @@ -61,16 +61,16 @@ namespace cv { namespace gpu { namespace cuda void disp_load_constants(float* table_color, PtrStepSzf table_space, int ndisp, int radius, short edge_disc, short max_disc) { - cudaSafeCall( cudaMemcpyToSymbol(ctable_color, &table_color, sizeof(table_color)) ); - cudaSafeCall( cudaMemcpyToSymbol(ctable_space, &table_space.data, sizeof(table_space.data)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(ctable_color, &table_color, sizeof(table_color)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(ctable_space, &table_space.data, sizeof(table_space.data)) ); size_t table_space_step = table_space.step / sizeof(float); - cudaSafeCall( cudaMemcpyToSymbol(ctable_space_step, &table_space_step, sizeof(size_t)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(ctable_space_step, &table_space_step, sizeof(size_t)) ); - cudaSafeCall( cudaMemcpyToSymbol(cndisp, &ndisp, sizeof(int)) ); - cudaSafeCall( cudaMemcpyToSymbol(cradius, &radius, sizeof(int)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(cndisp, &ndisp, sizeof(int)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(cradius, &radius, sizeof(int)) ); - cudaSafeCall( cudaMemcpyToSymbol(cedge_disc, &edge_disc, sizeof(short)) ); - cudaSafeCall( cudaMemcpyToSymbol(cmax_disc, &max_disc, sizeof(short)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(cedge_disc, &edge_disc, sizeof(short)) ); + cvCudaSafeCall( cudaMemcpyToSymbol(cmax_disc, &max_disc, sizeof(short)) ); } template @@ -191,28 +191,28 @@ namespace cv { namespace gpu { namespace cuda for (int i = 0; i < iters; ++i) { disp_bilateral_filter<1><<>>(0, disp.data, disp.step/sizeof(T), img.data, img.step, disp.rows, disp.cols); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); disp_bilateral_filter<1><<>>(1, disp.data, disp.step/sizeof(T), img.data, img.step, disp.rows, disp.cols); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); } break; case 3: for (int i = 0; i < iters; ++i) { disp_bilateral_filter<3><<>>(0, disp.data, disp.step/sizeof(T), img.data, img.step, disp.rows, disp.cols); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); disp_bilateral_filter<3><<>>(1, disp.data, disp.step/sizeof(T), img.data, img.step, disp.rows, disp.cols); - cudaSafeCall( cudaGetLastError() ); + cvCudaSafeCall( cudaGetLastError() ); } break; default: - cv::gpu::error("Unsupported channels count", __FILE__, __LINE__, "disp_bilateral_filter"); + CV_Error(cv::Error::BadNumChannels, "Unsupported channels count"); } if (stream == 0) - cudaSafeCall( cudaDeviceSynchronize() ); + cvCudaSafeCall( cudaDeviceSynchronize() ); } template void disp_bilateral_filter(PtrStepSz disp, PtrStepSzb img, int channels, int iters, cudaStream_t stream); diff --git a/modules/gpu/src/cuda/element_operations.cu b/modules/gpu/src/cuda/element_operations.cu index 1d3b7ca4c..edd17aea7 100644 --- a/modules/gpu/src/cuda/element_operations.cu +++ b/modules/gpu/src/cuda/element_operations.cu @@ -216,21 +216,21 @@ namespace arithm { void addMat_v4(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, VAdd4(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, VAdd4(), WithOutMask(), stream); } void addMat_v2(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, VAdd2(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, VAdd2(), WithOutMask(), stream); } template void addMat(PtrStepSzb src1, PtrStepSzb src2, PtrStepSzb dst, PtrStepb mask, cudaStream_t stream) { if (mask.data) - transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, AddMat(), mask, stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, AddMat(), mask, stream); else - transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, AddMat(), WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, AddMat(), WithOutMask(), stream); } template void addMat(PtrStepSzb src1, PtrStepSzb src2, PtrStepSzb dst, PtrStepb mask, cudaStream_t stream); @@ -323,9 +323,9 @@ namespace arithm AddScalar op(static_cast(val)); if (mask.data) - transform((PtrStepSz) src1, (PtrStepSz) dst, op, mask, stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) dst, op, mask, stream); else - transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); } template void addScalar(PtrStepSzb src1, double val, PtrStepSzb dst, PtrStepb mask, cudaStream_t stream); @@ -451,21 +451,21 @@ namespace arithm { void subMat_v4(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, VSub4(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, VSub4(), WithOutMask(), stream); } void subMat_v2(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, VSub2(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, VSub2(), WithOutMask(), stream); } template void subMat(PtrStepSzb src1, PtrStepSzb src2, PtrStepSzb dst, PtrStepb mask, cudaStream_t stream) { if (mask.data) - transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, SubMat(), mask, stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, SubMat(), mask, stream); else - transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, SubMat(), WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, SubMat(), WithOutMask(), stream); } template void subMat(PtrStepSzb src1, PtrStepSzb src2, PtrStepSzb dst, PtrStepb mask, cudaStream_t stream); @@ -536,9 +536,9 @@ namespace arithm AddScalar op(-static_cast(val)); if (mask.data) - transform((PtrStepSz) src1, (PtrStepSz) dst, op, mask, stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) dst, op, mask, stream); else - transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); } template void subScalar(PtrStepSzb src1, double val, PtrStepSzb dst, PtrStepb mask, cudaStream_t stream); @@ -676,12 +676,12 @@ namespace arithm { void mulMat_8uc4_32f(PtrStepSz src1, PtrStepSzf src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, Mul_8uc4_32f(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, Mul_8uc4_32f(), WithOutMask(), stream); } void mulMat_16sc4_32f(PtrStepSz src1, PtrStepSzf src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, Mul_16sc4_32f(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, Mul_16sc4_32f(), WithOutMask(), stream); } template @@ -690,12 +690,12 @@ namespace arithm if (scale == 1) { Mul op; - transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, op, WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, op, WithOutMask(), stream); } else { MulScale op(static_cast(scale)); - transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, op, WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, op, WithOutMask(), stream); } } @@ -787,7 +787,7 @@ namespace arithm void mulScalar(PtrStepSzb src1, double val, PtrStepSzb dst, cudaStream_t stream) { MulScalar op(static_cast(val)); - transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); } template void mulScalar(PtrStepSzb src1, double val, PtrStepSzb dst, cudaStream_t stream); @@ -944,12 +944,12 @@ namespace arithm { void divMat_8uc4_32f(PtrStepSz src1, PtrStepSzf src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, Div_8uc4_32f(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, Div_8uc4_32f(), WithOutMask(), stream); } void divMat_16sc4_32f(PtrStepSz src1, PtrStepSzf src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, Div_16sc4_32f(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, Div_16sc4_32f(), WithOutMask(), stream); } template @@ -958,12 +958,12 @@ namespace arithm if (scale == 1) { Div op; - transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, op, WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, op, WithOutMask(), stream); } else { DivScale op(static_cast(scale)); - transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, op, WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, op, WithOutMask(), stream); } } @@ -1033,7 +1033,7 @@ namespace arithm void divScalar(PtrStepSzb src1, double val, PtrStepSzb dst, cudaStream_t stream) { MulScalar op(static_cast(1.0 / val)); - transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); } template void divScalar(PtrStepSzb src1, double val, PtrStepSzb dst, cudaStream_t stream); @@ -1124,7 +1124,7 @@ namespace arithm void divInv(PtrStepSzb src1, double val, PtrStepSzb dst, cudaStream_t stream) { DivInv op(static_cast(val)); - transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); } template void divInv(PtrStepSzb src1, double val, PtrStepSzb dst, cudaStream_t stream); @@ -1263,18 +1263,18 @@ namespace arithm { void absDiffMat_v4(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, VAbsDiff4(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, VAbsDiff4(), WithOutMask(), stream); } void absDiffMat_v2(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, VAbsDiff2(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, VAbsDiff2(), WithOutMask(), stream); } template void absDiffMat(PtrStepSzb src1, PtrStepSzb src2, PtrStepSzb dst, cudaStream_t stream) { - transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, AbsDiffMat(), WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) src2, (PtrStepSz) dst, AbsDiffMat(), WithOutMask(), stream); } template void absDiffMat(PtrStepSzb src1, PtrStepSzb src2, PtrStepSzb dst, cudaStream_t stream); @@ -1319,7 +1319,7 @@ namespace arithm { AbsDiffScalar op(static_cast(val)); - transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); + cuda::transform((PtrStepSz) src1, (PtrStepSz) dst, op, WithOutMask(), stream); } template void absDiffScalar(PtrStepSzb src1, double src2, PtrStepSzb dst, cudaStream_t stream); @@ -1346,7 +1346,7 @@ namespace arithm template void absMat(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream) { - transform((PtrStepSz) src, (PtrStepSz) dst, abs_func(), WithOutMask(), stream); + cuda::transform((PtrStepSz) src, (PtrStepSz) dst, abs_func(), WithOutMask(), stream); } template void absMat(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); @@ -1387,7 +1387,7 @@ namespace arithm template void sqrMat(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream) { - transform((PtrStepSz) src, (PtrStepSz) dst, Sqr(), WithOutMask(), stream); + cuda::transform((PtrStepSz) src, (PtrStepSz) dst, Sqr(), WithOutMask(), stream); } template void sqrMat(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); @@ -1414,7 +1414,7 @@ namespace arithm template void sqrtMat(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream) { - transform((PtrStepSz) src, (PtrStepSz) dst, sqrt_func(), WithOutMask(), stream); + cuda::transform((PtrStepSz) src, (PtrStepSz) dst, sqrt_func(), WithOutMask(), stream); } template void sqrtMat(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); @@ -1441,7 +1441,7 @@ namespace arithm template void logMat(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream) { - transform((PtrStepSz) src, (PtrStepSz) dst, log_func(), WithOutMask(), stream); + cuda::transform((PtrStepSz) src, (PtrStepSz) dst, log_func(), WithOutMask(), stream); } template void logMat(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); @@ -1483,7 +1483,7 @@ namespace arithm template void expMat(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream) { - transform((PtrStepSz) src, (PtrStepSz) dst, Exp(), WithOutMask(), stream); + cuda::transform((PtrStepSz) src, (PtrStepSz) dst, Exp(), WithOutMask(), stream); } template void expMat(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); @@ -1580,26 +1580,26 @@ namespace arithm { void cmpMatEq_v4(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, VCmpEq4(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, VCmpEq4(), WithOutMask(), stream); } void cmpMatNe_v4(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, VCmpNe4(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, VCmpNe4(), WithOutMask(), stream); } void cmpMatLt_v4(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, VCmpLt4(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, VCmpLt4(), WithOutMask(), stream); } void cmpMatLe_v4(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, cudaStream_t stream) { - transform(src1, src2, dst, VCmpLe4(), WithOutMask(), stream); + cuda::transform(src1, src2, dst, VCmpLe4(), WithOutMask(), stream); } template