Skip to content

Commit

Permalink
Fix reserved kernel variable name. (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielsimard authored Nov 28, 2024
1 parent 0df1761 commit 0f83126
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
9 changes: 9 additions & 0 deletions crates/cubecl-core/tests/frontend/kernel.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use cubecl::prelude::*;
use cubecl_core as cubecl;

#[cube(launch)]
pub fn with_kernel<F: Float>(kernel: &mut Array<F>) {
if ABSOLUTE_POS > kernel.len() {
kernel[ABSOLUTE_POS] = F::cast_from(5.0);
}
}
1 change: 1 addition & 0 deletions crates/cubecl-core/tests/frontend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mod function_call;
mod generic_kernel;
mod r#if;
mod intrinsics;
mod kernel;
mod literal;
mod r#loop;
mod module_import;
Expand Down
6 changes: 3 additions & 3 deletions crates/cubecl-macros/src/generate/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl Launch {
#(#args),*
) -> () {
#body
launcher.launch(__cube_count, kernel, __client);
launcher.launch(__cube_count, __kernel, __client);
}
}
} else {
Expand Down Expand Up @@ -101,7 +101,7 @@ impl Launch {
#(#args),*
) -> () {
#body
launcher.launch_unchecked(__cube_count, kernel, __client);
launcher.launch_unchecked(__cube_count, __kernel, __client);
}
}
} else {
Expand Down Expand Up @@ -136,7 +136,7 @@ impl Launch {
#settings
#compilation_args

let kernel = #kernel_name #kernel_generics::new(__settings, #args #(#comptime_args),*);
let __kernel = #kernel_name #kernel_generics::new(__settings, #args #(#comptime_args),*);

let mut launcher = #kernel_launcher::<__R>::default();

Expand Down

0 comments on commit 0f83126

Please sign in to comment.