pub struct GpuDeviceCtx {
pub device_id: u32,
pub stream: StreamGuard,
}Expand description
Thin context for all GPU operations in the explicit-stream path.
Fields§
§device_id: u32§stream: StreamGuardImplementations§
Source§impl GpuDeviceCtx
impl GpuDeviceCtx
Sourcepub fn for_device(device_id: u32) -> Result<Self, CudaError>
pub fn for_device(device_id: u32) -> Result<Self, CudaError>
Creates a new GpuDeviceCtx for the given device.
NOTE: This calls set_device_by_id as a side effect, changing the
current CUDA device for the calling thread.
pub fn for_current_device() -> Result<Self, CudaError>
Trait Implementations§
Source§impl Clone for GpuDeviceCtx
impl Clone for GpuDeviceCtx
Source§fn clone(&self) -> GpuDeviceCtx
fn clone(&self) -> GpuDeviceCtx
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GpuDeviceCtx
impl RefUnwindSafe for GpuDeviceCtx
impl Send for GpuDeviceCtx
impl Sync for GpuDeviceCtx
impl Unpin for GpuDeviceCtx
impl UnsafeUnpin for GpuDeviceCtx
impl UnwindSafe for GpuDeviceCtx
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
Mutably borrows from an owned value. Read more