Skip to content

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

Draft
eddyb wants to merge 1 commit into
mainfrom
eddyb/ptr-atomic
Draft

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

Conversation

@eddyb

@eddyb eddyb commented Apr 13, 2026

Copy link
Copy Markdown
Member

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

1 participant