[CUCO][FEA]: Make fixed_capacity_map_ref the single source of truth
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 486
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 295
Description
### Is this a duplicate?
- [x] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cccl/issues) for this request and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)
### Area
CUDA Experimental (cudax)
### Is your feature request related to a problem? Please describe.
The cudax `fixed_capacity_map` follows the original cuCollections design: the owning implementation provides host bulk operations, while `fixed_capacity_map_ref` provides device operations.
As a result, the owner reconstructs refs for kernel launches, and map state and utilities are split between the owner and ref implementations.
The HyperLogLog migration uses a simpler model: the owner stores its storage and ref, the ref supports both host and device operations, and the owner delegates to it.
### Describe the solution you'd like
Apply the HyperLogLog model to `fixed_capacity_map`:
- Add host bulk operations to `fixed_capacity_map_ref`.
- Make `fixed_capacity_map` own the slot storage and a ref to that storage.
- Forward owner operations and accessors through the stored ref.
- Keep the ref lightweight and device-usable.
- Add tests covering host operations through both the owner and ref.
This would make the ref the single source of truth for map state and shared utilities.
### Describe alternatives you've considered
Keep the current owner/ref split. This works, but continues duplicating state access and operation plumbing.
### Additional context
- [`fixed_capacity_map`](https://github.com/NVIDIA/cccl/blob/main/cudax/include/cuda/experimental/__cuco/fixed_capacity_map.cuh)
- [`hyperloglog`](https://github.com/NVIDIA/cccl/blob/main/cudax/include/cuda/experimental/__cuco/hyperloglog.cuh)
- #4308
- #9867
Contributor guide
Research direction
Start by comparing cudax/include/cuda/experimental/__cuco/fixed_capacity_map.cuh with cudax/include/cuda/experimental/__cuco/hyperloglog.cuh, focusing on storage, references, host operations, and accessors. Trace the existing fixed_capacity_map_ref and owner APIs, then add coverage for host operations through both; done means the ref owns the shared map state and remains lightweight and device-usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, hpc
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100