一个类,它封装了CUDA的特殊内存类型分配函数,具有引用计数。有关详细信息,请参阅这里
#include <opencv2/core/cuda.hpp>
|
| HostMem (const HostMem &m) |
|
| HostMem (HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED) |
|
| HostMem (InputArray arr, HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED) |
| 从主机内存复制数据创建
|
|
| HostMem (int rows, int cols, int type, HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED) |
|
| HostMem (Size size, int type, HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED) |
|
| ~HostMem () |
|
int | channels () const |
|
HostMem | clone () const |
| 返回矩阵的深拷贝,即数据被复制
|
|
void | create (int rows, int cols, int type) |
| 除非矩阵已具有指定的尺寸和类型,否则分配新的矩阵数据。
|
|
void | create (Size size, int type) |
|
GpuMat | createGpuMatHeader () const |
| 将CPU内存映射到GPU地址空间,并创建不带引用计数的cuda::GpuMat头。
|
|
Mat | createMatHeader () const |
| 返回不带引用计数的HostMem数据矩阵头。
|
|
int | depth () const |
|
size_t | elemSize () const |
|
size_t | elemSize1 () const |
|
bool | empty () const |
|
bool | isContinuous () const |
|
HostMem & | operator= (const HostMem &m) |
|
void | release () |
| 减少引用计数并在需要时释放内存。
|
|
HostMem | reshape (int cn, int rows=0) const |
|
Size | size () const |
|
size_t | step1 () const |
|
void | swap (HostMem &b) |
| 与其他智能指针交换。
|
|
int | type () const |
|
带有CUDA特殊内存类型分配函数引用计数的类。
其接口类似于Mat,但增加了内存类型参数。
- PAGE_LOCKED 设置页面锁定内存类型,通常用于从/到GPU的快速异步上传/下载数据。
- SHARED 指定零拷贝内存分配,如果支持,可以将主内存映射到GPU地址空间。
- WRITE_COMBINED 设置写合并缓冲区,不会被CPU缓存。此类缓冲区用于向GPU提供数据时,GPU只读取数据。其优点是优化CPU缓存使用。
- 注意
- 此类内存的分配大小通常有限。更多详细信息,请参阅《CUDA 2.2 Pinned Memory APIs》文档或《CUDA C Programming Guide》。
◆ AllocType
枚举值 |
---|
PAGE_LOCKED | |
SHARED | |
WRITE_COMBINED | |
◆ HostMem() [1/5]
Python |
---|
| cv.cuda.HostMem( | [, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | rows, cols, type[, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | size, type[, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | arr[, alloc_type] | ) -> | <cuda_HostMem object> |
◆ HostMem() [2/5]
cv::cuda::HostMem::HostMem |
( |
const HostMem & |
m | ) |
|
Python |
---|
| cv.cuda.HostMem( | [, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | rows, cols, type[, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | size, type[, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | arr[, alloc_type] | ) -> | <cuda_HostMem object> |
◆ HostMem() [3/5]
Python |
---|
| cv.cuda.HostMem( | [, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | rows, cols, type[, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | size, type[, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | arr[, alloc_type] | ) -> | <cuda_HostMem object> |
◆ HostMem() [4/5]
Python |
---|
| cv.cuda.HostMem( | [, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | rows, cols, type[, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | size, type[, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | arr[, alloc_type] | ) -> | <cuda_HostMem object> |
◆ HostMem() [5/5]
Python |
---|
| cv.cuda.HostMem( | [, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | rows, cols, type[, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | size, type[, alloc_type] | ) -> | <cuda_HostMem object> |
| cv.cuda.HostMem( | arr[, alloc_type] | ) -> | <cuda_HostMem object> |
◆ ~HostMem()
cv::cuda::HostMem::~HostMem |
( |
| ) |
|
◆ channels()
int cv::cuda::HostMem::channels |
( |
| ) |
const |
Python |
---|
| cv.cuda.HostMem.channels( | | ) -> | retval |
◆ clone()
HostMem cv::cuda::HostMem::clone |
( |
| ) |
const |
Python |
---|
| cv.cuda.HostMem.clone( | | ) -> | retval |
◆ create() [1/2]
void cv::cuda::HostMem::create |
( |
int |
rows, |
|
|
int |
cols, |
|
|
int |
type |
|
) |
| |
Python |
---|
| cv.cuda.HostMem.create( | rows, cols, type | ) -> | None |
除非矩阵已具有指定的尺寸和类型,否则分配新的矩阵数据。
◆ create() [2/2]
void cv::cuda::HostMem::create |
( |
Size |
size, |
|
|
int |
type |
|
) |
| |
Python |
---|
| cv.cuda.HostMem.create( | rows, cols, type | ) -> | None |
◆ createGpuMatHeader()
GpuMat cv::cuda::HostMem::createGpuMatHeader |
( |
| ) |
const |
将CPU内存映射到GPU地址空间,并创建不带引用计数的cuda::GpuMat头。
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.
◆ createMatHeader()
Mat cv::cuda::HostMem::createMatHeader |
( |
| ) |
const |
Python |
---|
| cv.cuda.HostMem.createMatHeader( | | ) -> | retval |
◆ depth()
int cv::cuda::HostMem::depth |
( |
| ) |
const |
Python |
---|
| cv.cuda.HostMem.depth( | | ) -> | retval |
◆ elemSize()
size_t cv::cuda::HostMem::elemSize |
( |
| ) |
const |
Python |
---|
| cv.cuda.HostMem.elemSize( | | ) -> | retval |
◆ elemSize1()
size_t cv::cuda::HostMem::elemSize1 |
( |
| ) |
const |
Python |
---|
| cv.cuda.HostMem.elemSize1( | | ) -> | retval |
◆ empty()
bool cv::cuda::HostMem::empty |
( |
| ) |
const |
Python |
---|
| cv.cuda.HostMem.empty( | | ) -> | retval |
◆ getAllocator()
◆ isContinuous()
bool cv::cuda::HostMem::isContinuous |
( |
| ) |
const |
Python |
---|
| cv.cuda.HostMem.isContinuous( | | ) -> | retval |
◆ operator=()
◆ release()
void cv::cuda::HostMem::release |
( |
| ) |
|
◆ reshape()
HostMem cv::cuda::HostMem::reshape |
( |
int |
cn, |
|
|
int |
rows = 0 |
|
) |
| const |
Python |
---|
| cv.cuda.HostMem.reshape( | cn[, rows] | ) -> | retval |
◆ size()
Size cv::cuda::HostMem::size |
( |
| ) |
const |
Python |
---|
| cv.cuda.HostMem.size( | | ) -> | retval |
◆ step1()
size_t cv::cuda::HostMem::step1 |
( |
| ) |
const |
Python |
---|
| cv.cuda.HostMem.step1( | | ) -> | retval |
◆ swap()
void cv::cuda::HostMem::swap |
( |
HostMem & |
b | ) |
|
Python |
---|
| cv.cuda.HostMem.swap( | b | ) -> | None |
◆ type()
int cv::cuda::HostMem::type |
( |
| ) |
const |
Python |
---|
| cv.cuda.HostMem.type( | | ) -> | retval |
◆ alloc_type
◆ cols
int cv::cuda::HostMem::cols |
◆ data
uchar* cv::cuda::HostMem::data |
◆ dataend
const uchar* cv::cuda::HostMem::dataend |
◆ datastart
uchar* cv::cuda::HostMem::datastart |
◆ flags
int cv::cuda::HostMem::flags |
◆ refcount
int* cv::cuda::HostMem::refcount |
◆ rows
int cv::cuda::HostMem::rows |
◆ step
size_t cv::cuda::HostMem::step |
本类的文档是由以下文件生成的