@Namespace(value="cv::cuda") @NoOffset @Properties(inherit=opencv_core.class) public class HostMem extends Pointer
Its interface is also Mat-like but with additional memory type parameters.
- **PAGE_LOCKED** sets a page locked memory type used commonly for fast and asynchronous uploading/downloading data from/to GPU. - **SHARED** specifies a zero copy memory allocation that enables mapping the host memory to GPU address space, if supported. - **WRITE_COMBINED** sets the write combined buffer that is not cached by CPU. Such buffers are used to supply GPU with data when GPU only reads it. The advantage is a better CPU cache utilization.
\note 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*.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Modifier and Type | Field and Description |
---|---|
static int |
PAGE_LOCKED
enum cv::cuda::HostMem::AllocType
|
static int |
SHARED
enum cv::cuda::HostMem::AllocType
|
static int |
WRITE_COMBINED
enum cv::cuda::HostMem::AllocType
|
Constructor and Description |
---|
HostMem() |
HostMem(GpuMat arr) |
HostMem(GpuMat arr,
int alloc_type) |
HostMem(HostMem m) |
HostMem(int alloc_type) |
HostMem(int rows,
int cols,
int type) |
HostMem(int rows,
int cols,
int type,
int alloc_type) |
HostMem(Mat arr) |
HostMem(Mat arr,
int alloc_type)
creates from host memory with coping data
|
HostMem(Pointer p)
Pointer cast constructor.
|
HostMem(Size size,
int type) |
HostMem(Size size,
int type,
int alloc_type) |
HostMem(UMat arr) |
HostMem(UMat arr,
int alloc_type) |
Modifier and Type | Method and Description |
---|---|
int |
alloc_type() |
HostMem |
alloc_type(int setter) |
int |
channels() |
HostMem |
clone()
returns deep copy of the matrix, i.e.
|
int |
cols() |
HostMem |
cols(int setter) |
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) |
GpuMat |
createGpuMatHeader()
\brief Maps CPU memory to GPU address space and creates the cuda::GpuMat header without reference counting
for it.
|
Mat |
createMatHeader()
returns matrix header with disabled reference counting for HostMem data.
|
BytePointer |
data() |
HostMem |
data(BytePointer setter) |
BytePointer |
dataend() |
HostMem |
dataend(BytePointer setter) |
BytePointer |
datastart() |
HostMem |
datastart(BytePointer setter) |
int |
depth() |
long |
elemSize() |
long |
elemSize1() |
boolean |
empty() |
int |
flags() |
HostMem |
flags(int setter) |
static MatAllocator |
getAllocator() |
static MatAllocator |
getAllocator(int alloc_type) |
boolean |
isContinuous() |
HostMem |
put(HostMem m) |
IntPointer |
refcount() |
HostMem |
refcount(IntPointer setter) |
void |
release()
decrements reference counter and released memory if needed.
|
HostMem |
reshape(int cn) |
HostMem |
reshape(int cn,
int rows)
creates alternative HostMem header for the same data, with different
number of channels and/or different number of rows
|
int |
rows() |
HostMem |
rows(int setter) |
Size |
size() |
long |
step() |
HostMem |
step(long setter) |
long |
step1() |
void |
swap(HostMem b)
swaps with other smart pointer
|
int |
type() |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public static final int PAGE_LOCKED
public static final int SHARED
public static final int WRITE_COMBINED
public HostMem(Pointer p)
Pointer.Pointer(Pointer)
.public HostMem()
public HostMem(int rows, int cols, int type, @Cast(value="cv::cuda::HostMem::AllocType") int alloc_type)
public HostMem(int rows, int cols, int type)
public HostMem(@ByVal Size size, int type, @Cast(value="cv::cuda::HostMem::AllocType") int alloc_type)
public HostMem(@ByVal Mat arr, @Cast(value="cv::cuda::HostMem::AllocType") int alloc_type)
public HostMem(@ByVal GpuMat arr, @Cast(value="cv::cuda::HostMem::AllocType") int alloc_type)
public static MatAllocator getAllocator(@Cast(value="cv::cuda::HostMem::AllocType") int alloc_type)
public static MatAllocator getAllocator()
public void create(int rows, int cols, int type)
@ByVal public HostMem reshape(int cn, int rows)
public void release()
@ByVal public Mat createMatHeader()
@ByVal public GpuMat createGpuMatHeader()
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.
public int type()
public int depth()
public int channels()
public int flags()
public HostMem flags(int setter)
public int rows()
public HostMem rows(int setter)
public int cols()
public HostMem cols(int setter)
public HostMem step(long setter)
@Cast(value="uchar*") public BytePointer data()
public HostMem data(BytePointer setter)
public IntPointer refcount()
public HostMem refcount(IntPointer setter)
@Cast(value="uchar*") public BytePointer datastart()
public HostMem datastart(BytePointer setter)
@Cast(value="const uchar*") public BytePointer dataend()
public HostMem dataend(BytePointer setter)
public HostMem alloc_type(int setter)
Copyright © 2020. All rights reserved.