use thiserror::Error;
pub type QuantResult<T> = Result<T, QuantError>;
#[derive(Error, Debug)]
pub enum QuantError {
#[error("unsupported quantization type: {quant_type}")]
UnsupportedType {
quant_type: String,
},
#[error("block size mismatch: expected {expected}, got {got}")]
BlockSizeMismatch {
expected: usize,
got: usize,
},
#[error("dimension mismatch: expected {expected}, got {got}")]
DimensionMismatch {
expected: usize,
got: usize,
},
#[error("kernel error: {message}")]
KernelError {
message: String,
},
#[error("block count mismatch: expected {expected} blocks, got {got}")]
BlockCountMismatch {
expected: usize,
got: usize,
},
#[error("buffer too small: need {needed} bytes, have {available}")]
BufferTooSmall {
needed: usize,
available: usize,
},
#[error("internal error: {message}")]
Internal {
message: String,
},
#[error("float GEMM failed: {0}")]
FloatGemmFailed(String),
}