Skip to main content

RngDispatch

Trait RngDispatch 

Source
pub trait RngDispatch: Send + 'static {
    // Required method
    fn fill(
        self: Box<Self>,
        generator: curandGenerator_t,
        stream: &Arc<CudaStream>,
        completion: &Arc<dyn CompletionStrategy>,
    ) -> Result<(), GpuError>;
}
Expand description

Erased payload accepted by RngActor via RngMsg::Fill.

The actor takes the cuRAND generator lock and hands it to fill along with the stream + completion strategy. Implementors call cudarc::curand::sys::curandGenerate* (or the safe wrapper), keep-alive their GpuRef<T> via kernel::envelope::run_kernel, and reply on the embedded oneshot channel.

Required Methods§

Source

fn fill( self: Box<Self>, generator: curandGenerator_t, stream: &Arc<CudaStream>, completion: &Arc<dyn CompletionStrategy>, ) -> Result<(), GpuError>

Implementors§