Expand description
§Bitstream Operations
Core bitstream packing and logic primitives for stochastic computing.
Probabilities are represented as packed Bernoulli bitstreams stored in u64 words.
Structs§
- BitStream
Tensor - Packed bitstream tensor with original bit length metadata.
Functions§
- bernoulli_
packed - Generate a packed Bernoulli bitstream directly into
u64words. - bernoulli_
packed_ fast - Fast packed Bernoulli generation using byte-threshold comparison.
- bernoulli_
packed_ simd - SIMD-accelerated packed Bernoulli generation.
- bernoulli_
stream - Generate an unpacked Bernoulli bitstream from a probability.
- bitwise_
and - Compute bitwise-AND between two packed tensors.
- encode_
and_ popcount - Fused encode+AND+popcount without materializing encoded input words.
- encode_
matrix_ prob_ to_ packed - Encode a flat matrix of probabilities into packed Bernoulli bitstreams.
- pack
- Pack a
0/1byte slice intou64words. - pack_
fast - Portable fast pack: processes 8 bytes into one output byte at a time.
- popcount
- Popcount of all bits set in a packed tensor.
- popcount_
words_ portable - Portable popcount over a packed word slice.
- simd_
bernoulli_ 🔒compare - Compare 64 bytes against a threshold and return a packed bit mask.
- swar_
popcount_ word - Portable SWAR popcount for a single
u64word. - unpack
- Unpack a packed tensor back into a
0/1byte vector.