NVIDIA / NVIDIA/cccl

cuda.cccl.parallel: Add named APIs to do temporary memory allocation and compute respectively,

Open
#5,638 5 comments 0 reactions 1 assignee Claimed by @acosmicflamingo View on GitHub
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

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.