diff --git a/JHA/jackpotcoin.cu b/JHA/jackpotcoin.cu index 4e1073d..5a436c8 100644 --- a/JHA/jackpotcoin.cu +++ b/JHA/jackpotcoin.cu @@ -93,7 +93,7 @@ extern "C" int scanhash_jackpot(int thr_id, uint32_t *pdata, ((uint32_t*)ptarget)[7] = 0x000f; int throughput = opt_work_size ? opt_work_size : (1 << 20); // 256*4096 - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); static bool init[8] = {0,0,0,0,0,0,0,0}; if (!init[thr_id]) diff --git a/heavy/heavy.cu b/heavy/heavy.cu index f733ef2..f3891e8 100644 --- a/heavy/heavy.cu +++ b/heavy/heavy.cu @@ -160,10 +160,7 @@ int scanhash_heavy_cpp(int thr_id, uint32_t *pdata, const uint32_t first_nonce = pdata[19]; /* to check */ // CUDA will process thousands of threads. int throughput = opt_work_size ? opt_work_size : (1 << 19); // 128*4096 - throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x000000ff; + throughput = min(throughput, (int)(max_nonce - first_nonce)); int rc = 0; uint32_t *hash = NULL; @@ -174,6 +171,9 @@ int scanhash_heavy_cpp(int thr_id, uint32_t *pdata, int nrmCalls[6]; memset(nrmCalls, 0, sizeof(int) * 6); + if (opt_benchmark) + ((uint32_t*)ptarget)[7] = 0x000000ff; + // für jeden Hash ein individuelles Target erstellen basierend // auf dem höchsten Bit, das in ptarget gesetzt ist. int highbit = findhighbit(ptarget, 8); diff --git a/keccak/keccak256.cu b/keccak/keccak256.cu index b539725..133ab7c 100644 --- a/keccak/keccak256.cu +++ b/keccak/keccak256.cu @@ -44,7 +44,7 @@ extern "C" int scanhash_keccak256(int thr_id, uint32_t *pdata, ((uint32_t*)ptarget)[7] = 0x0005; int throughput = opt_work_size ? opt_work_size : (1 << 21); // 256*256*8*4 - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); static bool init[8] = {0,0,0,0,0,0,0,0}; if (!init[thr_id]) { diff --git a/pentablake.cu b/pentablake.cu index ae87172..aaa6a9b 100644 --- a/pentablake.cu +++ b/pentablake.cu @@ -497,7 +497,7 @@ extern "C" int scanhash_pentablake(int thr_id, uint32_t *pdata, const uint32_t * uint32_t endiandata[20]; int rc = 0; int throughput = opt_work_size ? opt_work_size : (128 * 2560); // 18.5 - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (extra_results[0] != MAXU) { // possible extra result found in previous call diff --git a/quark/animecoin.cu b/quark/animecoin.cu index 0733008..9b8fd78 100644 --- a/quark/animecoin.cu +++ b/quark/animecoin.cu @@ -163,15 +163,13 @@ extern "C" int scanhash_anime(int thr_id, uint32_t *pdata, unsigned long *hashes_done) { const uint32_t first_nonce = pdata[19]; + static bool init[8] = { 0 }; + int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*2048 + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x00000f; - const uint32_t Htarg = ptarget[7]; - int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*2048 - throughput = min(throughput, max_nonce - first_nonce); - - static bool init[8] = {0,0,0,0,0,0,0,0}; if (!init[thr_id]) { cudaSetDevice(device_map[thr_id]); @@ -260,6 +258,7 @@ extern "C" int scanhash_anime(int thr_id, uint32_t *pdata, if (foundNonce != 0xffffffff) { uint32_t vhash64[8]; + const uint32_t Htarg = ptarget[7]; be32enc(&endiandata[19], foundNonce); animehash(vhash64, endiandata); diff --git a/quark/quarkcoin.cu b/quark/quarkcoin.cu index 2f05b3b..69c3bc8 100644 --- a/quark/quarkcoin.cu +++ b/quark/quarkcoin.cu @@ -133,10 +133,10 @@ extern "C" int scanhash_quark(int thr_id, uint32_t *pdata, unsigned long *hashes_done) { const uint32_t first_nonce = pdata[19]; - static bool init[8] = {0,0,0,0,0,0,0,0}; + static bool init[8] = { 0 }; int throughput = opt_work_size ? opt_work_size : (1 << 20); // 256*4096 - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x00F; diff --git a/qubit/deep.cu b/qubit/deep.cu index b68fbb7..8813744 100644 --- a/qubit/deep.cu +++ b/qubit/deep.cu @@ -61,7 +61,7 @@ extern "C" int scanhash_deep(int thr_id, uint32_t *pdata, static bool init[8] = {0,0,0,0,0,0,0,0}; uint32_t endiandata[20]; int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8 - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x0000f; diff --git a/qubit/doom.cu b/qubit/doom.cu index ba950cb..b566f68 100644 --- a/qubit/doom.cu +++ b/qubit/doom.cu @@ -41,7 +41,7 @@ extern "C" int scanhash_doom(int thr_id, uint32_t *pdata, static bool init[8] = {0,0,0,0,0,0,0,0}; uint32_t endiandata[20]; int throughput = opt_work_size ? opt_work_size : (1 << 22); // 256*256*8*8 - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x0000f; diff --git a/qubit/qubit.cu b/qubit/qubit.cu index 92db8a7..df2f886 100644 --- a/qubit/qubit.cu +++ b/qubit/qubit.cu @@ -80,7 +80,7 @@ extern "C" int scanhash_qubit(int thr_id, uint32_t *pdata, uint32_t endiandata[20]; const uint32_t first_nonce = pdata[19]; int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8 - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x0000ff; diff --git a/x11/fresh.cu b/x11/fresh.cu index 4745f0b..dc1a5a5 100644 --- a/x11/fresh.cu +++ b/x11/fresh.cu @@ -77,7 +77,7 @@ extern "C" int scanhash_fresh(int thr_id, uint32_t *pdata, uint32_t endiandata[20]; int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int) (max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x00ff; diff --git a/x11/s3.cu b/x11/s3.cu index 81b8624..2c7ac5e 100644 --- a/x11/s3.cu +++ b/x11/s3.cu @@ -55,15 +55,15 @@ extern "C" int scanhash_s3(int thr_id, uint32_t *pdata, unsigned long *hashes_done) { const uint32_t first_nonce = pdata[19]; - static bool init[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - + static bool init[8] = { 0 }; #ifdef WIN32 // reduce a bit the intensity on windows - int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; + int intensity = 19; // 256*256*8; #else - int throughput = opt_work_size ? opt_work_size : (1 << 20); // 256*256*8*2; + int intensity = 20; // 256*256*8*2; #endif - throughput = min(throughput, max_nonce - first_nonce); + int throughput = opt_work_size ? opt_work_size : (1 << intensity); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0xF; diff --git a/x11/x11.cu b/x11/x11.cu index 45afb52..8c2b5b6 100644 --- a/x11/x11.cu +++ b/x11/x11.cu @@ -137,7 +137,7 @@ extern "C" int scanhash_x11(int thr_id, uint32_t *pdata, static bool init[8] = { 0 }; int intensity = (device_sm[device_map[thr_id]] >= 500) ? 20 : 19; int throughput = opt_work_size ? opt_work_size : (1 << intensity); // 20=256*256*16; - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x000f; diff --git a/x13/x13.cu b/x13/x13.cu index cfb8d93..0dd72ce 100644 --- a/x13/x13.cu +++ b/x13/x13.cu @@ -155,7 +155,7 @@ extern "C" int scanhash_x13(int thr_id, uint32_t *pdata, const uint32_t first_nonce = pdata[19]; static bool init[8] = { 0 }; int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x000f; diff --git a/x15/whirlpool.cu b/x15/whirlpool.cu index c2ae9bc..f290404 100644 --- a/x15/whirlpool.cu +++ b/x15/whirlpool.cu @@ -57,7 +57,7 @@ extern "C" int scanhash_whc(int thr_id, uint32_t *pdata, static bool init[8] = {0,0,0,0,0,0,0,0}; uint32_t endiandata[20]; int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x0000ff; diff --git a/x15/x14.cu b/x15/x14.cu index 7b8121a..b772af0 100644 --- a/x15/x14.cu +++ b/x15/x14.cu @@ -167,7 +167,7 @@ extern "C" int scanhash_x14(int thr_id, uint32_t *pdata, static bool init[8] = { 0 }; uint32_t endiandata[20]; int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x000f; diff --git a/x15/x15.cu b/x15/x15.cu index 75e83f7..589cc43 100644 --- a/x15/x15.cu +++ b/x15/x15.cu @@ -177,7 +177,7 @@ extern "C" int scanhash_x15(int thr_id, uint32_t *pdata, uint32_t endiandata[20]; int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x00FF; diff --git a/x17/x17.cu b/x17/x17.cu index 3fbc604..8ae0ceb 100644 --- a/x17/x17.cu +++ b/x17/x17.cu @@ -193,12 +193,12 @@ extern "C" int scanhash_x17(int thr_id, uint32_t *pdata, unsigned long *hashes_done) { const uint32_t first_nonce = pdata[19]; - static bool init[8] = {0,0,0,0,0,0,0,0}; + static bool init[8] = { 0 }; int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; - throughput = min(throughput, max_nonce - first_nonce); + throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x00FF; + ((uint32_t*)ptarget)[7] = 0x00ff; if (!init[thr_id]) {