From 52bdfbc7fcdba4db8dab27f3ed7606de5e3f536f Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Wed, 29 Jun 2011 11:53:15 +0000 Subject: [PATCH] added OS info to gpu tests --- modules/gpu/test/test_main.cpp | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/modules/gpu/test/test_main.cpp b/modules/gpu/test/test_main.cpp index 3a2df605e..a07334975 100644 --- a/modules/gpu/test/test_main.cpp +++ b/modules/gpu/test/test_main.cpp @@ -44,9 +44,30 @@ #ifdef HAVE_CUDA void print_info() -{ +{ +#if defined _WIN32 +# if define _WIN64 + puts("OS: Windows 64\n"); +# else + puts("OS: Windows 32\n"); +# endif +#elif defined linux +# if defined _LP64 + puts("OS: Linux 64\n"); +# else + puts("OS: Linux 32\n"); +# endif +#elif defined __APPLE__ +# if defined _LP64 + puts("OS: Apple 64\n"); +# else + puts("OS: Apple 32\n"); +# endif +#endif + int deviceCount = cv::gpu::getCudaEnabledDeviceCount(); + printf("Found %d CUDA devices\n\n", deviceCount); for (int i = 0; i < deviceCount; ++i) @@ -57,12 +78,13 @@ void print_info() printf("\tCompute capability version: %d.%d\n", info.majorVersion(), info.minorVersion()); printf("\tTotal memory: %d Mb\n", static_cast(static_cast(info.totalMemory() / 1024.0) / 1024.0)); printf("\tFree memory: %d Mb\n", static_cast(static_cast(info.freeMemory() / 1024.0) / 1024.0)); - if (!info.isCompatible()) - printf("\tThis device is not compatible with current GPU module build\n"); - printf("\n"); + if (info.isCompatible()) + puts("\tThis device is compatible with current GPU module build\n"); + else + puts("\tThis device is NOT compatible with current GPU module build\n"); } - printf("GPU module was compiled for next GPU archs:\n"); + puts("GPU module was compiled for next GPU archs:"); printf("\tBIN:%s\n", CUDA_ARCH_BIN); printf("\tPTX:%s\n\n", CUDA_ARCH_PTX); } @@ -104,4 +126,4 @@ int main(int argc, char** argv) return 0; } -#endif // HAVE_CUDA \ No newline at end of file +#endif // HAVE_CUDA