pub struct CudaBackendContext {
pub ctx: Arc<CudaContext>,
pub stream: Arc<CudaStream>,
pub module: PtxModuleCache,
pub arena: Mutex<DeviceArena>,
}Expand description
The process-wide device handles every cudarc backend stores after a
successful probe: the CudaContext, its default CudaStream, the
lazily NVRTC-compiled PtxModuleCache, and the bucketed
DeviceArena of reusable f64 device buffers (held under a Mutex
because large-scale fits dispatch from multiple rayon worker threads; the
mutex is only held during alloc / release, not across kernel
launches). Module-specific backends (bms_flex, survival_flex, …)
wrap one of these as their inner context so the host-side
scaffolding (arena pooling, module cache, mutex around alloc) is
uniform instead of duplicated per backend.
Fields§
§ctx: Arc<CudaContext>§stream: Arc<CudaStream>§module: PtxModuleCache§arena: Mutex<DeviceArena>Implementations§
Source§impl CudaBackendContext
impl CudaBackendContext
Sourcepub fn from_parts(parts: CudaBackendParts) -> Self
pub fn from_parts(parts: CudaBackendParts) -> Self
Build the stored context from a fresh CudaBackendParts probe
result: adopt its context and stream, start an empty module cache
(the backend’s eager-compile step fills it), and an empty device
arena. The probe’s compute capability is consumed by the probe
path itself and is not retained here.
Auto Trait Implementations§
impl !Freeze for CudaBackendContext
impl RefUnwindSafe for CudaBackendContext
impl Send for CudaBackendContext
impl Sync for CudaBackendContext
impl Unpin for CudaBackendContext
impl UnsafeUnpin for CudaBackendContext
impl UnwindSafe for CudaBackendContext
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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 more