@@ -3,10 +3,13 @@ use burn_cube::prelude::*;
3
3
use burn_tensor:: Shape ;
4
4
5
5
use super :: {
6
- config:: Tiling2dConfig , init_matmul_output, matmul_autotune , matmul_simple, matmul_tiling_2d,
6
+ config:: Tiling2dConfig , init_matmul_output, matmul_simple, matmul_tiling_2d,
7
7
matmul_tiling_2d_cube, matmul_tiling_2d_padded,
8
8
} ;
9
9
10
+ #[ cfg( feature = "autotune" ) ]
11
+ use super :: matmul_autotune;
12
+
10
13
/// The strategy to be used when launching a matmul kernel.
11
14
pub enum MatmulStrategy {
12
15
/// A simple kernel will be used with memory coalescing optimization.
@@ -27,11 +30,14 @@ pub enum MatmulStrategy {
27
30
Tiling2dCube ( Tiling2dConfig ) ,
28
31
}
29
32
30
- #[ allow( clippy:: derivable_impls) ] // Necessary otherwise the feature flags dont' work.
31
- #[ cfg( feature = "autotune" ) ]
32
33
impl Default for MatmulStrategy {
33
34
fn default ( ) -> Self {
34
- MatmulStrategy :: Autotune
35
+ // if autotune is enabled, default to autotune
36
+ #[ cfg( feature = "autotune" ) ]
37
+ return MatmulStrategy :: Autotune ;
38
+
39
+ #[ cfg( not( feature = "autotune" ) ) ]
40
+ MatmulStrategy :: Tiling2d ( Tiling2dConfig :: default ( ) )
35
41
}
36
42
}
37
43
0 commit comments