While working on the nanobind interface my friend found an error related to gcc16 that is now a hard error.
The error is related to the following construct:
mid_deg = new double DACE_ALIGN(64)[2];
(dace/codegen/targets/cpu.py:492 and :541), where DACE_ALIGN(N) expands to __attribute__((aligned(N))) on GCC/Clang (dace/runtime/include/dace/types.h).
A small test program:
int main() {
double *p = new double __attribute__((aligned(64)))[2]; // error on GCC 16
delete[] p;
}
fails with the error:
test.cpp: In function »int main()«:
test.cpp:2:58: error: Ausrichtung der Arrayelemente ist größer als die Elementgröße
2 | double *p = new double __attribute__((aligned(64)))[2]; // error on GCC 16
| ^
However, it only affects allocations of known small size.
According to my friend the annotation also does not have an effect.
If the alignment of the allocation should be controlled then std::align_val_t new expressions a C++17 feature must be used.
While working on the
nanobindinterface my friend found an error related togcc16that is now a hard error.The error is related to the following construct:
(
dace/codegen/targets/cpu.py:492and:541), whereDACE_ALIGN(N)expands to__attribute__((aligned(N)))on GCC/Clang (dace/runtime/include/dace/types.h).A small test program:
fails with the error:
However, it only affects allocations of known small size.
According to my friend the annotation also does not have an effect.
If the alignment of the allocation should be controlled then
std::align_val_tnewexpressions aC++17feature must be used.