-
Notifications
You must be signed in to change notification settings - Fork 247
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
.abs() and .signum() cause 64-bit integer instruction generation #468
Comments
Just adding here that the error reporting system for this is absolutely horrible right now, and should be improved (the way I got that screenshot was hacking in random stuff to the compiler to add error points to get a backtrace to figure out what was wrong, see the The way that would be done is implementing the capability computation system @XAMPPRocky came up with, tracked in #42 (I'll add the system to a comment there) |
Another affected function is |
Ah, never actually wrote this down, |
@khyperia I opened a PR for it awhile ago rust-num/num-traits#207. I've sent them a friendly ping to look at it again. |
@XAMPPRocky are you still planning on getting rust-num/num-traits#207 in? |
@khyperia Just made the final needed changes there, but need to wait for the CI run to be approved first to check. |
num-traits issue was merged into main on May 3. Everything seems to work as expected now. |
This is arguably not rust-gpu's fault, but num-traits, but it'll happen again, so we need a record of it.
Using vector abs ends up generating 64-bit ops due to https://github.com/rust-num/num-traits/blob/47d69223ce7707ebbf8a91c3e6b3997e48653feb/src/float.rs#L762 .
Also see the following image:
Ideally of course, abs should just generate a SPIR-V abs instruction instead of doing bithacks.
The text was updated successfully, but these errors were encountered: