@@ -7,6 +7,12 @@ import GPUCompiler: split_kwargs, assign_args!
77 get_global_size()::@NamedTuple{x::Int, y::Int, z::Int}
88
99Return the number of global work-items specified.
10+
11+ !!! note
12+ Backend implementations **must** implement:
13+ ```
14+ @device_override get_global_size()::@NamedTuple{x::Int, y::Int, z::Int}
15+ ```
1016"""
1117function get_global_size end
1218
@@ -17,13 +23,25 @@ Returns the unique global work-item ID.
1723
1824!!! note
1925 1-based.
26+
27+ !!! note
28+ Backend implementations **must** implement:
29+ ```
30+ @device_override get_global_id()::@NamedTuple{x::Int, y::Int, z::Int}
31+ ```
2032"""
2133function get_global_id end
2234
2335"""
2436 get_local_size()::@NamedTuple{x::Int, y::Int, z::Int}
2537
2638Return the number of local work-items specified.
39+
40+ !!! note
41+ Backend implementations **must** implement:
42+ ```
43+ @device_override get_local_size()::@NamedTuple{x::Int, y::Int, z::Int}
44+ ```
2745"""
2846function get_local_size end
2947
@@ -34,13 +52,25 @@ Returns the unique local work-item ID.
3452
3553!!! note
3654 1-based.
55+
56+ !!! note
57+ Backend implementations **must** implement:
58+ ```
59+ @device_override get_local_id()::@NamedTuple{x::Int, y::Int, z::Int}
60+ ```
3761"""
3862function get_local_id end
3963
4064"""
4165 get_num_groups()::@NamedTuple{x::Int, y::Int, z::Int}
4266
4367Returns the number of groups.
68+
69+ !!! note
70+ Backend implementations **must** implement:
71+ ```
72+ @device_override get_num_groups()::@NamedTuple{x::Int, y::Int, z::Int}
73+ ```
4474"""
4575function get_num_groups end
4676
@@ -51,6 +81,12 @@ Returns the unique group ID.
5181
5282!!! note
5383 1-based.
84+
85+ !!! note
86+ Backend implementations **must** implement:
87+ ```
88+ @device_override get_group_id()::@NamedTuple{x::Int, y::Int, z::Int}
89+ ```
5490"""
5591function get_group_id end
5692
@@ -62,7 +98,7 @@ Declare memory that is local to a workgroup.
6298!!! note
6399 Backend implementations **must** implement:
64100 ```
65- localmemory(T::DataType, ::Val{Dims}) where {T, Dims}
101+ @device_override localmemory(T::DataType, ::Val{Dims}) where {T, Dims}
66102 ```
67103 As well as the on-device functionality.
68104"""
@@ -83,25 +119,24 @@ workgroup.
83119 ```
84120 @device_override barrier()
85121 ```
86- As well as the on-device functionality.
87122"""
88123function barrier ()
89124 error (" Group barrier used outside kernel or not captured" )
90125end
91126
92127"""
93- _print(items ...)
128+ _print(args ...)
94129
95130 Overloaded by backends to enable `KernelAbstractions.@print`
96131 functionality.
97132
98133!!! note
99134 Backend implementations **must** implement:
100135 ```
101- _print(items ...)
136+ @device_override _print(args ...)
102137 ```
103- As well as the on-device functionality ,
104- or define it to return `nothing`
138+ If the backend does not support printing ,
139+ define it to return `nothing`.
105140"""
106141@generated function _print (items... )
107142 str = " "
0 commit comments