`cuda.cccl.parallel`: Add `gather` (and maybe `scatter` too?)
Open
cuda.compute
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 486
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 295
Description
I'd like to access `thrust::gather` or equivalent functionality in Python for faster, fused array indexing. Consider the following code
```c++
thrust::gather(thrust::device, indices.begin(), indices.end(), in_arr.begin(), out_arr.begin());
```
Assuming `indices`, `in_arr` and `out_arr` are the underlying storage backing 1D contiguous arrays in Python, it translates nicely to initialize `out_arr` through NumPy fancy indexing syntax:
```python
out_arr[:] = in_arr[indices]
```
But it is very powerful as it allows `indices` to be computed through fused iterators.
Contributor guide
Assessment
This issue has not been assessed yet.