alpaka
alpaka copied to clipboard
Support aligned buffer allocations
The current buffer allocation API's allow to specify the size of the requested block of memory, but the alignment of the memory block is unspecified. Internally, we rely on the default alignment of the underlying backend. For the CPU backend, we choose the alignment based on the available vectorization width during compilation.
Having the right alignment is relevant for e.g. vectorization or optimizing memory access patterns.
I would like to propose to add support for explicitely specifying an alignment when allocating a buffer. Furthermore, we might consider documenting the default alignment, if no alignment is specified.
This is a generalization of #1686.
It turns out I would need this in LLAMA as well.