Overaligned New
- Dominant language
- Python
- Stars
- 593
- Forks
- 163
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 60
Description
**Describe the bug**
Compiling any code with the `new` allocation results in many warnings due to the default C++ standard and the `DACE_ALIGN` macro.
Example:
```
/home/primrose/Work/npbench/.dacecache/fusion/src/cpu/fusion.cpp:43:52: note: uses ‘void* operator new [](std::size_t)’, which does not have an alignment parameter
/home/primrose/Work/npbench/.dacecache/fusion/src/cpu/fusion.cpp:43:52: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
/home/primrose/Work/npbench/.dacecache/fusion/src/cpu/fusion.cpp:45:52: warning: ‘new’ of type ‘dace::uint’ {aka ‘unsigned int’} with extended alignment 64 [-Waligned-new=]
45 | j_coord = new dace::uint DACE_ALIGN(64)[(R * R)];
```
`DACE_ALIGN(64)` should be expanded to `new (std::align_val_t(64)) ...` and not to `__attribute__((aligned(N)))`. If we want to use this feature, we must also enable the `-faligned-new` flag on GCC by default or move our default C++ standard from C++14 to C++17.
If warnings are not ignored, you can see this in any SDFG with a CPU_Heap access node.
I suggest moving the required C++ standard to 17.
Contributor guide
Assessment
This issue has not been assessed yet.