You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the great work on CubeCL!
I've noticed that using mutable arguments on a #[cube] kernel causes a cpp miscompilation while using CUDA as the backend.
default_program(23): error: "l_2" has already been declared in the current scope
const uint64 l_2 = l_2 + uint64(1);
^
default_program(23): warning #549-D: variable "l_2" is used before its value is set
const uint64 l_2 = l_2 + uint64(1);
^
Remark: The warnings can be suppressed with "-diag-suppress <warning-number>"
default_program(22): warning #177-D: variable "l_2" was declared but never referenced
const uint64 l_2 = output_0[idxGlobal];
^
1 error detected in the compilation of "default_program".
Copying the argument in the function instead of mutating it works fine:
I don't think we parse mutability correctly in CubeCL yet. It's because there is comptime mutability (which we handle correctly), referring to the manipulation of symbols at compile time, and "real" mutability, which involves actually changing a register's value at runtime. For now, you can use let mut variable = variable.runtime() to declare the latter.
Hello,
Thanks for the great work on CubeCL!
I've noticed that using mutable arguments on a
#[cube]
kernel causes a cpp miscompilation while using CUDA as the backend.Example code:
This cube function...
...compiles to...
...which causes
Copying the argument in the function instead of mutating it works fine:
The text was updated successfully, but these errors were encountered: