OpenCV453
公開型 | 公開メンバ関数 | 静的公開メンバ関数 | 公開変数類 | 全メンバ一覧

Class with reference counting wrapping special memory type allocation functions from CUDA. [詳解]

#include <cuda.hpp>

公開型

enum  AllocType { PAGE_LOCKED = 1 , SHARED = 2 , WRITE_COMBINED = 4 }
 

公開メンバ関数

CV_WRAP HostMem (HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED)
 
 HostMem (const HostMem &m)
 
CV_WRAP HostMem (int rows, int cols, int type, HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED)
 
CV_WRAP HostMem (Size size, int type, HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED)
 
CV_WRAP HostMem (InputArray arr, HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED)
 creates from host memory with coping data
 
HostMemoperator= (const HostMem &m)
 
CV_WRAP void swap (HostMem &b)
 swaps with other smart pointer
 
CV_WRAP HostMem clone () const
 returns deep copy of the matrix, i.e. the data is copied
 
CV_WRAP void create (int rows, int cols, int type)
 allocates new matrix data unless the matrix already has specified size and type.
 
void create (Size size, int type)
 
CV_WRAP HostMem reshape (int cn, int rows=0) const
 
void release ()
 decrements reference counter and released memory if needed.
 
CV_WRAP Mat createMatHeader () const
 returns matrix header with disabled reference counting for HostMem data.
 
GpuMat createGpuMatHeader () const
 Maps CPU memory to GPU address space and creates the cuda::GpuMat header without reference counting for it. [詳解]
 
CV_WRAP bool isContinuous () const
 
CV_WRAP size_t elemSize () const
 
CV_WRAP size_t elemSize1 () const
 
CV_WRAP int type () const
 
CV_WRAP int depth () const
 
CV_WRAP int channels () const
 
CV_WRAP size_t step1 () const
 
CV_WRAP Size size () const
 
CV_WRAP bool empty () const
 

静的公開メンバ関数

static MatAllocatorgetAllocator (HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED)
 

公開変数類

int flags
 
int rows
 
int cols
 
CV_PROP size_t step
 
uchar * data
 
int * refcount
 
uchar * datastart
 
const uchar * dataend
 
AllocType alloc_type
 

詳解

Class with reference counting wrapping special memory type allocation functions from CUDA.

Its interface is also Mat-like but with additional memory type parameters.

覚え書き
Allocation size of such memory types is usually limited. For more details, see CUDA 2.2 Pinned Memory APIs document or CUDA C Programming Guide.

関数詳解

◆ createGpuMatHeader()

GpuMat cv::cuda::HostMem::createGpuMatHeader ( ) const

Maps CPU memory to GPU address space and creates the cuda::GpuMat header without reference counting for it.

This can be done only if memory was allocated with the SHARED flag and if it is supported by the hardware. Laptops often share video and CPU memory, so address spaces can be mapped, which eliminates an extra copy.

◆ reshape()

CV_WRAP HostMem cv::cuda::HostMem::reshape ( int  cn,
int  rows = 0 
) const

creates alternative HostMem header for the same data, with different number of channels and/or different number of rows


このクラス詳解は次のファイルから抽出されました: