Skip to content

Commit fdc4162

Browse files
authored
Update Tile{T, (...)} notation in docstrings (#242)
1 parent 69bcd7e commit fdc4162

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/compiler/analysis/divisibility.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function transfer(a::DivByAnalysis, r::DataflowResult, @nospecialize(func),
8787
end
8888

8989
# Pointer offset: result is divisible by gcd(ptr_div, off_div * elem_bytes).
90-
# The base may be either `Tile{Ptr{T}, ()}` (post-canonicalize tile form)
90+
# The base may be either `Tile{Ptr{T}, Tuple{}}` (post-canonicalize tile form)
9191
# or raw `Ptr{T}` (the SCI annotation on `getfield(arg, :ptr)`); both
9292
# lower to a 0-D pointer Value at codegen.
9393
#
@@ -198,7 +198,7 @@ function tilearray_field_divby(ref::TileArrayFieldRef)
198198
end
199199

200200
# Pointee element type of a 0-D pointer base, accepting both `Ptr{T}` and
201-
# `Tile{Ptr{T}, ()}`. Returns `nothing` for shapes that don't fit (tile-of-
201+
# `Tile{Ptr{T}, Tuple{}}`. Returns `nothing` for shapes that don't fit (tile-of-
202202
# pointers, non-pointer types, …).
203203
function ptr_pointee(@nospecialize(T))
204204
if T <: Tile

src/compiler/codegen/kernel.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ maps `block_args` to the function's positional arguments, emits the body, and re
330330
the yielded result values.
331331
332332
- `func`: the Julia function to compile (e.g., `+`, `max`, a lambda)
333-
- `arg_types`: Julia types for each block arg (e.g., `[Tile{Float32,()}]` repeated)
333+
- `arg_types`: Julia types for each block arg (e.g., `[Tile{Float32, Tuple{}}]` repeated)
334334
- `block_args`: IR `Value`s from the enclosing region (e.g., `[acc, elem]`)
335335
- `block_type_ids`: `TypeId`s corresponding to each block arg
336336

src/compiler/intrinsics/random.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
#
1919
# State-accessor intrinsics take a stream as their first operand:
2020
#
21-
# rng_counter(h) -> Tile{UInt32, ()} — read h's counter
21+
# rng_counter(h) -> Tile{UInt32, Tuple{}} — read h's counter
2222
# rng_advance(h, n) -> Nothing — add n to h's counter
23-
# rng_seed(h) -> Tile{UInt32, ()} — read h's seed
23+
# rng_seed(h) -> Tile{UInt32, Tuple{}} — read h's seed
2424
# rng_set_seed(h, s) -> Nothing — overwrite h's seed
2525

2626
# ---- allocation ------------------------------------------------------------

src/language/operations.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ public arange
703703

704704
"""
705705
arange(shape; dtype=Int32) -> Tile{dtype, shape}
706-
arange(n; dtype=Int32) -> Tile{dtype, (n,)}
706+
arange(n; dtype=Int32) -> Tile{dtype, Tuple{n}}
707707
708708
Create a 1D tile with values [1, 2, 3, ..., n] (1-indexed).
709709
@@ -804,15 +804,15 @@ permuted = permutedims(tile, (3, 1, 2)) # Shape (4, 2, 3)
804804
Intrinsics.permute(tile, map(p -> p - 1, Perm))
805805

806806
"""
807-
permutedims(tile::Tile{T, (M, N)}) -> Tile{T, (N, M)}
807+
permutedims(tile::Tile{T, Tuple{M, N}}) -> Tile{T, Tuple{N, M}}
808808
809809
Permute a 2D tile, swapping its dimensions. Defaults to permutation `(2, 1)`.
810810
811811
Equivalent to `transpose`.
812812
813813
---
814814
815-
permutedims(tile::Tile{T, (N,)}) -> Tile{T, (1, N)}
815+
permutedims(tile::Tile{T, Tuple{N}}) -> Tile{T, Tuple{1, N}}
816816
817817
Reshape a 1D tile into a `1 × N` row tile.
818818
@@ -832,13 +832,13 @@ Equivalent to `transpose`.
832832
end
833833

834834
"""
835-
transpose(tile::Tile{T, (M, N)}) -> Tile{T, (N, M)}
835+
transpose(tile::Tile{T, Tuple{M, N}}) -> Tile{T, Tuple{N, M}}
836836
837837
Transpose a 2D tile, swapping its dimensions.
838838
839839
---
840840
841-
transpose(tile::Tile{T, (N,)}) -> Tile{T, (1, N)}
841+
transpose(tile::Tile{T, Tuple{N}}) -> Tile{T, Tuple{1, N}}
842842
843843
Reshape a 1D tile into a `1 × N` row tile.
844844

src/language/types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ end
236236
Tile{T, Shape}
237237
238238
Represents a tile of data with element type `T` and static shape `Shape`.
239-
Shape is a tuple of integers representing the tile dimensions.
239+
Shape is a tuple type encoding the tile dimensions (e.g. `Tuple{16, 32}`).
240240
241241
This is a compile-time abstraction - at runtime in kernel code, tiles are
242242
represented as Tile IR values. The struct exists to enable proper type

0 commit comments

Comments
 (0)