Skip to main content

bernoulli_compare_avx512

Function bernoulli_compare_avx512 

Source
pub unsafe fn bernoulli_compare_avx512(buf: &[u8], threshold: u8) -> u64
Expand description

Compare 64 random bytes against an unsigned threshold and return bit mask.

Bit i in the returned mask is 1 iff buf[i] < threshold.

ยงSafety

Caller must ensure the current CPU supports avx512f and avx512bw. buf must have at least 64 elements.