From ac6aa80fc1224ed8bd854bf0a09c1a247307b0fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 2 Aug 2022 01:20:14 +0200 Subject: [PATCH] gl-info,vk-info: print compiled and detected CPU features. I wondered if I should put them into the GL/VK startup log, but while definitely useful, they don't really have any relation to GPU drivers. So it's just here for now. --- src/Magnum/Platform/gl-info.cpp | 66 ++++++++------------------------- src/Magnum/Vk/vk-info.cpp | 62 ++++++------------------------- 2 files changed, 26 insertions(+), 102 deletions(-) diff --git a/src/Magnum/Platform/gl-info.cpp b/src/Magnum/Platform/gl-info.cpp index d0a317823..2c18680e3 100644 --- a/src/Magnum/Platform/gl-info.cpp +++ b/src/Magnum/Platform/gl-info.cpp @@ -23,6 +23,7 @@ DEALINGS IN THE SOFTWARE. */ +#include #include #include @@ -154,8 +155,16 @@ are supported. Used application: Platform::WindowlessGlxApplication Compilation flags: CORRADE_BUILD_DEPRECATED + CORRADE_BUILD_MULTITHREADED CORRADE_TARGET_UNIX + CORRADE_TARGET_X86 + CORRADE_TARGET_GCC + CORRADE_TARGET_LIBSTDCXX MAGNUM_BUILD_DEPRECATED +Compiled CPU features: + Sse2|Sse3|Ssse3|Sse41|Sse42 +Detected CPU features: + Sse2|Sse3|Ssse3|Sse41|Sse42|Avx|Popcnt|AvxF16c Renderer: AMD Radeon R7 M260 Series by ATI Technologies Inc. OpenGL version: 4.5.13399 Compatibility Profile Context 15.201.1151 @@ -319,57 +328,6 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #ifdef CORRADE_TARGET_DINKUMWARE Debug{} << " CORRADE_TARGET_DINKUMWARE"; #endif - #ifdef CORRADE_TARGET_SSE2 - { - Debug d; - d << " CORRADE_TARGET_SSE2"; - #ifdef CORRADE_TARGET_SSE3 - d << Debug::nospace << ",SSE3"; - #endif - #ifdef CORRADE_TARGET_SSSE3 - d << Debug::nospace << ",SSSE3"; - #endif - #ifdef CORRADE_TARGET_SSE41 - d << Debug::nospace << ",SSE41"; - #endif - #ifdef CORRADE_TARGET_SSE42 - d << Debug::nospace << ",SSE42"; - #endif - } - #endif - #ifdef CORRADE_TARGET_AVX - { - Debug d; - d << " CORRADE_TARGET_AVX"; - #ifdef CORRADE_TARGET_AVX_F16C - d << Debug::nospace << ",AVX_F16C"; - #endif - #ifdef CORRADE_TARGET_AVX_FMA - d << Debug::nospace << ",AVX_FMA"; - #endif - #ifdef CORRADE_TARGET_AVX2 - d << Debug::nospace << ",AVX2"; - #endif - #ifdef CORRADE_TARGET_AVX512F - d << Debug::nospace << ",AVX512F"; - #endif - } - #endif - #ifdef CORRADE_TARGET_NEON - { - Debug d; - d << " CORRADE_TARGET_NEON"; - #ifdef CORRADE_TARGET_NEON_FP16 - d << Debug::nospace << ",NEON_FP16"; - #endif - #ifdef CORRADE_TARGET_NEON_FMA - d << Debug::nospace << ",NEON_FMA"; - #endif - } - #endif - #ifdef CORRADE_TARGET_SIMD128 - Debug{} << " CORRADE_TARGET_SIMD128"; - #endif #ifdef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT Debug{} << " CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT"; #endif @@ -400,6 +358,12 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #ifdef MAGNUM_TARGET_HEADLESS Debug{} << " MAGNUM_TARGET_HEADLESS"; #endif + Debug{} << "Compiled CPU features:"; + Debug{} << " " << Debug::packed << Cpu::compiledFeatures(); + #ifdef CORRADE_BUILD_CPU_RUNTIME_DISPATCH + Debug{} << "Detected CPU features:"; + Debug{} << " " << Debug::packed << Cpu::runtimeFeatures(); + #endif Debug{} << ""; /* Create context here, so the context creation info is displayed at proper diff --git a/src/Magnum/Vk/vk-info.cpp b/src/Magnum/Vk/vk-info.cpp index b207825b1..6bb13b2e1 100644 --- a/src/Magnum/Vk/vk-info.cpp +++ b/src/Magnum/Vk/vk-info.cpp @@ -23,6 +23,7 @@ DEALINGS IN THE SOFTWARE. */ +#include #include #include "Magnum/Vk/DeviceFeatures.h" @@ -87,9 +88,11 @@ Compilation flags: CORRADE_TARGET_X86 CORRADE_TARGET_GCC CORRADE_TARGET_LIBSTDCXX - CORRADE_TARGET_SSE2,SSE3,SSSE3,SSE41,SSE42 - CORRADE_TARGET_AVX,AVX_F16C,AVX_FMA,AVX2 MAGNUM_BUILD_DEPRECATED +Compiled CPU features: + Sse2|Sse3|Ssse3|Sse41|Sse42 +Detected CPU features: + Sse2|Sse3|Ssse3|Sse41|Sse42|Avx|Avx2|Popcnt|Lzcnt|Bmi1|AvxF16c|AvxFma Reported instance version: Vulkan 1.2.203 Reported instance layers: @@ -231,55 +234,6 @@ int main(int argc, char** argv) { #ifdef CORRADE_TARGET_DINKUMWARE Debug{} << " CORRADE_TARGET_DINKUMWARE"; #endif - #ifdef CORRADE_TARGET_SSE2 - { - Debug d; - d << " CORRADE_TARGET_SSE2"; - #ifdef CORRADE_TARGET_SSE3 - d << Debug::nospace << ",SSE3"; - #endif - #ifdef CORRADE_TARGET_SSSE3 - d << Debug::nospace << ",SSSE3"; - #endif - #ifdef CORRADE_TARGET_SSE41 - d << Debug::nospace << ",SSE41"; - #endif - #ifdef CORRADE_TARGET_SSE42 - d << Debug::nospace << ",SSE42"; - #endif - } - #endif - #ifdef CORRADE_TARGET_AVX - { - Debug d; - d << " CORRADE_TARGET_AVX"; - #ifdef CORRADE_TARGET_AVX_F16C - d << Debug::nospace << ",AVX_F16C"; - #endif - #ifdef CORRADE_TARGET_AVX_FMA - d << Debug::nospace << ",AVX_FMA"; - #endif - #ifdef CORRADE_TARGET_AVX2 - d << Debug::nospace << ",AVX2"; - #endif - #ifdef CORRADE_TARGET_AVX512F - d << Debug::nospace << ",AVX512F"; - #endif - } - #endif - #ifdef CORRADE_TARGET_NEON - { - Debug d; - d << " CORRADE_TARGET_NEON"; - #ifdef CORRADE_TARGET_NEON_FP16 - d << Debug::nospace << ",NEON_FP16"; - #endif - #ifdef CORRADE_TARGET_NEON_FMA - d << Debug::nospace << ",NEON_FMA"; - #endif - } - #endif - /* CORRADE_TARGET_SIMD128 omitted */ #ifdef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT Debug{} << " CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT"; #endif @@ -295,6 +249,12 @@ int main(int argc, char** argv) { #ifdef MAGNUM_BUILD_STATIC Debug{} << " MAGNUM_BUILD_STATIC"; #endif + Debug{} << "Compiled CPU features:"; + Debug{} << " " << Debug::packed << Cpu::compiledFeatures(); + #ifdef CORRADE_BUILD_CPU_RUNTIME_DISPATCH + Debug{} << "Detected CPU features:"; + Debug{} << " " << Debug::packed << Cpu::runtimeFeatures(); + #endif Debug{} << ""; const Vk::Version instanceVersion = Vk::enumerateInstanceVersion();