Skip to content

Merge BackendConfig and BgemmBackend into a single trait #122

@shinaoka

Description

@shinaoka

Summary

strided-einsum2/src/backend.rs defines two separate traits:

  • BackendConfig — 2 const flags (MATERIALIZES_CONJ, REQUIRES_UNIT_STRIDE)
  • BgemmBackend<T> — single bgemm_contiguous_into() method

Plus 3 marker structs (FaerBackend, BlasBackend, NaiveBackend) and ActiveBackend type alias via cfg.

Proposal

Merge into a single trait:

pub trait Backend<T: ScalarBase> {
    const MATERIALIZES_CONJ: bool;
    const REQUIRES_UNIT_STRIDE: bool;
    fn bgemm_contiguous_into(...) -> Result<()>;
}

~30 lines reduction, simpler trait hierarchy.

Risk

Low. Purely organizational refactoring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions