macro_rules! codec {
($feature:literal, $module:ident, [$($name:ident),+ $(,)?]) => {
#[cfg(feature = $feature)]
mod $module;
#[cfg(feature = $feature)]
pub(crate) use $module::{$($name),+};
$(
#[cfg(not(feature = $feature))]
pub(crate) use super::DISABLED as $name;
)+
};
}
codec!("delta", delta, [DELTA_INT]);
codec!("zigzag", zigzag, [ZIGZAG]);
codec!("range-pack", range_pack, [RANGE_PACK]);
codec!("divide-by", divide_by, [DIVIDE_BY]);
codec!("merge-sorted", merge_sorted, [MERGE_SORTED]);
codec!("partition", partition, [PARTITION]);
codec!("sparse-num", sparse_num, [SPARSE_NUM, SPARSE_NUM_AUTO]);
codec!("sentinel", sentinel, [SENTINEL_BYTE, SENTINEL_NUM]);
codec!(
"bitsplit",
bitsplit,
[BITSPLIT, BITSPLIT_TOP8, BITSPLIT_FP, BITSPLIT_BF16]
);
codec!(
"float-deconstruct",
float_deconstruct,
[
FLOAT32_DECONSTRUCT,
BFLOAT16_DECONSTRUCT,
FLOAT16_DECONSTRUCT
]
);
#[cfg(feature = "merge-sorted")]
pub(crate) use merge_sorted::within_run_limit;
#[cfg(all(test, feature = "partition"))]
pub(crate) use partition::PartitionParams;
#[cfg(feature = "partition")]
pub(crate) use partition::custom_params_bytes;
#[cfg(any(feature = "divide-by", feature = "sparse-num", feature = "sentinel"))]
fn param_ref<'p>(cx: &'p super::super::exec::NodeCx<'_, '_>, id: i32) -> Option<&'p [u8]> {
cx.copy_param(id).filter(|bytes| !bytes.is_empty())
}