NVIDIA / NVIDIA/cccl

`cuda.cccl.parallel`: Add `gather` (and maybe `scatter` too?)

Open
#5,685 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.