Skip to content

Commit 157e5c6

Browse files
Various documentation fixes. (#641)
[only docs]
1 parent 4b05d30 commit 157e5c6

File tree

4 files changed

+30
-26
lines changed

4 files changed

+30
-26
lines changed

docs/src/api/kernel.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ This is made possible by interfacing with the Metal libraries by wrapping a subs
1010
## Indexing and dimensions
1111

1212
```@docs
13-
thread_execution_width
1413
thread_index_in_quadgroup
1514
thread_index_in_simdgroup
1615
thread_index_in_threadgroup
@@ -27,6 +26,7 @@ quadgroup_index_in_threadgroup
2726
quadgroups_per_threadgroup
2827
grid_size_1d
2928
grid_origin_1d
29+
thread_execution_width
3030
```
3131

3232

@@ -53,4 +53,4 @@ MtlThreadGroupArray
5353
MemoryFlags
5454
threadgroup_barrier
5555
simdgroup_barrier
56-
```
56+
```

src/array.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ storagemode(x::MtlArray) = storagemode(typeof(x))
127127
storagemode(::Type{<:MtlArray{<:Any,<:Any,S}}) where {S} = S
128128

129129
"""
130-
is_shared(A::MtlArray) -> Bool
130+
is_shared(A::MtlArray)::Bool
131131
132132
Returns true if `A` has storage mode [`Metal.SharedStorage`](@ref).
133133
@@ -136,7 +136,7 @@ See also [`is_private`](@ref) and [`is_managed`](@ref).
136136
is_shared(A::MtlArray) = storagemode(A) == SharedStorage
137137

138138
"""
139-
is_managed(A::MtlArray) -> Bool
139+
is_managed(A::MtlArray)::Bool
140140
141141
Returns true if `A` has storage mode [`Metal.ManagedStorage`](@ref).
142142
@@ -145,7 +145,7 @@ See also [`is_shared`](@ref) and [`is_private`](@ref).
145145
is_managed(A::MtlArray) = storagemode(A) == ManagedStorage
146146

147147
"""
148-
is_private(A::MtlArray) -> Bool
148+
is_private(A::MtlArray)::Bool
149149
150150
Returns true if `A` has storage mode [`Metal.PrivateStorage`](@ref).
151151

src/device/intrinsics/arguments.jl

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ Return the index of the current thread in its threadgroup.
128128
thread_execution_width()::UInt32
129129
130130
Return the execution width of the compute unit.
131+
132+
This function has been deprecated as of Metal 3.
133+
134+
Use [`threads_per_simdgroup`](@ref) instead.
131135
""" thread_execution_width
132136

133137
@doc """
@@ -155,72 +159,72 @@ end
155159

156160
@doc_dim """
157161
dispatch_threads_per_threadgroup_1d()::UInt32
158-
dispatch_threads_per_threadgroup_2d()::NamedTuple{(:x, :y), Tuple{UInt32, UInt32}}
159-
dispatch_threads_per_threadgroup_3d()::NamedTuple{(:x, :y, :z), Tuple{UInt32, UInt32, UInt32}}
162+
dispatch_threads_per_threadgroup_2d()::@NamedTuple{x::UInt32, y::UInt32}
163+
dispatch_threads_per_threadgroup_3d()::@NamedTuple{x::UInt32, y::UInt32, z::UInt32}
160164
161165
Return the thread execution width specified at dispatch for a threadgroup.
162166
""" dispatch_threads_per_threadgroup
163167

164168
@doc_dim """
165169
grid_origin_1d()::UInt32
166-
grid_origin_2d()::NamedTuple{(:x, :y), Tuple{UInt32, UInt32}}
167-
grid_origin_3d()::NamedTuple{(:x, :y, :z), Tuple{UInt32, UInt32, UInt32}}
170+
grid_origin_2d()::@NamedTuple{x::UInt32, y::UInt32}
171+
grid_origin_3d()::@NamedTuple{x::UInt32, y::UInt32, z::UInt32}
168172
169173
Return the origin offset of the grid for threads that read per-thread stage-in data.
170174
""" grid_origin
171175

172176
@doc_dim """
173177
grid_size_1d()::UInt32
174-
grid_size_2d()::NamedTuple{(:x, :y), Tuple{UInt32, UInt32}}
175-
grid_size_3d()::NamedTuple{(:x, :y, :z), Tuple{UInt32, UInt32, UInt32}}
178+
grid_size_2d()::@NamedTuple{x::UInt32, y::UInt32}
179+
grid_size_3d()::@NamedTuple{x::UInt32, y::UInt32, z::UInt32}
176180
177181
Return maximum size of the grid for threads that read per-thread stage-in data.
178182
""" grid_size
179183

180184
@doc_dim """
181185
thread_position_in_threadgroup_1d()::UInt32
182-
thread_position_in_threadgroup_2d()::NamedTuple{(:x, :y), Tuple{UInt32, UInt32}}
183-
thread_position_in_threadgroup_3d()::NamedTuple{(:x, :y, :z), Tuple{UInt32, UInt32, UInt32}}
186+
thread_position_in_threadgroup_2d()::@NamedTuple{x::UInt32, y::UInt32}
187+
thread_position_in_threadgroup_3d()::@NamedTuple{x::UInt32, y::UInt32, z::UInt32}
184188
185189
Return the current thread's unique position within a threadgroup.
186190
""" thread_position_in_threadgroup
187191

188192
@doc_dim """
189193
thread_position_in_grid_1d()::UInt32
190-
thread_position_in_grid_2d()::NamedTuple{(:x, :y), Tuple{UInt32, UInt32}}
191-
thread_position_in_grid_3d()::NamedTuple{(:x, :y, :z), Tuple{UInt32, UInt32, UInt32}}
194+
thread_position_in_grid_2d()::@NamedTuple{x::UInt32, y::UInt32}
195+
thread_position_in_grid_3d()::@NamedTuple{x::UInt32, y::UInt32, z::UInt32}
192196
193197
Return the current thread's position in an N-dimensional grid of threads.
194198
""" thread_position_in_grid
195199

196200
@doc_dim """
197201
threadgroup_position_in_grid_1d()::UInt32
198-
threadgroup_position_in_grid_2d()::NamedTuple{(:x, :y), Tuple{UInt32, UInt32}}
199-
threadgroup_position_in_grid_3d()::NamedTuple{(:x, :y, :z), Tuple{UInt32, UInt32, UInt32}}
202+
threadgroup_position_in_grid_2d()::@NamedTuple{x::UInt32, y::UInt32}
203+
threadgroup_position_in_grid_3d()::@NamedTuple{x::UInt32, y::UInt32, z::UInt32}
200204
201205
Return the current threadgroup's unique position within the grid.
202206
""" threadgroup_position_in_grid
203207

204208
@doc_dim """
205209
threadgroups_per_grid_1d()::UInt32
206-
threadgroups_per_grid_2d()::NamedTuple{(:x, :y), Tuple{UInt32, UInt32}}
207-
threadgroups_per_grid_3d()::NamedTuple{(:x, :y, :z), Tuple{UInt32, UInt32, UInt32}}
210+
threadgroups_per_grid_2d()::@NamedTuple{x::UInt32, y::UInt32}
211+
threadgroups_per_grid_3d()::@NamedTuple{x::UInt32, y::UInt32, z::UInt32}
208212
209213
Return the number of threadgroups per grid.
210214
""" threadgroups_per_grid
211215

212216
@doc_dim """
213217
threads_per_grid_1d()::UInt32
214-
threads_per_grid_2d()::NamedTuple{(:x, :y), Tuple{UInt32, UInt32}}
215-
threads_per_grid_3d()::NamedTuple{(:x, :y, :z), Tuple{UInt32, UInt32, UInt32}}
218+
threads_per_grid_2d()::@NamedTuple{x::UInt32, y::UInt32}
219+
threads_per_grid_3d()::@NamedTuple{x::UInt32, y::UInt32, z::UInt32}
216220
217221
Return the grid size.
218222
""" threads_per_grid
219223

220224
@doc_dim """
221225
threads_per_threadgroup_1d()::UInt32
222-
threads_per_threadgroup_2d()::NamedTuple{(:x, :y), Tuple{UInt32, UInt32}}
223-
threads_per_threadgroup_3d()::NamedTuple{(:x, :y, :z), Tuple{UInt32, UInt32, UInt32}}
226+
threads_per_threadgroup_2d()::@NamedTuple{x::UInt32, y::UInt32}
227+
threads_per_threadgroup_3d()::@NamedTuple{x::UInt32, y::UInt32, z::UInt32}
224228
225229
Return the thread execution width of a threadgroup.
226230
""" threads_per_threadgroup

src/version.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# or air.language_version in the embedded bitcode
1313

1414
"""
15-
Metal.metallib_support() -> VersionNumber
15+
Metal.metallib_support()::VersionNumber
1616
1717
Returns the highest supported version for the metallib file format.
1818
@@ -42,7 +42,7 @@ function metallib_support()
4242
end
4343

4444
"""
45-
Metal.air_support() -> VersionNumber
45+
Metal.air_support()::VersionNumber
4646
4747
Returns the highest supported version for the embedded AIR bitcode format.
4848
@@ -74,7 +74,7 @@ function air_support()
7474
end
7575

7676
"""
77-
Metal.metal_support() -> VersionNumber
77+
Metal.metal_support()::VersionNumber
7878
7979
Returns the highest supported version for the Metal Shading Language.
8080

0 commit comments

Comments
 (0)