Skip to main content

Mojo function

device_sampling_from_prob

device_sampling_from_prob[vec_size: Int, block_size: Int, dtype: DType, deterministic: Bool = False](i: Int, d: Int, low: Float64, u: Float32, prob_vec: SIMD[DType.float32, vec_size], aggregate: Float32, sampled_id_sram: LegacyUnsafePointer[Int, address_space=AddressSpace.SHARED], last_valid_id_sram: LegacyUnsafePointer[Int, address_space=AddressSpace.SHARED]) -> Float32

Device-level sampling from probability distribution with atomic operations.

Returns:

Float32

Was this page helpful?