Skip to main content

alias

Macro alias 

Source
macro_rules! alias {
    ($var:ident) => { ... };
    ($var:ident = $type:ident) => { ... };
    ($var:ident = <$arch:ty>::$type:ident) => { ... };
    ($var:ident<$arch:ident> = $type:ident) => { ... };
}
Expand description

Convenience aliases for aliasing SIMD types.

There are currently four supported flavors (the examples below use f32x4 as an example identifier:

  1. diskann_wide::alias!(f32x4) => type f32x4 = <diskann_wide::arch::Current as diskann_wide::Architecture>::f32x4: Type alias directly to the compile-time architecture’s type.

  2. diskann_wide::alias!(f32s = f32x4) => type f32s = <diskann_wide::arch::Current as diskann_wide::Architecture>::f32x4: Type alias a SIMD type with a custom name.

  3. diskann_wide::alias!(f32s = <A>::f32x4) => type f32s = <A as diskann_wide::Architecture>::f32x4: Type alias a SIMD type from a specific architecture.

  4. diskann_wide::alias!(f32s<A> = f32x4) => type f32s<A> = <A as diskann_wide::Architecture>::f32x4: Type alias a SIMD type in a generic context. This can be useful to work around errors like

    use of generic parameter from outer item