From 1d5db48797b1633626f51bea74c4eb98c22af7c5 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 17 Feb 2017 14:11:36 +0100 Subject: [PATCH] credits: show binary arch (32/64) in the header --- ccminer.cpp | 7 ++++--- miner.h | 10 ++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ccminer.cpp b/ccminer.cpp index 776476a..95d9cd2 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -3651,12 +3651,13 @@ int main(int argc, char *argv[]) printf("*** ccminer " PACKAGE_VERSION " for nVidia GPUs by tpruvot@github ***\n"); if (!opt_quiet) { + const char* arch = is_x64() ? "64-bits" : "32-bits"; #ifdef _MSC_VER - printf(" Built with VC++ %d and nVidia CUDA SDK %d.%d\n\n", msver(), + printf(" Built with VC++ %d and nVidia CUDA SDK %d.%d %s\n\n", msver(), #else - printf(" Built with the nVidia CUDA Toolkit %d.%d\n\n", + printf(" Built with the nVidia CUDA Toolkit %d.%d %s\n\n", #endif - CUDART_VERSION/1000, (CUDART_VERSION % 1000)/10); + CUDART_VERSION/1000, (CUDART_VERSION % 1000)/10, arch); printf(" Originally based on Christian Buchner and Christian H. project\n"); printf(" Include some algos from alexis78, djm34, sp, tsiv and klausT.\n\n"); printf("BTC donation address: 1AJdfCpLWPNoAMDfHF1wD5y8VgKSSTHxPo (tpruvot)\n\n"); diff --git a/miner.h b/miner.h index a51e079..c3253e2 100644 --- a/miner.h +++ b/miner.h @@ -118,6 +118,16 @@ static inline bool is_windows(void) { #endif } +static inline bool is_x64(void) { +#if defined(__x86_64__) || defined(_WIN64) || defined(__aarch64__) + return 1; +#elif defined(__amd64__) || defined(__amd64) || defined(_M_X64) || defined(_M_IA64) + return 1; +#else + return 0; +#endif +} + #if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define WANT_BUILTIN_BSWAP #else