Skip to content

Conversation

prusnak
Copy link
Contributor

@prusnak prusnak commented Apr 10, 2023

Fixes #880

@sw
Copy link
Contributor

sw commented Apr 11, 2023

aligned_malloc requires the size to be a multiple of the alignment, which is probably fine for us. posix_memalign does not have that requirement.

Copy link
Member

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to add a GGML_ALIGNED_MALLOC macro somewhere at the start to avoid cumbersome #if in the code

@prusnak
Copy link
Contributor Author

prusnak commented Apr 13, 2023

Reworked the PR to use GGML_ALIGNED_MALLOC and GGML_ALIGNED_FREE macros.

which allows us to use aligned_alloc or _aligned_malloc functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use aligned_alloc() if aligned allocations are required

3 participants