@Namespace(value="c10::cuda") @NoOffset @Properties(inherit=torch_cuda.class) public class CUDAStreamGuard extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
CUDAStreamGuard(Pointer p)
Pointer cast constructor.
|
CUDAStreamGuard(Stream stream)
Set the current CUDA device to the device associated with the passed
stream, and set the current CUDA stream on that device to the passed
stream.
|
Modifier and Type | Method and Description |
---|---|
Device |
current_device()
Returns the most recent CUDA device that was set using this device guard,
either from construction, or via set_device/reset_device/set_index.
|
CUDAStream |
current_stream()
Returns the most recent CUDA stream that was set using this device guard,
either from construction, or via set_stream.
|
Device |
original_device()
Returns the CUDA device that was set at the most recent reset_stream(),
or otherwise the device at construction time.
|
CUDAStream |
original_stream()
Returns the CUDA stream that was set at the time the guard was
constructed.
|
void |
reset_stream(Stream stream)
Resets the currently set stream to the original stream and
the currently set device to the original device.
|
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 CUDAStreamGuard(Pointer p)
Pointer(Pointer)
.public void reset_stream(@ByVal Stream stream)
@ByVal public CUDAStream original_stream()
@ByVal public CUDAStream current_stream()
@ByVal public Device current_device()
Copyright © 2024. All rights reserved.