From 86a02259e8b984cafd1c9eacd92a600cd38988cd Mon Sep 17 00:00:00 2001 From: Mathieu Poumeyrol Date: Tue, 15 Oct 2024 09:04:21 +0200 Subject: [PATCH] dead file --- .../frame/block_quant/panel_extract_input.rs | 76 ------------------- 1 file changed, 76 deletions(-) delete mode 100644 linalg/src/frame/block_quant/panel_extract_input.rs diff --git a/linalg/src/frame/block_quant/panel_extract_input.rs b/linalg/src/frame/block_quant/panel_extract_input.rs deleted file mode 100644 index 25a8d9f439..0000000000 --- a/linalg/src/frame/block_quant/panel_extract_input.rs +++ /dev/null @@ -1,76 +0,0 @@ -use std::fmt::{Debug, Display}; - -use crate::frame::PackedFormat; -use crate::mmm::{EagerPackedInput, MMMInputFormat, MMMInputValue}; - -use super::PackedBlockQuantFormat; - -#[derive(Clone, Hash, Eq, PartialEq)] -pub struct PanelExtractFormat { - pub pbqf: PackedBlockQuantFormat, -} - -impl MMMInputFormat for PanelExtractFormat { - fn prepare_tensor( - &self, - _t: &tract_data::prelude::Tensor, - _k_axis: usize, - _mn_axis: usize, - ) -> tract_data::TractResult> { - todo!() - } - - fn k_alignment(&self) -> usize { - self.pbqf.k_alignment() - } - - fn r(&self) -> usize { - self.pbqf.r - } - - fn same_as(&self, other: &dyn MMMInputFormat) -> bool { - other.downcast_ref::().is_some_and(|other| self == other) - } -} - -impl Display for PanelExtractFormat { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "PanelExtract({})", self.pbqf) - } -} - -impl Debug for PanelExtractFormat { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "PanelExtract({})", self.pbqf) - } -} - -#[derive(Clone, Hash)] -pub struct PanelExtractInput { - pub format: PanelExtractFormat, - pub data: EagerPackedInput, - pub to: PackedFormat, -} - -impl MMMInputValue for PanelExtractInput { - fn scratch_panel_buffer_layout(&self) -> Option { - Some(self.to.single_panel_layout(self.data.k(), self.to.dt.size_of())) - } - fn panel_bytes(&self, i: usize, buffer: Option<*mut u8>) -> tract_data::TractResult<*const u8> { - let scratch = buffer.unwrap(); - unsafe { - self.format.pbqf.bq.extract_panel(&self.data, &self.to, i, scratch)?; - } - Ok(scratch) - } - fn mn(&self) -> usize { - self.data.mn() - } - fn k(&self) -> usize { - self.data.k() - } - fn format(&self) -> &dyn MMMInputFormat { - &self.format - } -} -