Skip to content

Add tile-indexed atomic operations#96

Merged
maleadt merged 6 commits intoJuliaGPU:mainfrom
AntonOresten:tile-indexed-atomics
Mar 2, 2026
Merged

Add tile-indexed atomic operations#96
maleadt merged 6 commits intoJuliaGPU:mainfrom
AntonOresten:tile-indexed-atomics

Conversation

@AntonOresten
Copy link
Contributor

@AntonOresten AntonOresten commented Feb 23, 2026

Supercedes #51, although I'd still like a nice user-facing tile-space interface like that one added in addition to tile-indexed atomic operations. This PR gives parity with Python for the 3 currently supported operations.

See #50

@maleadt
Copy link
Member

maleadt commented Mar 2, 2026

I didn't like the duplication between tile-based and scalar intrinsnics, so pushed something that differentiates based on theh mask argument: scalar if nothing, tile-based otherwise. This matches what we already did for load_ptr_tko and store_ptr_tko, and also matches what cuTile Python does (mask=None for e.g. TileAtomicCAS). Thoughts?

@maleadt maleadt force-pushed the tile-indexed-atomics branch from 0353a1a to f149b52 Compare March 2, 2026 09:10
AntonOresten and others added 4 commits March 2, 2026 11:57
Replace 6 intrinsics (3 scalar + 3 tile) with 3 unified ones that take
(ptr_tile, val, mask, ...) matching Python cuTile's design. Both paths
now compute pointers via Intrinsics.offset in the language layer, with
mask=nothing for scalar indices (no mask in bytecode) and Tile{Bool} for
tile-indexed (bounds mask passed through).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move scalar-to-tile conversion from the intrinsic layer to the language
layer: atomic_tfunc and emit functions now always return Tile{T, S}
(even for 0D), and scalar atomic methods unwrap via Intrinsics.to_scalar().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maleadt maleadt force-pushed the tile-indexed-atomics branch from f149b52 to ffd18ff Compare March 2, 2026 10:58
@maleadt maleadt merged commit 3abbcc1 into JuliaGPU:main Mar 2, 2026
8 checks passed
@AntonOresten AntonOresten deleted the tile-indexed-atomics branch March 19, 2026 12:51
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.

2 participants