Skip to content

Use C++17 aligned memory allocation#1986

Closed
smithsg84 wants to merge 3 commits intodevelopfrom
feature/smith84/use-std-aligned-allocation
Closed

Use C++17 aligned memory allocation#1986
smithsg84 wants to merge 3 commits intodevelopfrom
feature/smith84/use-std-aligned-allocation

Conversation

@smithsg84
Copy link
Member

Use C++17 aligned memory allocation rather than platform/compiler allocators

With the adoption of C++17 requirement for RAJA the standard aligned memory allocator (std::aligned_alloc) is available and can replace platform / compiler specific options. This PR removes CMake checks for the platform allocators and simplifies the aligned memory allocator wrappers.

  • This PR is a refactoring
  • It does the following (modify list as needed):
    • Refactors the internal aligned memory allocators to use the std allocators.

Discussion on removal is in a prior cmake fix that has been closed #1985. This PR replaces that change with a more complete change.

@smithsg84
Copy link
Member Author

@MrBurmark @artv3 Based on discussion in #1985 I have removed the old checks for aligned memory allocators and replaced using the C++17 aligned allocators. Simple testing showed no measurable performance difference between the posix_memalign and std::aligned_alloc.

@smithsg84
Copy link
Member Author

Deep sigh, Windows MSVC compiler does not support std::aligned_alloc so the platform specific calls are needed.

@smithsg84
Copy link
Member Author

Closing PR.

Windows MSVC compiler does not support std::aligned_alloc as of 2/5/2026, see notes section.

MacOS CI tests were failing when using the std::aligned_alloc allocator.

@smithsg84 smithsg84 closed this Feb 6, 2026
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.

3 participants