pub struct CuestContext { /* private fields */ }Expand description
A cuEST context: the library handle bound to one CUDA stream.
This is the root object of the API; all other objects are created from it (directly or transitively) and keep it alive.
Implementations§
Source§impl CuestContext
impl CuestContext
Sourcepub fn new(stream: &Arc<CudaStream>) -> Result<Self, CuestError>
pub fn new(stream: &Arc<CudaStream>) -> Result<Self, CuestError>
Create a context on stream with default handle parameters.
Sourcepub fn with_options(
stream: &Arc<CudaStream>,
options: &CuestHandleOptions,
) -> Result<Self, CuestError>
pub fn with_options( stream: &Arc<CudaStream>, options: &CuestHandleOptions, ) -> Result<Self, CuestError>
Create a context on stream with explicit handle parameters.
The stream’s device is made current on the calling thread (the
cudaSetDevice equivalent) before the handle is created, as cuEST
requires.
Sourcepub fn stream(&self) -> &Arc<CudaStream> ⓘ
pub fn stream(&self) -> &Arc<CudaStream> ⓘ
The CUDA stream this context’s handle is bound to.
Sourcepub fn version(&self) -> (u32, u32, u32)
pub fn version(&self) -> (u32, u32, u32)
cuEST library version (major, minor, patch) reported at creation.
Sourcepub fn math_mode(&self) -> Result<CuestMathMode, CuestError>
pub fn math_mode(&self) -> Result<CuestMathMode, CuestError>
The math mode of this handle.
Sourcepub fn set_math_mode(&self, mode: CuestMathMode) -> Result<(), CuestError>
pub fn set_math_mode(&self, mode: CuestMathMode) -> Result<(), CuestError>
Set the math mode of this handle.
Sourcepub fn compute_capability_target(&self) -> Result<(u32, u32), CuestError>
pub fn compute_capability_target(&self) -> Result<(u32, u32), CuestError>
The compute capability (major, minor) used for heuristics.
Sourcepub fn set_compute_capability_target(
&self,
major: u32,
minor: u32,
) -> Result<(), CuestError>
pub fn set_compute_capability_target( &self, major: u32, minor: u32, ) -> Result<(), CuestError>
Override the compute capability used for heuristics (not for kernel execution or JIT compilation); see the cuEST documentation.
Sourcepub fn raw_handle(&self) -> cuestHandle_t
pub fn raw_handle(&self) -> cuestHandle_t
The raw cuEST handle (escape hatch for API surface not wrapped yet).