From 4f53194a2048d3c73422a3d92a8660056ecb0d90 Mon Sep 17 00:00:00 2001 From: Genna Wingert Date: Thu, 22 Aug 2024 13:25:27 +0200 Subject: [PATCH] Don't check const arguments for `SquareType` --- crates/cubecl-macros-2/src/generate/kernel.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/cubecl-macros-2/src/generate/kernel.rs b/crates/cubecl-macros-2/src/generate/kernel.rs index 613cfa89..042c0b98 100644 --- a/crates/cubecl-macros-2/src/generate/kernel.rs +++ b/crates/cubecl-macros-2/src/generate/kernel.rs @@ -22,6 +22,9 @@ impl ToTokens for Kernel { let input_checks = self .parameters .iter() + // Const can be anything as long as the accessed fields are cube types, since the access + // gets resolved at expansion time and collapsed into a literal in the kernel + .filter(|(_, _, is_const)| !is_const) .map(|(_, ty, _)| { let span = ty.span(); let check = prefix_ir(format_ident!("assert_valid_type"));