NVIDIA / NVIDIA/cccl

[FEA]: Memory resources supporting alignments greater than 256-bytes

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

libcu++

### Is your feature request related to a problem? Please describe.

Since #7623 we can construct `buffer` objects and specify an alignment parameter. Unfortunately, today, if the requested alignment is wider than 256 bytes we cannot make an allocation and instead CCCL raises an exception.

Wow, that's a wide alignment, you might say, whoever needs that?

If I want to do GPUDirect accelerated IO, my pointers have to be [4096-byte aligned](https://docs.nvidia.com/gpudirect-storage/best-practices-guide/index.html#io-pattern-4)

In rapids today we use RMM's aligned_allocator_adaptor to handle this case, but it perhaps this is general purpose enough that such an adaptor should live in CCCL.

### Describe the solution you'd like

Ideally: support arbitrary alignment in `allocate` and friends.

But probably: provide an adaptor that can handle this.

Relatedly: provide a statically queryable property on memory resources that advertises what alignment guarantees they provide of returned pointers.

### Describe alternatives you've considered

Just use the RMM version.

### Additional context

_No response_

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.