pub struct Stream { /* private fields */ }Expand description
A stream of evaluation attached to a particular device.
Typically, this is used via the stream: parameter on a method with a StreamOrDevice:
Implementations§
Source§impl Stream
impl Stream
Sourcepub fn thread_local_or_default() -> Self
pub fn thread_local_or_default() -> Self
Create a new stream on the default device, or return the thread-local default stream if present.
Sourcepub fn thread_local_or_cpu() -> Self
pub fn thread_local_or_cpu() -> Self
Create a new stream on the default cpu device, or return the thread-local default stream if present.
Sourcepub fn thread_local_or_gpu() -> Self
pub fn thread_local_or_gpu() -> Self
Create a new stream on the default gpu device, or return the thread-local default stream if present.
Sourcepub fn task_local_or_default() -> Self
👎Deprecated since 0.26.0: use Stream::thread_local_or_default
pub fn task_local_or_default() -> Self
use Stream::thread_local_or_default
Returns the thread-local scoped stream or the default stream.
Sourcepub fn task_local_or_cpu() -> Self
👎Deprecated since 0.26.0: use Stream::thread_local_or_cpu
pub fn task_local_or_cpu() -> Self
use Stream::thread_local_or_cpu
Returns the thread-local scoped stream or the CPU stream.
Sourcepub fn task_local_or_gpu() -> Self
👎Deprecated since 0.26.0: use Stream::thread_local_or_gpu
pub fn task_local_or_gpu() -> Self
use Stream::thread_local_or_gpu
Returns the thread-local scoped stream or the GPU stream.
Sourcepub fn try_default_on_device(device: &Device) -> Result<Stream>
pub fn try_default_on_device(device: &Device) -> Result<Stream>
Try to get the default stream on the given device.
Sourcepub fn new_with_device(device: &Device) -> Stream
pub fn new_with_device(device: &Device) -> Stream
Create a new stream on the given device
Trait Implementations§
Source§impl AsRef<Stream> for StreamOrDevice
impl AsRef<Stream> for StreamOrDevice
Auto Trait Implementations§
impl !Send for Stream
impl !Sync for Stream
impl Freeze for Stream
impl RefUnwindSafe for Stream
impl Unpin for Stream
impl UnsafeUnpin for Stream
impl UnwindSafe for Stream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Option.