cuda.cccl.parallel: Add named APIs to do temporary memory allocation and compute respectively,
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 486
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 295
Description
See comment [here](https://github.com/NVIDIA/cccl/pull/5207#issuecomment-3074258265) for context. We would like to add named APIs for doing temporary storage allocation and compute in the object-based API for `cuda.cccl.parallel`.
For example, for `make_reduce_into`, it could look like:
```python
reducer = parallel.make_reduce(d_input, d_output, add_op, h_init)
temp_storage_size = reducer.get_temp_storage_bytes(d_input, d_output, len(h_input), h_init)
d_temp_storage = cp.empty(temp_storage_size, dtype=np.uint8)
reducer.compute(d_temp_storage, d_input, d_output, len(h_input), h_init)
```
All existing tests, examples, and benchmarks that use the object-based APIs should be changed to reflect the new usage.
Contributor guide
Assessment
This issue has not been assessed yet.