43
#ifndef OPENCV_CORE_CUDA_TYPES_HPP
44
#define OPENCV_CORE_CUDA_TYPES_HPP
47
# error cuda_types.hpp header must be compiled as C++
50
#if defined(__OPENCV_BUILD) && defined(__clang__)
51
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
53
#if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5
54
#pragma GCC diagnostic ignored "-Wsuggest-override"
64
#define __CV_CUDA_HOST_DEVICE__ __host__ __device__ __forceinline__
66
#define __CV_CUDA_HOST_DEVICE__
77
template
<
typename
T>
struct
DevPtr
80
typedef
int
index_type;
82
enum
{ elem_size =
sizeof(elem_type) };
86
__CV_CUDA_HOST_DEVICE__ DevPtr() : data(0) {}
87
__CV_CUDA_HOST_DEVICE__ DevPtr(T* data_) : data(data_) {}
89
__CV_CUDA_HOST_DEVICE__
size_t
elemSize()
const
{
return
elem_size; }
90
__CV_CUDA_HOST_DEVICE__
operator
T*() {
return
data; }
91
__CV_CUDA_HOST_DEVICE__
operator
const
T*()
const
{
return
data; }
94
template
<
typename
T>
struct
PtrSz :
public
DevPtr<T>
96
__CV_CUDA_HOST_DEVICE__ PtrSz() : size(0) {}
97
__CV_CUDA_HOST_DEVICE__ PtrSz(T* data_,
size_t
size_) : DevPtr<T>(data_), size(size_) {}
102
template
<
typename
T>
struct
PtrStep :
public
DevPtr<T>
104
__CV_CUDA_HOST_DEVICE__ PtrStep() : step(0) {}
105
__CV_CUDA_HOST_DEVICE__ PtrStep(T* data_,
size_t
step_) : DevPtr<T>(data_), step(step_) {}
109
__CV_CUDA_HOST_DEVICE__ T* ptr(
int
y = 0) {
return
( T*)( (
char*)(((DevPtr<T>*)
this)->data) + y * step); }
110
__CV_CUDA_HOST_DEVICE__
const
T* ptr(
int
y = 0)
const
{
return
(
const
T*)( (
const
char*)(((DevPtr<T>*)
this)->data) + y * step); }
112
__CV_CUDA_HOST_DEVICE__ T& operator ()(
int
y,
int
x) {
return
ptr(y)[x]; }
113
__CV_CUDA_HOST_DEVICE__
const
T& operator ()(
int
y,
int
x)
const
{
return
ptr(y)[x]; }
116
template
<
typename
T>
struct
PtrStepSz :
public
PtrStep<T>
118
__CV_CUDA_HOST_DEVICE__ PtrStepSz() : cols(0), rows(0) {}
119
__CV_CUDA_HOST_DEVICE__ PtrStepSz(
int
rows_,
int
cols_, T* data_,
size_t
step_)
120
: PtrStep<T>(data_, step_), cols(cols_), rows(rows_) {}
122
template
<
typename
U>
123
explicit
PtrStepSz(
const
PtrStepSz<U>& d) : PtrStep<T>((T*)d.data, d.step), cols(d.cols), rows(d.rows){}
129
typedef
PtrStepSz<unsigned char> PtrStepSzb;
130
typedef
PtrStepSz<unsigned short> PtrStepSzus;
131
typedef
PtrStepSz<float> PtrStepSzf;
132
typedef
PtrStepSz<int> PtrStepSzi;
134
typedef
PtrStep<unsigned char> PtrStepb;
135
typedef
PtrStep<unsigned short> PtrStepus;
136
typedef
PtrStep<float> PtrStepf;
137
typedef
PtrStep<int> PtrStepi;
"black box" representation of the file storage associated with a file on disk.
Definition:
aruco.hpp:75