Skip to content

builder: implement pointer atomics (missing in SPIR-V) via integers.#559

Draft
eddyb wants to merge 1 commit intomainfrom
eddyb/ptr-atomic
Draft

builder: implement pointer atomics (missing in SPIR-V) via integers.#559
eddyb wants to merge 1 commit intomainfrom
eddyb/ptr-atomic

Conversation

@eddyb
Copy link
Copy Markdown
Member

@eddyb eddyb commented Apr 13, 2026

This won't do anything useful on Rust-GPU main for a while (since it relies on introducing pointer<->integer casts), but it avoids generating SPIR-V atomic accesses of pointer types (AFAIK illegal even in OpenCL SPIR-V).

While the implementation is really tiny (thanks to pre-existing bitcasting), you could imagine core implementing AtomicPtr<_> on top of AtomicUsize with pointer<->integer casts around every operation.


TODO: is this testable in any way yet?

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 this pull request may close these issues.

1 participant