Skip to main content

Module curand

Module curand 

Source
Expand description

Thin Rust-level wrappers over [cudarc::curand::sys] for the cuRAND host-API entry points that aren’t surfaced by the safe [cudarc::curand::CudaRng] handle:

  • generator creation by explicit curandRngType_t (Philox4_32_10, XORWOW, MTGP32, MRG32K3A, plus all four Sobol variants);
  • the host-API generator pair (curandCreateGeneratorHost — fills host buffers, copies internally);
  • curandSetQuasiRandomGeneratorDimensions, curandSetGeneratorOrdering, curandSetGeneratorOffset;
  • the Poisson and bit-generator families (curandGeneratePoisson, curandGenerate, curandGenerateLongLong).

These functions are unsafe — they take the raw curandGenerator_t and require the caller to keep the generator alive, valid, and bound to a stream that the destination pointer lives on. The actor in kernel/rng/* is the only intended caller.

Enums§

RngGeneratorKind
Public mirror of [sys::curandRngType_t] so callers don’t have to take a cudarc::curand::sys::* symbol on their public API. The numeric values match cuRAND.

Functions§

create_generator
Create a device-side generator of the given kind (curandCreateGenerator).
destroy_generator
curandDestroyGenerator.
generate_poisson_u32
curandGeneratePoisson — fill out with n u32 values drawn from a Poisson distribution parameterised by lambda (f64).
generate_u32
curandGenerate — raw u32 bit fill (used as the building block for any custom transform).
generate_u64
curandGenerateLongLong — raw u64 bit fill.
set_offset
curandSetGeneratorOffset.
set_seed
curandSetPseudoRandomGeneratorSeed.
set_stream
Bind gen to stream (curandSetStream).