@Namespace(value="c10") @NoOffset @Properties(inherit=torch.class) public class OptionalDeviceGuard extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
OptionalDeviceGuard()
Create an uninitialized guard.
|
OptionalDeviceGuard(Device device)
Initialize the guard, setting the current device to the passed Device.
|
OptionalDeviceGuard(Device device,
DeviceGuardImplInterface impl)
Constructor for testing only.
|
OptionalDeviceGuard(DeviceOptional device)
Initialize the guard if a Device is passed; otherwise leave the
guard uninitialized.
|
OptionalDeviceGuard(long size)
Native array allocator.
|
OptionalDeviceGuard(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
DeviceOptional |
current_device()
Returns the most recent device that was set using this device guard,
either from construction, or via reset_device.
|
OptionalDeviceGuard |
getPointer(long i) |
DeviceOptional |
original_device()
Returns the device that was set at the time the guard was constructed.
|
OptionalDeviceGuard |
position(long position) |
void |
reset_device(Device device)
Sets the device to the given one.
|
void |
reset_device(Device device,
DeviceGuardImplInterface impl)
For testing only
|
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 OptionalDeviceGuard(Pointer p)
Pointer(Pointer)
.public OptionalDeviceGuard(long size)
Pointer.position(long)
.public OptionalDeviceGuard()
public OptionalDeviceGuard(@ByVal Device device)
public OptionalDeviceGuard(@ByVal DeviceOptional device)
public OptionalDeviceGuard(@ByVal Device device, @Const DeviceGuardImplInterface impl)
public OptionalDeviceGuard position(long position)
public OptionalDeviceGuard getPointer(long i)
getPointer
in class Pointer
public void reset_device(@ByVal Device device)
public void reset_device(@ByVal Device device, @Const DeviceGuardImplInterface impl)
@ByVal public DeviceOptional original_device()
@ByVal public DeviceOptional current_device()
Copyright © 2024. All rights reserved.