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

Issues with negative floats and infinite floats #68

Open
cBournhonesque opened this issue Aug 12, 2024 · 2 comments
Open

Issues with negative floats and infinite floats #68

cBournhonesque opened this issue Aug 12, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@cBournhonesque
Copy link
Contributor

F32::new(f32::INFINITY) does not work, it expands as

let _var_0 = f32::INFINITY;
F32::__expand_new(context, _var_0)

instead of something like

let _var_0 = cubecl::frontend::ExpandElementTyped::from_lit(f32::INFINITY);
F32::__expand_new(context, _var_0)

Similar problem with negative floats:
F32::new(-10.0) does not work

@nathanielsimard nathanielsimard added the bug Something isn't working label Aug 13, 2024
@louisfd louisfd self-assigned this Aug 13, 2024
@louisfd
Copy link
Member

louisfd commented Aug 13, 2024

Thanks,
The negative floats problem was already identified in #11 , as for infinity your idea is great.

@RianGoossens
Copy link
Contributor

Something to consider here is that wgsl does not support infinity as a literal, at all. You can't even bypass it by doing something like let x = 1.0 / 0.0;, the compiler will catch it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants