Commit 4c9773d5 authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

renamed gpu headers (made it more consistent)

parent 6c253a41
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#define __OPENCV_GPU_COMMON_HPP__ #define __OPENCV_GPU_COMMON_HPP__
#include <cuda_runtime.h> #include <cuda_runtime.h>
#include "opencv2/core/cuda_devptrs.hpp" #include "opencv2/core/gpu_types.hpp"
#include "opencv2/core/cvdef.h" #include "opencv2/core/cvdef.h"
#include "opencv2/core/base.hpp" #include "opencv2/core/base.hpp"
......
...@@ -42,11 +42,15 @@ ...@@ -42,11 +42,15 @@
//M*/ //M*/
#ifndef __OPENCV_GPUMAT_HPP__ #ifndef __OPENCV_CORE_GPU_HPP__
#define __OPENCV_GPUMAT_HPP__ #define __OPENCV_CORE_GPU_HPP__
#ifndef __cplusplus
# error gpu.hpp header must be compiled as C++
#endif
#include "opencv2/core.hpp" #include "opencv2/core.hpp"
#include "opencv2/core/cuda_devptrs.hpp" #include "opencv2/core/gpu_types.hpp"
namespace cv { namespace gpu namespace cv { namespace gpu
{ {
...@@ -719,4 +723,4 @@ void ensureSizeIsEnough(Size size, int type, GpuMat& m) ...@@ -719,4 +723,4 @@ void ensureSizeIsEnough(Size size, int type, GpuMat& m)
}} // cv::gpu }} // cv::gpu
#endif // __OPENCV_GPUMAT_HPP__ #endif /* __OPENCV_CORE_GPU_HPP__ */
...@@ -53,11 +53,13 @@ ...@@ -53,11 +53,13 @@
#include "opencv2/core/cvdef.h" #include "opencv2/core/cvdef.h"
#include "opencv2/core/base.hpp" #include "opencv2/core/base.hpp"
#include "opencv2/core/gpu.hpp"
#ifdef HAVE_CUDA #ifdef HAVE_CUDA
# include <cuda.h> # include <cuda.h>
# include <cuda_runtime.h> # include <cuda_runtime.h>
# include <npp.h> # include <npp.h>
# include "opencv2/core/stream_accessor.hpp" # include "opencv2/core/gpu_stream_accessor.hpp"
# include "opencv2/core/cuda/common.hpp" # include "opencv2/core/cuda/common.hpp"
# define NPP_VERSION (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD) # define NPP_VERSION (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD)
......
...@@ -40,17 +40,21 @@ ...@@ -40,17 +40,21 @@
// //
//M*/ //M*/
#ifndef __OPENCV_CUDA_STREAM_ACCESSOR_HPP__ #ifndef __OPENCV_CORE_GPU_STREAM_ACCESSOR_HPP__
#define __OPENCV_CUDA_STREAM_ACCESSOR_HPP__ #define __OPENCV_CORE_GPU_STREAM_ACCESSOR_HPP__
#include <cuda_runtime.h> #ifndef __cplusplus
#include "opencv2/core/cvdef.h" # error gpu_stream_accessor.hpp header must be compiled as C++
#endif
// This is only header file that depends on Cuda. All other headers are independent. // 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. // 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. // 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. // In this case you have to install Cuda Toolkit.
#include <cuda_runtime.h>
#include "opencv2/core/cvdef.h"
namespace cv namespace cv
{ {
namespace gpu namespace gpu
...@@ -64,4 +68,4 @@ namespace cv ...@@ -64,4 +68,4 @@ namespace cv
} }
} }
#endif /* __OPENCV_CUDA_STREAM_ACCESSOR_HPP__ */ #endif /* __OPENCV_CORE_GPU_STREAM_ACCESSOR_HPP__ */
...@@ -40,10 +40,12 @@ ...@@ -40,10 +40,12 @@
// //
//M*/ //M*/
#ifndef __OPENCV_CORE_DEVPTRS_HPP__ #ifndef __OPENCV_CORE_GPU_TYPES_HPP__
#define __OPENCV_CORE_DEVPTRS_HPP__ #define __OPENCV_CORE_GPU_TYPES_HPP__
#ifdef __cplusplus #ifndef __cplusplus
# error gpu_types.hpp header must be compiled as C++
#endif
#ifdef __CUDACC__ #ifdef __CUDACC__
#define __CV_GPU_HOST_DEVICE__ __host__ __device__ __forceinline__ #define __CV_GPU_HOST_DEVICE__ __host__ __device__ __forceinline__
...@@ -88,7 +90,7 @@ namespace cv ...@@ -88,7 +90,7 @@ namespace cv
__CV_GPU_HOST_DEVICE__ PtrStep() : step(0) {} __CV_GPU_HOST_DEVICE__ PtrStep() : step(0) {}
__CV_GPU_HOST_DEVICE__ PtrStep(T* data_, size_t step_) : DevPtr<T>(data_), step(step_) {} __CV_GPU_HOST_DEVICE__ PtrStep(T* data_, size_t step_) : DevPtr<T>(data_), step(step_) {}
/** \brief stride between two consecutive rows in bytes. Step is stored always and everywhere in bytes!!! */ //! stride between two consecutive rows in bytes. Step is stored always and everywhere in bytes!!!
size_t step; size_t step;
__CV_GPU_HOST_DEVICE__ T* ptr(int y = 0) { return ( T*)( ( char*)DevPtr<T>::data + y * step); } __CV_GPU_HOST_DEVICE__ T* ptr(int y = 0) { return ( T*)( ( char*)DevPtr<T>::data + y * step); }
...@@ -148,6 +150,4 @@ namespace cv ...@@ -148,6 +150,4 @@ namespace cv
} }
} }
#endif // __cplusplus #endif /* __OPENCV_CORE_GPU_TYPES_HPP__ */
#endif /* __OPENCV_CORE_DEVPTRS_HPP__ */
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
//M*/ //M*/
#include "precomp.hpp" #include "precomp.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/core/opengl.hpp" #include "opencv2/core/opengl.hpp"
/****************************************************************************************\ /****************************************************************************************\
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "opencv2/core/utility.hpp" #include "opencv2/core/utility.hpp"
#include "opencv2/core/core_c.h" #include "opencv2/core/core_c.h"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/core/opengl.hpp" #include "opencv2/core/opengl.hpp"
#include "opencv2/core/private.hpp" #include "opencv2/core/private.hpp"
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
# error gpu.hpp header must be compiled as C++ # error gpu.hpp header must be compiled as C++
#endif #endif
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#if !defined(__OPENCV_BUILD) && !defined(OPENCV_GPU_SKIP_INCLUDE) #if !defined(__OPENCV_BUILD) && !defined(OPENCV_GPU_SKIP_INCLUDE)
#include "opencv2/opencv_modules.hpp" #include "opencv2/opencv_modules.hpp"
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
# error gpuarithm.hpp header must be compiled as C++ # error gpuarithm.hpp header must be compiled as C++
#endif #endif
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
namespace cv { namespace gpu { namespace cv { namespace gpu {
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include <memory> #include <memory>
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/gpufilters.hpp" #include "opencv2/gpufilters.hpp"
namespace cv { namespace gpu { namespace cv { namespace gpu {
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#ifndef __FGD_BGFG_COMMON_HPP__ #ifndef __FGD_BGFG_COMMON_HPP__
#define __FGD_BGFG_COMMON_HPP__ #define __FGD_BGFG_COMMON_HPP__
#include "opencv2/core/cuda_devptrs.hpp" #include "opencv2/core/gpu_types.hpp"
namespace bgfg namespace bgfg
{ {
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include <iosfwd> #include <iosfwd>
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
namespace cv { namespace gpu { namespace cv { namespace gpu {
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
# error gpufeatures2d.hpp header must be compiled as C++ # error gpufeatures2d.hpp header must be compiled as C++
#endif #endif
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/gpufilters.hpp" #include "opencv2/gpufilters.hpp"
namespace cv { namespace gpu { namespace cv { namespace gpu {
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
# error gpufilters.hpp header must be compiled as C++ # error gpufilters.hpp header must be compiled as C++
#endif #endif
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/core/base.hpp" #include "opencv2/core/base.hpp"
namespace cv { namespace gpu { namespace cv { namespace gpu {
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
# error gpuimgproc.hpp header must be compiled as C++ # error gpuimgproc.hpp header must be compiled as C++
#endif #endif
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/core/base.hpp" #include "opencv2/core/base.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
#include "opencv2/gpufilters.hpp" #include "opencv2/gpufilters.hpp"
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
#include "opencv2/ts.hpp" #include "opencv2/ts.hpp"
#include "opencv2/ts/gpu_test.hpp" #include "opencv2/ts/gpu_test.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/gpulegacy.hpp" #include "opencv2/gpulegacy.hpp"
#include "opencv2/highgui.hpp" #include "opencv2/highgui.hpp"
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
# error gpuoptflow.hpp header must be compiled as C++ # error gpuoptflow.hpp header must be compiled as C++
#endif #endif
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
namespace cv { namespace gpu { namespace cv { namespace gpu {
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
# error gpustereo.hpp header must be compiled as C++ # error gpustereo.hpp header must be compiled as C++
#endif #endif
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
namespace cv { namespace gpu { namespace cv { namespace gpu {
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
# error gpuwarping.hpp header must be compiled as C++ # error gpuwarping.hpp header must be compiled as C++
#endif #endif
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
namespace cv { namespace gpu { namespace cv { namespace gpu {
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#ifndef __OPENCV_NONFREE_GPU_HPP__ #ifndef __OPENCV_NONFREE_GPU_HPP__
#define __OPENCV_NONFREE_GPU_HPP__ #define __OPENCV_NONFREE_GPU_HPP__
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
namespace cv { namespace gpu { namespace cv { namespace gpu {
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#ifndef __OPENCV_PHOTO_GPU_HPP__ #ifndef __OPENCV_PHOTO_GPU_HPP__
#define __OPENCV_PHOTO_GPU_HPP__ #define __OPENCV_PHOTO_GPU_HPP__
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
namespace cv { namespace gpu { namespace cv { namespace gpu {
......
...@@ -43,9 +43,10 @@ ...@@ -43,9 +43,10 @@
#ifndef __OPENCV_SOFTCASCADE_HPP__ #ifndef __OPENCV_SOFTCASCADE_HPP__
#define __OPENCV_SOFTCASCADE_HPP__ #define __OPENCV_SOFTCASCADE_HPP__
#include <iosfwd>
#include "opencv2/core.hpp" #include "opencv2/core.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include <ostream>
namespace cv { namespace softcascade { namespace cv { namespace softcascade {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
// //
//M*/ //M*/
#include "opencv2/core/cuda_devptrs.hpp" #include "opencv2/core/gpu_types.hpp"
#include "opencv2/core/cuda/common.hpp" #include "opencv2/core/cuda/common.hpp"
namespace cv { namespace softcascade { namespace cudev namespace cv { namespace softcascade { namespace cudev
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#ifndef __OPENCV_ICF_HPP__ #ifndef __OPENCV_ICF_HPP__
#define __OPENCV_ICF_HPP__ #define __OPENCV_ICF_HPP__
#include "opencv2/core/cuda_devptrs.hpp" #include "opencv2/core/gpu_types.hpp"
#include "cuda_runtime_api.h" #include "cuda_runtime_api.h"
#if defined __CUDACC__ #if defined __CUDACC__
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
//M*/ //M*/
#include "test_precomp.hpp" #include "test_precomp.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#ifdef HAVE_CUDA #ifdef HAVE_CUDA
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#define __OPENCV_SOFTCASCADE_TEST_UTILITY_HPP__ #define __OPENCV_SOFTCASCADE_TEST_UTILITY_HPP__
#include "opencv2/core.hpp" #include "opencv2/core.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/ts.hpp" #include "opencv2/ts.hpp"
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#define __OPENCV_STITCHING_WARPERS_HPP__ #define __OPENCV_STITCHING_WARPERS_HPP__
#include "opencv2/core.hpp" #include "opencv2/core.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
#include "opencv2/opencv_modules.hpp" #include "opencv2/opencv_modules.hpp"
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#define __OPENCV_PERF_PRECOMP_HPP__ #define __OPENCV_PERF_PRECOMP_HPP__
#include "opencv2/core.hpp" #include "opencv2/core.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/ts.hpp" #include "opencv2/ts.hpp"
#include "opencv2/ts/gpu_perf.hpp" #include "opencv2/ts/gpu_perf.hpp"
#include "opencv2/superres.hpp" #include "opencv2/superres.hpp"
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#define __OPENCV_SUPERRES_INPUT_ARRAY_UTILITY_HPP__ #define __OPENCV_SUPERRES_INPUT_ARRAY_UTILITY_HPP__
#include "opencv2/core.hpp" #include "opencv2/core.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
namespace cv namespace cv
{ {
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#include "opencv2/opencv_modules.hpp" #include "opencv2/opencv_modules.hpp"
#include "opencv2/core.hpp" #include "opencv2/core.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/core/opengl.hpp" #include "opencv2/core/opengl.hpp"
#include "opencv2/core/utility.hpp" #include "opencv2/core/utility.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <stdexcept> #include <stdexcept>
#include "opencv2/core.hpp" #include "opencv2/core.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/highgui.hpp" #include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
#include "opencv2/ts.hpp" #include "opencv2/ts.hpp"
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include "precomp.hpp" #include "precomp.hpp"
#include "opencv2/ts/gpu_perf.hpp" #include "opencv2/ts/gpu_perf.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#ifdef HAVE_CUDA #ifdef HAVE_CUDA
#include <cuda_runtime.h> #include <cuda_runtime.h>
......
#include "precomp.hpp" #include "precomp.hpp"
#ifdef HAVE_CUDA #ifdef HAVE_CUDA
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#endif #endif
#ifdef ANDROID #ifdef ANDROID
...@@ -72,10 +72,6 @@ static void setCurrentThreadAffinityMask(int mask) ...@@ -72,10 +72,6 @@ static void setCurrentThreadAffinityMask(int mask)
} }
#endif #endif
#ifdef HAVE_CUDA
# include <opencv2/core/gpumat.hpp>
#endif
namespace { namespace {
class PerfEnvironment: public ::testing::Environment class PerfEnvironment: public ::testing::Environment
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <vector> #include <vector>
#include "opencv2/core.hpp" #include "opencv2/core.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/videostab/global_motion.hpp" #include "opencv2/videostab/global_motion.hpp"
#include "opencv2/videostab/log.hpp" #include "opencv2/videostab/log.hpp"
......
...@@ -25,7 +25,7 @@ int main() ...@@ -25,7 +25,7 @@ int main()
#include "opencv2/core/core.hpp" #include "opencv2/core/core.hpp"
#include "opencv2/core/opengl.hpp" #include "opencv2/core/opengl.hpp"
#include "opencv2/core/gpumat.hpp" #include "opencv2/core/gpu.hpp"
#include "opencv2/highgui/highgui.hpp" #include "opencv2/highgui/highgui.hpp"
using namespace std; using namespace std;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment