Skip to content

Commit eaaf82b

Browse files
committed
add groupsize to the exported device API
1 parent 1127657 commit eaaf82b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

docs/src/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@localmem
1010
@private
1111
@synchronize
12+
groupsize
1213
```
1314

1415
## Host interface

src/KernelAbstractions.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module KernelAbstractions
22

33
export @kernel
4-
export @Const, @localmem, @private, @synchronize, @index
4+
export @Const, @localmem, @private, @synchronize, @index, groupsize
55
export Device, GPU, CPU, CUDA
66

77
using StaticArrays
@@ -69,8 +69,16 @@ function async_copy! end
6969
# - @private
7070
# - @synchronize
7171
# - @index
72+
# - groupsize
7273
###
7374

75+
"""
76+
groupsize()
77+
78+
Query the workgroupsize on the device.
79+
"""
80+
function groupsize end
81+
7482
const shmem_id = Ref(0)
7583

7684
"""
@@ -256,8 +264,6 @@ include("compiler.jl")
256264
# Compiler/Frontend
257265
###
258266

259-
function groupsize end
260-
261267
@inline function __workitems_iterspace()
262268
return 1:groupsize()
263269
end

0 commit comments

Comments
 (0)