@Namespace(value="nvinfer1") @Properties(inherit=nvinfer.class) public class IGpuAllocator extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
IGpuAllocator()
Destructor declared virtual as general good practice for a class with virtual methods.
|
IGpuAllocator(long size)
Native array allocator.
|
IGpuAllocator(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
Pointer |
_allocate(long size,
long alignment,
int flags)
A thread-safe callback implemented by the application to handle acquisition of GPU memory.
|
boolean |
_deallocate(Pointer memory)
A thread-safe callback implemented by the application to handle release of GPU memory.
|
void |
_free(Pointer memory)
Deprecated.
Deprecated in TensorRT 8.0. Superseded by deallocate.
\usage
- Allowed context for the API call
- Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads.
|
IGpuAllocator |
getPointer(long i) |
IGpuAllocator |
position(long position) |
Pointer |
reallocate(Pointer arg0,
long arg1,
long arg2)
A thread-safe callback implemented by the application to resize an existing allocation.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public IGpuAllocator(Pointer p)
Pointer(Pointer)
.public IGpuAllocator(long size)
Pointer.position(long)
.public IGpuAllocator()
public IGpuAllocator position(long position)
public IGpuAllocator getPointer(long i)
getPointer
in class Pointer
@Virtual(value=true) @Name(value="allocate") @NoException(value=true) public Pointer _allocate(@Cast(value="const uint64_t") long size, @Cast(value="const uint64_t") long alignment, @Cast(value="const nvinfer1::AllocatorFlags") int flags)
size
- The size of the memory required.alignment
- The required alignment of memory. Alignment will be zero
or a power of 2 not exceeding the alignment guaranteed by cudaMalloc.
Thus this allocator can be safely implemented with cudaMalloc/cudaFree.
An alignment value of zero indicates any alignment is acceptable.flags
- Reserved for future use. In the current release, 0 will be passed.
If an allocation request of size 0 is made, nullptr should be returned.
If an allocation request cannot be satisfied, nullptr should be returned.
\note The implementation must guarantee thread safety for concurrent allocate/free/reallocate/deallocate
requests.
\usage
- Allowed context for the API call
- Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads.@Virtual(value=true) @Deprecated @Name(value="free") @NoException(value=true) public void _free(Pointer memory)
memory
- The acquired memory.
\note The implementation must guarantee thread safety for concurrent allocate/free/reallocate/deallocate
requests.Pointer.deallocate()
@Virtual @NoException(value=true) public Pointer reallocate(Pointer arg0, @Cast(value="uint64_t") long arg1, @Cast(value="uint64_t") long arg2)
baseAddr
- the address of the original allocation.alignment
- The alignment used by the original allocation.newSize
- The new memory size required.@Virtual @Cast(value="bool") @Name(value="deallocate") @NoException(value=true) public boolean _deallocate(Pointer memory)
memory
- The acquired memory.\usage
- Allowed context for the API call
- Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads.
Copyright © 2024. All rights reserved.