@Namespace(value="c10::cuda") @NoOffset @Properties(inherit=torch_cuda.class) public class CUDAGuard extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
CUDAGuard(byte device_index)
Set the current CUDA device to the passed device index.
|
CUDAGuard(Device device)
Sets the current CUDA device to the passed device.
|
CUDAGuard(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
Device |
current_device()
Returns the last device that was set via
set_device , if any, otherwise
the device passed during construction. |
Device |
original_device()
Returns the device that was set upon construction of the guard
|
void |
reset_device(Device device)
Sets the CUDA device to the given device.
|
void |
set_device(Device device)
Sets the CUDA device to the given device.
|
void |
set_index(byte device_index)
Sets the CUDA device to the given device index.
|
address, 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, withDeallocator, zero
public CUDAGuard(Pointer p)
Pointer(Pointer)
.public CUDAGuard(byte device_index)
public void set_device(@ByVal Device device)
public void reset_device(@ByVal Device device)
public void set_index(byte device_index)
@ByVal public Device original_device()
Copyright © 2024. All rights reserved.