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

Primitive casting does not work for some primitives #382

Open
torsteingrindvik opened this issue Dec 18, 2024 · 1 comment · May be fixed by #384
Open

Primitive casting does not work for some primitives #382

torsteingrindvik opened this issue Dec 18, 2024 · 1 comment · May be fixed by #384

Comments

@torsteingrindvik
Copy link
Contributor

I was doing some work on u8s and u16s and I started getting an error:

image

In the image I just made a few extra tests in cubecl/crates/cubecl-core/tests/frontend/cast_elem.rs

The compiler tries to help:

error[E0223]: ambiguous associated type
...
help: if there were a trait named `Example` with associated type `cast_from` implemented for `u16`, you could use the fully-qualified path
  |
7 | <u16 as Example>::cast_from#[cube(launch_unchecked)]
  | +++++++++++++++++++++++++++

(The attribute is actually a part of the error msg, it's not a copy paste mistake here)

@torsteingrindvik
Copy link
Contributor Author

image

It seems the commented out code is what is generated.
I compared that to a snippet of another primitive cast which works.
I added that line instead, and that at least seems to make the compiler happy.

If I can figure out why it didn't expand to that in the first place I can make a PR.

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

Successfully merging a pull request may close this issue.

1 participant