Immintrin-debug is implemented in C which is also desired (given that C code should be able to make use of this project). However, using the Immintrin-debug header file in a C++ translation unit will cause at least compiler errors (as C++ is less permissive). Anyhow, a lot of warnings are also present with C code at higher warning levels (let alone extra and/or pedantic warnings).
How to reproduce:
To translate using a C++ translation unit:
- cd /path/to/libxsmm; make test-cpp
To compile with a lot of warning flags:
- C++ translation: cd /path/to/libxsmm; make PEDANTIC=2 test-cpp
- C89 translation: cd /path/to/libxsmm; make PEDANTIC=2
Immintrin-debug may switch to some more sophisticated function-decoration at least with respect to "static" and "inline" (different meanings in C++ and C; for the latter "inline" for instance was only introduced in C99 and may be emulated prior to this standard).
I understand that not all of the above warnings will be resolved easily (nor they should as effort is not justified). However, it should work with C++ translation units.
Btw, compilers (regardless of C and C++) may or may not allow intrinsics with/without prototype functions plus if prototypes are present they may differ slightly between Intel and GNU intrinsic headers (aka void* vs e.g. float* in some places etc.). For the latter, casts may assume target signature with float* (or stronger type in general) even if say Intel's prototype has void* (assuming the stronger type works with any compiler as type-"promotion" [demotion] to void* is applied automatically and considered safe).
Immintrin-debug is implemented in C which is also desired (given that C code should be able to make use of this project). However, using the Immintrin-debug header file in a C++ translation unit will cause at least compiler errors (as C++ is less permissive). Anyhow, a lot of warnings are also present with C code at higher warning levels (let alone extra and/or pedantic warnings).
How to reproduce:
To translate using a C++ translation unit:
To compile with a lot of warning flags:
Immintrin-debug may switch to some more sophisticated function-decoration at least with respect to "static" and "inline" (different meanings in C++ and C; for the latter "inline" for instance was only introduced in C99 and may be emulated prior to this standard).
I understand that not all of the above warnings will be resolved easily (nor they should as effort is not justified). However, it should work with C++ translation units.
Btw, compilers (regardless of C and C++) may or may not allow intrinsics with/without prototype functions plus if prototypes are present they may differ slightly between Intel and GNU intrinsic headers (aka
void*vs e.g.float*in some places etc.). For the latter, casts may assume target signature withfloat*(or stronger type in general) even if say Intel's prototype hasvoid*(assuming the stronger type works with any compiler as type-"promotion" [demotion] tovoid*is applied automatically and considered safe).