@Namespace(value="c10::cuda::CUDACachingAllocator") @Properties(inherit=torch_cuda.class) public class CUDAAllocator extends DeviceAllocator
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
CUDAAllocator(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
DataPtr |
allocateWithAddress(long size,
Pointer addr) |
void |
attachAllocatorTraceTracker(AllocatorTraceTracker tracker) |
void |
attachOomRejectionObserver(AllocatorTraceTracker observer) |
void |
attachOutOfMemoryObserver(AllocatorTraceTracker observer) |
void |
beginAllocateToPool(byte device,
LongPair mempool_id,
StreamFilter filter) |
void |
cacheInfo(byte device,
SizeTPointer largestBlock) |
boolean |
checkPoolLiveAllocations(byte arg0,
LongPair arg1,
PointerSet arg2) |
void |
createOrIncrefPool(byte arg0,
LongPair arg1) |
void |
createOrIncrefPool(byte arg0,
LongPair arg1,
CUDAAllocator allocator) |
void |
enable(boolean value) |
void |
enablePeerAccess(byte dev,
byte dev_to_access) |
void |
endAllocateToPool(byte device,
LongPair mempool_id) |
Pointer |
getBaseAllocation(Pointer ptr,
SizeTPointer size) |
AllocatorState |
getCheckpointState(byte device,
LongPair id) |
GatheredContext |
getContextForPointer(Pointer ptr) |
StreamSegmentSize |
getExpandableSegmentSizes(byte device) |
Pointer |
getIpcDevPtr(BytePointer handle) |
Pointer |
getIpcDevPtr(String handle) |
double |
getMemoryFraction(byte device) |
SizeTPair |
getMemoryInfo(byte device) |
int |
getPoolUseCount(byte arg0,
LongPair arg1) |
BytePointer |
getUserMetadata() |
void |
init(int device_count) |
boolean |
isEnabled() |
boolean |
isHistoryEnabled() |
void |
markCaptureBegin(byte arg0) |
void |
markCaptureEnd(byte arg0) |
int |
memcpyAsync(Pointer dst,
int dstDevice,
Pointer src,
int srcDevice,
long count,
org.bytedeco.cuda.cudart.CUstream_st stream,
boolean p2p_enabled) |
BytePointer |
name() |
void |
popCompileContext() |
void |
pushCompileContext(BytePointer md) |
Pointer |
raw_alloc_with_stream(long nbytes,
org.bytedeco.cuda.cudart.CUstream_st stream) |
Pointer |
raw_alloc(long nbytes) |
void |
raw_delete(Pointer ptr) |
void |
recordAnnotation(StringPair arg0) |
void |
recordHistory(boolean enabled,
Pointer context_recorder,
long alloc_trace_max_entries,
int when,
boolean clearHistory,
StringVector skip_actions) |
void |
recordHistory(boolean enabled,
Pointer context_recorder,
long alloc_trace_max_entries,
torch_cuda.RecordContext when,
boolean clearHistory,
StringVector skip_actions) |
void |
recordStream(DataPtr ptr,
CUDAStream stream) |
void |
recordStream(DataPtr ptr,
Stream stream) |
void |
releasePool(byte device,
LongPair mempool_id) |
CheckpointDelta |
setCheckpointPoolState(byte device,
AllocatorState pps) |
void |
setMemoryFraction(double fraction,
byte device) |
void |
setNoSplit(byte device,
LongPair mempool_id) |
void |
setUseOnOOM(byte device,
LongPair mempool_id,
boolean use_on_oom) |
void |
setUserMetadata(BytePointer metadata) |
void |
setUserMetadata(String metadata) |
ShareableHandle |
shareIpcHandle(Pointer ptr) |
SnapshotInfo |
snapshot() |
SnapshotInfo |
snapshot(LongPair mempool_id,
boolean include_traces) |
emptyCache, emptyCache, getDeviceStats, initialized, resetAccumulatedStats, resetPeakStats_allocate, clone, copy_data, is_simple_data_ptr, raw_allocate, raw_deallocate, raw_deleteraddress, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, trimMemory, withDeallocator, zeropublic CUDAAllocator(Pointer p)
Pointer(Pointer).public Pointer raw_alloc_with_stream(@Cast(value="size_t") long nbytes, org.bytedeco.cuda.cudart.CUstream_st stream)
public void raw_delete(Pointer ptr)
public void init(int device_count)
public double getMemoryFraction(byte device)
public void setMemoryFraction(double fraction,
byte device)
@StdVector public StreamSegmentSize getExpandableSegmentSizes(byte device)
public void cacheInfo(byte device,
@Cast(value="size_t*")
SizeTPointer largestBlock)
public Pointer getBaseAllocation(Pointer ptr, @Cast(value="size_t*") SizeTPointer size)
public void recordStream(@StdMove DataPtr ptr, @ByVal CUDAStream stream)
public void recordStream(@StdMove DataPtr ptr, @ByVal Stream stream)
recordStream in class DeviceAllocator@ByVal public SnapshotInfo snapshot(@ByVal(nullValue="c10::MempoolId_t({0, 0})") LongPair mempool_id, @Cast(value="bool") boolean include_traces)
@ByVal public SnapshotInfo snapshot()
public void beginAllocateToPool(byte device,
@ByVal
LongPair mempool_id,
@ByVal
StreamFilter filter)
public void markCaptureBegin(byte arg0)
public void markCaptureEnd(byte arg0)
public void createOrIncrefPool(byte arg0,
@ByVal
LongPair arg1,
@SharedPtr
CUDAAllocator allocator)
public void setUseOnOOM(byte device,
@ByVal
LongPair mempool_id,
@Cast(value="bool")
boolean use_on_oom)
@Cast(value="bool") public boolean checkPoolLiveAllocations(byte arg0, @ByVal LongPair arg1, @Const @ByRef PointerSet arg2)
@ByVal public ShareableHandle shareIpcHandle(Pointer ptr)
@SharedPtr public Pointer getIpcDevPtr(@StdString BytePointer handle)
@SharedPtr public Pointer getIpcDevPtr(@StdString String handle)
@SharedPtr public GatheredContext getContextForPointer(@Const Pointer ptr)
public void recordHistory(@Cast(value="bool") boolean enabled, @ByVal @Cast(value="c10::cuda::CUDACachingAllocator::CreateContextFn*") Pointer context_recorder, @Cast(value="size_t") long alloc_trace_max_entries, torch_cuda.RecordContext when, @Cast(value="bool") boolean clearHistory, @Const @ByRef StringVector skip_actions)
public void recordHistory(@Cast(value="bool") boolean enabled, @ByVal @Cast(value="c10::cuda::CUDACachingAllocator::CreateContextFn*") Pointer context_recorder, @Cast(value="size_t") long alloc_trace_max_entries, @Cast(value="c10::CachingDeviceAllocator::RecordContext") int when, @Cast(value="bool") boolean clearHistory, @Const @ByRef StringVector skip_actions)
public void recordAnnotation(@StdVector StringPair arg0)
public void pushCompileContext(@StdString @ByRef BytePointer md)
public void popCompileContext()
public void setUserMetadata(@StdString BytePointer metadata)
public void setUserMetadata(@StdString String metadata)
@StdString public BytePointer getUserMetadata()
public void attachOutOfMemoryObserver(@ByVal @Cast(value="c10::cuda::CUDACachingAllocator::OutOfMemoryObserver*") AllocatorTraceTracker observer)
public void attachOomRejectionObserver(@ByVal @Cast(value="c10::cuda::CUDACachingAllocator::OomRejectionObserver*") AllocatorTraceTracker observer)
public void attachAllocatorTraceTracker(@ByVal AllocatorTraceTracker tracker)
public void enablePeerAccess(byte dev,
byte dev_to_access)
@Cast(value="cudaError_t") public int memcpyAsync(Pointer dst, int dstDevice, @Const Pointer src, int srcDevice, @Cast(value="size_t") long count, org.bytedeco.cuda.cudart.CUstream_st stream, @Cast(value="bool") boolean p2p_enabled)
@SharedPtr(value="c10::cuda::CUDACachingAllocator::AllocatorState") @ByVal public AllocatorState getCheckpointState(byte device, @ByVal LongPair id)
@ByVal public CheckpointDelta setCheckpointPoolState(byte device, @SharedPtr(value="c10::cuda::CUDACachingAllocator::AllocatorState") @ByVal AllocatorState pps)
@StdMove public DataPtr allocateWithAddress(@Cast(value="size_t") long size, Pointer addr)
@StdString public BytePointer name()
@ByVal public SizeTPair getMemoryInfo(byte device)
getMemoryInfo in class DeviceAllocatorCopyright © 2026. All rights reserved.