public class CudaMemoryBuffer extends BaseDeviceMemoryBuffer
MemoryBuffer.EventHandler, MemoryBuffer.MemoryBufferCleaner| Constructor and Description |
|---|
CudaMemoryBuffer(long address,
long lengthInBytes,
Cuda.Stream stream)
Wrap an existing CUDA allocation in a device memory buffer.
|
| Modifier and Type | Method and Description |
|---|---|
static CudaMemoryBuffer |
allocate(long bytes)
Allocate memory for use on the GPU.
|
static CudaMemoryBuffer |
allocate(long bytes,
Cuda.Stream stream)
Allocate memory for use on the GPU.
|
CudaMemoryBuffer |
slice(long offset,
long len)
Slice off a part of the device buffer.
|
copyFromDeviceBufferAsync, copyFromHostBuffer, copyFromHostBuffer, copyFromHostBuffer, copyFromHostBuffer, copyFromHostBuffer, copyFromHostBufferAsync, copyFromHostBufferAsync, sliceWithCopyaddressOutOfBoundsCheck, close, copyFromMemoryBuffer, copyFromMemoryBufferAsync, getAddress, getEventHandler, getLength, getRefCount, incRefCount, noWarnLeakExpected, setEventHandler, toStringpublic CudaMemoryBuffer(long address,
long lengthInBytes,
Cuda.Stream stream)
address - device address of the CUDA memory allocationlengthInBytes - length of the CUDA allocation in bytesstream - CUDA stream to use for synchronization when freeing the allocationpublic static CudaMemoryBuffer allocate(long bytes)
bytes - size in bytes to allocatepublic static CudaMemoryBuffer allocate(long bytes, Cuda.Stream stream)
bytes - size in bytes to allocatestream - The stream in which to synchronize this commandpublic final CudaMemoryBuffer slice(long offset, long len)
slice in class MemoryBufferoffset - where to start the slice at.len - how many bytes to sliceCopyright © 2023. All rights reserved.