Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem compiling CUDA code with new const #379

Open
torsteingrindvik opened this issue Dec 17, 2024 · 1 comment
Open

Problem compiling CUDA code with new const #379

torsteingrindvik opened this issue Dec 17, 2024 · 1 comment

Comments

@torsteingrindvik
Copy link
Contributor

In f81a2fa we got const T * __restrict__ for readonly inputs which is great 🎉

However it seems some patterns won't compile with this:

thread 'main' panicked at cubecl/crates/cubecl-cuda/src/compute/server.rs:380:17:
[Compilation Error]
    default_program(77): error: a value of type "const float *" cannot be used to initialize an entity of type "float *"
      float *slice_2_0 = input_2 + l_0_17;

So input_2 is const float* __restrict__ input_2,

and it's being used like this: float *slice_2_0 = input_2 + l_0_17;

I think the relevant kernel code is something like:

let slice = self.data.slice(start, start + foo);

So I think perhaps there is a missing const in the cpp source when trying to slice const inputs.

@nathanielsimard
Copy link
Member

yeah we removed it because of that, I added a TODO in the code to add it back when we fix the slice notation to consider const __restrict__.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants