Replies: 2 comments
-
Thanks for the links! Interesting stuff. For latest nightly, you can look at #249. The niche problem is unfortunate. @eddyb is currently working on quasi-pointers (qptr). See some WIPs: https://github.com/LykenSol/rust-gpu/tree/ephemera/polaris-plus-rec-call-emu |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ahh thanks good to see that work is being done in that direction. I was a little worried that dynamic memcpy/generic pointers/function pointers weren't even on the roadmap. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There is prior art to this:
https://www.youtube.com/watch?v=bRyculBbjMA
https://xol.io/blah/introducing-vcc/
https://github.com/shady-gang/shady
Interesting related blogs: https://xol.io/blah/
TLDR: They implemented general pointers (including casts), function pointers and a stack in spirv with acceptable performance.
I have been poking around in this code base quite a lot yesterday.
It would be very nice to support niches and dynamic memcpy (as fallback).
I also started porting rust gpu to the latest nightly for fun and hit a snag here:
code --goto /home/main/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/cmp.rs:43:14
This is caused by disabling niches here:
I got there because
array::from_fn
usestransmute_unchecked
which is unimplemented. I believe the benefits of emulating real pointers and function pointers in spirv would be immense for rust gpu usage. Even if performance is bad I believe correctness/support is more important. When performance really matters users can optimize their code to avoid using the emulated memory/function pointers.Also most hardware natively supports all these features anyways so the gpu driver spirv compilers will handle it somewhat performantly.
Beta Was this translation helpful? Give feedback.
All reactions