1use cubecl::{ir::StorageType, server::LaunchError};
2use thiserror::Error;
3
4#[derive(Error, Debug, Clone)]
5pub enum ReduceError {
7 #[error(
9 "Trying to launch a kernel using plane instructions, but there are not supported by the hardware."
10 )]
11 PlanesUnavailable,
12 #[error("The cube count is larger than the max supported.")]
14 CubeCountTooLarge,
15
16 #[error("A generic validation error: {details}")]
18 Validation { details: &'static str },
19
20 #[error(
22 "Trying to launch a kernel using plane instructions, but the min and max plane dimensions are different."
23 )]
24 ImprecisePlaneDim,
25 #[error("The provided axis ({axis}) must be smaller than the input tensor rank ({rank}).")]
27 InvalidAxis { axis: usize, rank: usize },
28 #[error("The output shape (currently {output_shape:?}) should be {expected_shape:?}.")]
30 MismatchShape {
31 expected_shape: Vec<usize>,
32 output_shape: Vec<usize>,
33 },
34 #[error("Atomic add not supported by the client for {0}")]
36 MissingAtomicAdd(StorageType),
37
38 #[error("An error happened during launch\nCaused by:\n {0}")]
40 Launch(LaunchError),
41}