From: Anatoly Baksheev Date: Mon, 10 Dec 2012 13:36:02 +0000 (+0400) Subject: minor device namespace refactor X-Git-Tag: submit/tizen_ivi/20141117.190038~2^2~1214^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50946b59c14a81b52a6530d421a88dc6b1307e8c;p=profile%2Fivi%2Fopencv.git minor device namespace refactor --- diff --git a/modules/core/include/opencv2/core/cuda_devptrs.hpp b/modules/core/include/opencv2/core/cuda_devptrs.hpp index 6363e0d..26fc240 100644 --- a/modules/core/include/opencv2/core/cuda_devptrs.hpp +++ b/modules/core/include/opencv2/core/cuda_devptrs.hpp @@ -152,6 +152,20 @@ namespace cv //#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/gpu/CMakeLists.txt b/modules/gpu/CMakeLists.txt index 78aafcf..1227b93 100644 --- a/modules/gpu/CMakeLists.txt +++ b/modules/gpu/CMakeLists.txt @@ -22,17 +22,14 @@ source_group("Device" FILES ${lib_device_hdrs}) source_group("Device\\Detail" FILES ${lib_device_hdrs_detail}) if (HAVE_CUDA) - file(GLOB_RECURSE ncv_srcs "src/nvidia/*.cpp") - file(GLOB_RECURSE ncv_cuda "src/nvidia/*.cu") - file(GLOB_RECURSE ncv_hdrs "src/nvidia/*.hpp" "src/nvidia/*.h") - set(ncv_files ${ncv_srcs} ${ncv_hdrs} ${ncv_cuda}) + file(GLOB_RECURSE ncv_srcs "src/nvidia/*.cpp" "src/nvidia/*.h*") + file(GLOB_RECURSE ncv_cuda "src/nvidia/*.cu") + set(ncv_files ${ncv_srcs} ${ncv_cuda}) source_group("Src\\NVidia" FILES ${ncv_files}) ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS}) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations /wd4211 /wd4201 /wd4100 /wd4505 /wd4408) - string(REPLACE "-Wsign-promo" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - - #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-keep") + string(REPLACE "-Wsign-promo" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;") if(MSVC) @@ -47,8 +44,6 @@ if (HAVE_CUDA) ocv_cuda_compile(cuda_objs ${lib_cuda} ${ncv_cuda}) - #CUDA_BUILD_CLEAN_TARGET() - set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) if(NOT APPLE) diff --git a/modules/gpu/include/opencv2/gpu/device/common.hpp b/modules/gpu/include/opencv2/gpu/device/common.hpp index 141467f..ffe2c98 100644 --- a/modules/gpu/include/opencv2/gpu/device/common.hpp +++ b/modules/gpu/include/opencv2/gpu/device/common.hpp @@ -85,8 +85,6 @@ static inline void ___cudaSafeCall(cudaError_t err, const char *file, const int cv::gpu::error(cudaGetErrorString(err), file, line, func); } -#ifdef __CUDACC__ - namespace cv { namespace gpu { __host__ __device__ __forceinline__ int divUp(int total, int grain) @@ -96,6 +94,9 @@ namespace cv { namespace gpu namespace device { + using cv::gpu::divUp; + +#ifdef __CUDACC__ typedef unsigned char uchar; typedef unsigned short ushort; typedef signed char schar; @@ -106,9 +107,10 @@ namespace cv { namespace gpu cudaChannelFormatDesc desc = cudaCreateChannelDesc(); cudaSafeCall( cudaBindTexture2D(0, tex, img.ptr(), &desc, img.cols, img.rows, img.step) ); } +#endif // __CUDACC__ } }} -#endif // __CUDACC__ + #endif // __OPENCV_GPU_COMMON_HPP__