numba / numba/nvidia-cuda-tutorial
Add section on Grid Groups and Grid sync
- Dominant language
- Jupyter Notebook
- Stars
- 269
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
[Grid groups and grid sync](https://numba.readthedocs.io/en/latest/cuda/cooperative_groups.html) were added in Numba 0.53.1. A short section on using these to implement a global barrier would be good, perhaps based around the example kernel from the documentation:
```python
@cuda.jit(void(int32[:,::1]))
def sequential_rows(M):
col = cuda.grid(1)
g = cuda.cg.this_grid()
rows = M.shape[0]
cols = M.shape[1]
for row in range(1, rows):
opposite = cols - col - 1
# Each row's elements are one greater than the previous row
M[row, col] = M[row - 1, opposite] + 1
# Wait until all threads have written their column element,
# and that the write is visible to all other threads
g.sync()
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.