docsapi referencedarkforest-cuda-context-cudacontext
API Referencecrate: darkforest-cudasince v0.1.1-alpha

CudaContext

Device runtime management context initializing driver states and cuBLAS handles.

CudaContext

darkforest-cuda module: context since v0.1.1-alpha

Signature

rust
pub struct CudaContext { device_id: i32, primary_stream: cudaStream_t, cublas_handle: cublasHandle_t }

Overview

Device runtime management context initializing driver states and cuBLAS handles.

Invariants & Design Principles

  • Invariant: Single primary context per physical GPU ID.

Usage Example

rust
let ctx = CudaContext::init(0);

Related Components