pub trait BitPacking: FastLanes {
// Required methods
unsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self]);
unsafe fn unchecked_unpack(
width: usize,
input: &[Self],
output: &mut [Self],
);
}Expand description
BitPack into a compile-time known bit-width.
Required Methods§
sourceunsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self])
unsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self])
Packs 1024 elements into W bits each, where W is runtime-known instead of
compile-time known.
§Safety
The input slice must be of exactly length 1024. The output slice must be of length
1024 * W / T, where T is the bit-width of Self and W is the packed width.
These lengths are checked only with debug_assert (i.e., not checked on release builds).
sourceunsafe fn unchecked_unpack(width: usize, input: &[Self], output: &mut [Self])
unsafe fn unchecked_unpack(width: usize, input: &[Self], output: &mut [Self])
Unpacks 1024 elements from W bits each, where W is runtime-known instead of
compile-time known.
§Safety
The input slice must be of length 1024 * W / T, where T is the bit-width of Self and W
is the packed width. The output slice must be of exactly length 1024.
These lengths are checked only with debug_assert (i.e., not checked on release builds).
Object Safety§
This trait is not object safe.