Dear CMake List,
we are building HPC software with CMake. In many cases, we find that the performance of (auto)vectorization heavy code depends greatly on specifying the exact processor generation for optimally tuned binaries. That is no surprise, since a compiler's architecture flags just group an according set of available instructions for e.g. SIMD extensions. The question now is: Is there a generic CMake best-practice to specify the *exact* architecture -mtune/-march/-mcpu/-qarch/-x/... flags, ideally according to the currently used compiler (icc,gcc,xlc,pgc,...) just from the name of the processor generation? CMAKE_SYSTEM_PROCESSOR looks like it but its documentation is a bit short. Does it allow me to set details such as "bdver1", "corei7-avx" or "core-avx2" as targets (instead of generic "x86_64")? Note: Portability of binaries is not relevant since we can re-compile for each system (and have performance portable source code). Vice versa, is there a way already for setting the CUDA compute capabilities of a target via a CMake variable? For both cases, we currently hijack CXX flags and do switches on compilers, which is probably not the most generic way to write maintainable CMake scripts. For NVCC and Clang CUDA SM targets for PTX and SASS code embedding, we just have our own CMake variable, which is also sub-ideal for as it is not standardized. How do you usually address this? All the best, Axel -- Axel Huebl Phone +49 351 260 3582 https://www.hzdr.de/crp Computational Radiation Physics Laser Particle Acceleration Division Helmholtz-Zentrum Dresden - Rossendorf e.V. Bautzner Landstrasse 400, 01328 Dresden POB 510119, D-01314 Dresden Vorstand: Prof. Dr.Dr.h.c. R. Sauerbrey Prof. Dr.Dr.h.c. P. Joehnk VR 1693 beim Amtsgericht Dresden -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers