Skip to content

Commit

Permalink
tolerate a bit of type complexity for perf
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Oct 11, 2024
1 parent 0398ad9 commit a6756ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions linalg/src/frame/mmm/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub trait MatMatMulKer: Clone + Debug + Send + Sync + 'static {
fn mr(&self) -> usize;
fn nr(&self) -> usize;

#[allow(clippy::type_complexity)]
fn packings(&self) -> &[(Box<dyn MMMInputFormat>, Box<dyn MMMInputFormat>)];
fn stores(&self) -> Cow<[DatumType]>;

Expand Down Expand Up @@ -45,7 +46,7 @@ impl<const MR: usize, const NR: usize, Acc: LADatum> DynKernel<MR, NR, Acc> {
name: &str,
kernel: Kernel<Acc>,
default_packing_alignments: (usize, usize),
) -> Self {
) -> Self {
let kernel = DynKernel {
name: name.to_string(),
kernel,
Expand Down Expand Up @@ -129,11 +130,12 @@ impl<const MR: usize, const NR: usize, Acc: LADatum> MatMatMulKer for DynKernel<
unsafe { (self.kernel)(op) }
}

#[allow(clippy::type_complexity)]
fn packings(&self) -> &[(Box<dyn MMMInputFormat>, Box<dyn MMMInputFormat>)] {
&self.packings
}

fn stores(&self) -> Cow<[DatumType]> {
Cow::Borrowed(&self.stores)
}
}
}
1 change: 1 addition & 0 deletions linalg/src/frame/mmm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub trait MatMatMul: Debug + dyn_clone::DynClone + Send + Sync + std::any::Any {
fn mr(&self) -> usize;
fn nr(&self) -> usize;

#[allow(clippy::type_complexity)]
fn packings(&self) -> &[(Box<dyn MMMInputFormat>, Box<dyn MMMInputFormat>)];

fn internal_type(&self) -> DatumType;
Expand Down

0 comments on commit a6756ae

Please sign in to comment.