Skip to content

Commit faa5213

Browse files
committed
New stuff docs
1 parent 5a6cd9b commit faa5213

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

src/intrinsics.jl

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,51 @@ struct KIKernel{Backend, BKern}
110110
kern::BKern
111111
end
112112

113+
"""
114+
kernel_max_work_group_size(backend, kern; [max_work_items::Int])::Int
115+
116+
The maximum workgroup size limit for a kernel as reported by the backend.
117+
This function should always be used to determine the workgroup size before
118+
launching a kernel.
119+
120+
!!! note
121+
Backend implementations **must** implement:
122+
```
123+
kernel_max_work_group_size(backend::NewBackend, kern::KIKernel{<:NewBackend}; max_work_items::Int=typemax(Int))::Int
124+
```
125+
As well as the on-device functionality.
126+
"""
113127
function kernel_max_work_group_size end
128+
129+
"""
130+
max_work_group_size(backend, kern; [max_work_items::Int])::Int
131+
132+
The maximum workgroup size limit for a kernel as reported by the backend.
133+
This function represents a theoretical maximum; `kernel_max_work_group_size`
134+
should be used before launching a kernel as some backends may error if
135+
kernel launch with too big a workgroup is attempted.
136+
137+
!!! note
138+
Backend implementations **must** implement:
139+
```
140+
max_work_group_size(backend::NewBackend)::Int
141+
```
142+
As well as the on-device functionality.
143+
"""
114144
function max_work_group_size end
115-
function multiprocessor_count end
145+
146+
"""
147+
multiprocessor_count(backend::NewBackend)::Int
148+
149+
The multiprocessor count for the current device used by `backend`.
150+
Used for certain algorithm optimizations.
151+
152+
!!! note
153+
Backend implementations **may** implement:
154+
```
155+
multiprocessor_count(backend::NewBackend)::Int
156+
```
157+
As well as the on-device functionality.
158+
"""
159+
multiprocessor_count(::Backend) = 0
116160
end

0 commit comments

Comments
 (0)