minor device namespace refactor
This commit is contained in:
parent
5fe9bb717d
commit
50946b59c1
@ -152,6 +152,20 @@ namespace cv
|
|||||||
//#undef __CV_GPU_DEPR_BEFORE__
|
//#undef __CV_GPU_DEPR_BEFORE__
|
||||||
//#undef __CV_GPU_DEPR_AFTER__
|
//#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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,17 +22,14 @@ source_group("Device" FILES ${lib_device_hdrs})
|
|||||||
source_group("Device\\Detail" FILES ${lib_device_hdrs_detail})
|
source_group("Device\\Detail" FILES ${lib_device_hdrs_detail})
|
||||||
|
|
||||||
if (HAVE_CUDA)
|
if (HAVE_CUDA)
|
||||||
file(GLOB_RECURSE ncv_srcs "src/nvidia/*.cpp")
|
file(GLOB_RECURSE ncv_srcs "src/nvidia/*.cpp" "src/nvidia/*.h*")
|
||||||
file(GLOB_RECURSE ncv_cuda "src/nvidia/*.cu")
|
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_cuda})
|
||||||
set(ncv_files ${ncv_srcs} ${ncv_hdrs} ${ncv_cuda})
|
|
||||||
|
|
||||||
source_group("Src\\NVidia" FILES ${ncv_files})
|
source_group("Src\\NVidia" FILES ${ncv_files})
|
||||||
ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS})
|
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)
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations /wd4211 /wd4201 /wd4100 /wd4505 /wd4408)
|
||||||
string(REPLACE "-Wsign-promo" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string(REPLACE "-Wsign-promo" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
|
||||||
#set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-keep")
|
|
||||||
#set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;")
|
#set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;")
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
@ -47,8 +44,6 @@ if (HAVE_CUDA)
|
|||||||
|
|
||||||
ocv_cuda_compile(cuda_objs ${lib_cuda} ${ncv_cuda})
|
ocv_cuda_compile(cuda_objs ${lib_cuda} ${ncv_cuda})
|
||||||
|
|
||||||
#CUDA_BUILD_CLEAN_TARGET()
|
|
||||||
|
|
||||||
set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
||||||
|
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
|
@ -85,8 +85,6 @@ static inline void ___cudaSafeCall(cudaError_t err, const char *file, const int
|
|||||||
cv::gpu::error(cudaGetErrorString(err), file, line, func);
|
cv::gpu::error(cudaGetErrorString(err), file, line, func);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __CUDACC__
|
|
||||||
|
|
||||||
namespace cv { namespace gpu
|
namespace cv { namespace gpu
|
||||||
{
|
{
|
||||||
__host__ __device__ __forceinline__ int divUp(int total, int grain)
|
__host__ __device__ __forceinline__ int divUp(int total, int grain)
|
||||||
@ -96,6 +94,9 @@ namespace cv { namespace gpu
|
|||||||
|
|
||||||
namespace device
|
namespace device
|
||||||
{
|
{
|
||||||
|
using cv::gpu::divUp;
|
||||||
|
|
||||||
|
#ifdef __CUDACC__
|
||||||
typedef unsigned char uchar;
|
typedef unsigned char uchar;
|
||||||
typedef unsigned short ushort;
|
typedef unsigned short ushort;
|
||||||
typedef signed char schar;
|
typedef signed char schar;
|
||||||
@ -106,9 +107,10 @@ namespace cv { namespace gpu
|
|||||||
cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();
|
cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();
|
||||||
cudaSafeCall( cudaBindTexture2D(0, tex, img.ptr(), &desc, img.cols, img.rows, img.step) );
|
cudaSafeCall( cudaBindTexture2D(0, tex, img.ptr(), &desc, img.cols, img.rows, img.step) );
|
||||||
}
|
}
|
||||||
|
#endif // __CUDACC__
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
#endif // __CUDACC__
|
|
||||||
|
|
||||||
#endif // __OPENCV_GPU_COMMON_HPP__
|
#endif // __OPENCV_GPU_COMMON_HPP__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user