From 26b51a557be4cc49c29e121bb7c26fde0e00c63c Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Sat, 24 Jan 2015 10:43:58 +0100 Subject: [PATCH] Allow different intensity per device and clean the old variables, no more required --- Algo256/blake256.cu | 3 +-- Algo256/keccak256.cu | 3 +-- JHA/jackpotcoin.cu | 7 +++---- api.cpp | 24 +++++++++--------------- ccminer.cpp | 40 +++++++++++++++++++++++++++------------- cuda.cpp | 7 +++++++ cuda_nist5.cu | 7 +++---- fuguecoin.cpp | 3 +-- groestlcoin.cpp | 15 +++++++-------- heavy/heavy.cu | 3 +-- lyra2/lyra2RE.cu | 3 +-- miner.h | 6 +++--- myriadgroestl.cpp | 15 +++++---------- pentablake.cu | 3 +-- quark/animecoin.cu | 3 +-- quark/quarkcoin.cu | 3 +-- qubit/deep.cu | 5 ++--- qubit/doom.cu | 3 +-- qubit/qubit.cu | 3 +-- x11/fresh.cu | 3 +-- x11/s3.cu | 3 +-- x11/x11.cu | 3 +-- x13/x13.cu | 3 +-- x15/whirlpool.cu | 3 +-- x15/x14.cu | 4 ++-- x15/x15.cu | 3 +-- x17/x17.cu | 4 ++-- 27 files changed, 86 insertions(+), 96 deletions(-) diff --git a/Algo256/blake256.cu b/Algo256/blake256.cu index fdcfecb..2f1d2b9 100644 --- a/Algo256/blake256.cu +++ b/Algo256/blake256.cu @@ -391,8 +391,7 @@ extern "C" int scanhash_blake256(int thr_id, uint32_t *pdata, const uint32_t *pt uint32_t crcsum; #endif int intensity = (device_sm[device_map[thr_id]] > 500) ? 22 : 20; - uint32_t throughput = opt_work_size ? opt_work_size : (1 << intensity); - apiReportThroughput(thr_id, (uint32_t) throughput); + uint32_t throughput = device_intensity(thr_id, __func__, 1U << intensity); throughput = min(throughput, max_nonce - first_nonce); int rc = 0; diff --git a/Algo256/keccak256.cu b/Algo256/keccak256.cu index 6bb3b0e..16f65a0 100644 --- a/Algo256/keccak256.cu +++ b/Algo256/keccak256.cu @@ -41,8 +41,7 @@ extern "C" int scanhash_keccak256(int thr_id, uint32_t *pdata, unsigned long *hashes_done) { const uint32_t first_nonce = pdata[19]; - uint32_t throughput = opt_work_size ? opt_work_size : (1 << 21); // 256*256*8*4 - apiReportThroughput(thr_id, throughput); + uint32_t throughput = device_intensity(thr_id, __func__, 1U << 21); // 256*256*8*4 throughput = min(throughput, (max_nonce - first_nonce)); if (opt_benchmark) diff --git a/JHA/jackpotcoin.cu b/JHA/jackpotcoin.cu index fc7de94..25066fd 100644 --- a/JHA/jackpotcoin.cu +++ b/JHA/jackpotcoin.cu @@ -93,13 +93,12 @@ extern "C" int scanhash_jackpot(int thr_id, uint32_t *pdata, { const uint32_t first_nonce = pdata[19]; + int throughput = (int) device_intensity(thr_id, __func__, 1U << 20); + throughput = min(throughput, (int)(max_nonce - first_nonce)); + if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x000f; - int throughput = opt_work_size ? opt_work_size : (1 << 20); // 256*4096 - apiReportThroughput(thr_id, (uint32_t) throughput); - throughput = min(throughput, (int)(max_nonce - first_nonce)); - if (!init[thr_id]) { cudaSetDevice(device_map[thr_id]); diff --git a/api.cpp b/api.cpp index 817ad43..6be91be 100644 --- a/api.cpp +++ b/api.cpp @@ -94,7 +94,6 @@ extern char *opt_api_allow; extern int opt_api_listen; /* port */ extern uint32_t accepted_count; extern uint32_t rejected_count; -extern uint32_t opt_work_adds; extern int num_cpus; extern struct stratum_ctx stratum; extern char* rpc_user; @@ -877,24 +876,19 @@ void *api_thread(void *userdata) } /* to be able to report the default value set in each algo */ -void apiReportThroughput(int thr_id, uint32_t throughput) +void api_set_throughput(int thr_id, uint32_t throughput) { struct cgpu_info *cgpu = &thr_info[thr_id].gpu; if (cgpu) { + uint32_t ws = throughput; + uint8_t i = 0; cgpu->throughput = throughput; - if (opt_intensity == 0) { - uint8_t i = 0; - uint32_t ws = throughput; - while (ws > 1 && i++ < 32) - ws = ws >> 1; - cgpu->intensity_int = i; - cgpu->intensity = (float) i; - } else { - cgpu->intensity_int = (uint8_t) opt_intensity; - cgpu->intensity = (float) opt_intensity; - if (opt_work_adds) { - cgpu->intensity += ((float) opt_work_adds / (1U << opt_intensity)); - } + while (ws > 1 && i++ < 32) + ws = ws >> 1; + cgpu->intensity_int = i; + cgpu->intensity = (float) i; + if (i && (1U << i) < throughput) { + cgpu->intensity += ((float) (throughput-(1U << i)) / (1U << i)); } } } \ No newline at end of file diff --git a/ccminer.cpp b/ccminer.cpp index b8b0c74..80a959b 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -171,6 +171,7 @@ int active_gpus; char * device_name[MAX_GPUS]; short device_map[MAX_GPUS] = { 0 }; long device_sm[MAX_GPUS] = { 0 }; +uint32_t gpus_intensity[MAX_GPUS] = { 0 }; char *rpc_user = NULL; static char *rpc_url; static char *rpc_userpass; @@ -197,9 +198,6 @@ static double *thr_hashrates; uint64_t global_hashrate = 0; double global_diff = 0.0; int opt_statsavg = 30; -int opt_intensity = 0; -uint32_t opt_work_size = 0; /* default */ -uint32_t opt_work_adds = 0; // strdup on char* to allow a common free() if used static char* opt_syslog_pfx = strdup(PROGRAM_NAME); char *opt_api_allow = strdup("127.0.0.1"); /* 0.0.0.0 for all ips */ @@ -1831,16 +1829,32 @@ static void parse_arg(int key, char *arg) v = (uint32_t) d; if (v < 0 || v > 31) show_usage_and_exit(1); - opt_intensity = v; - if (v > 7) { /* 0 = default */ - opt_work_size = (1 << v); - if ((d - v) > 0.0) { - opt_work_adds = (uint32_t) floor((d - v) * (1 << (v-8))) * 256; - opt_work_size += opt_work_adds; - applog(LOG_INFO, "Adding %u threads to intensity %u, %u cuda threads", - opt_work_adds, v, opt_work_size); - } else { - applog(LOG_INFO, "Intensity set to %u, %u cuda threads", v, opt_work_size); + { + int n = 0, adds = 0; + int ngpus = cuda_num_devices(); + char * pch = strtok(arg,","); + if (pch == NULL) { + for (n=0; n < ngpus; n++) + gpus_intensity[n] = (1 << v); + break; + } + while (pch != NULL) { + d = atof(pch); + v = (uint32_t) d; + if (v > 7) { /* 0 = default */ + gpus_intensity[n] = (1 << v); + if ((d - v) > 0.0) { + adds = (uint32_t) floor((d - v) * (1 << (v-8))) * 256; + gpus_intensity[n] += adds; + applog(LOG_INFO, "Adding %u threads to intensity %u, %u cuda threads", + adds, v, gpus_intensity[n]); + } else { + applog(LOG_INFO, "Intensity set to %u, %u cuda threads", + v, gpus_intensity[n]); + } + } + n++; + pch = strtok(NULL, ","); } } break; diff --git a/cuda.cpp b/cuda.cpp index bcdf0d0..3e2caa5 100644 --- a/cuda.cpp +++ b/cuda.cpp @@ -115,6 +115,13 @@ int cuda_finddevice(char *name) return -1; } +uint32_t device_intensity(int thr_id, const char *func, uint32_t defcount) +{ + uint32_t throughput = gpus_intensity[thr_id] ? gpus_intensity[thr_id] : defcount; + api_set_throughput(thr_id, throughput); + return throughput; +} + // Zeitsynchronisations-Routine von cudaminer mit CPU sleep typedef struct { double value[8]; } tsumarray; cudaError_t MyStreamSynchronize(cudaStream_t stream, int situation, int thr_id) diff --git a/cuda_nist5.cu b/cuda_nist5.cu index 035754f..a745a88 100644 --- a/cuda_nist5.cu +++ b/cuda_nist5.cu @@ -72,13 +72,12 @@ extern "C" int scanhash_nist5(int thr_id, uint32_t *pdata, { const uint32_t first_nonce = pdata[19]; + int throughput = (int) device_intensity(thr_id, __func__, 1 << 20); // 256*256*16 + throughput = min(throughput, (int) (max_nonce - first_nonce)); + if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0x00FF; - int throughput = opt_work_size ? opt_work_size : (1 << 20); // 256*4096 - apiReportThroughput(thr_id, (uint32_t) throughput); - throughput = min(throughput, (int) (max_nonce - first_nonce)); - if (!init[thr_id]) { cudaSetDevice(device_map[thr_id]); diff --git a/fuguecoin.cpp b/fuguecoin.cpp index 6ed4c06..72ad965 100644 --- a/fuguecoin.cpp +++ b/fuguecoin.cpp @@ -27,8 +27,7 @@ extern "C" int scanhash_fugue256(int thr_id, uint32_t *pdata, const uint32_t *pt { uint32_t start_nonce = pdata[19]++; int intensity = (device_sm[device_map[thr_id]] > 500) ? 22 : 19; - uint32_t throughput = opt_work_size ? opt_work_size : (1 << intensity); - apiReportThroughput(thr_id, throughput); + int throughput = (int) device_intensity(thr_id, __func__, 1 << intensity); // 256*256*8 throughput = min(throughput, max_nonce - start_nonce); if (opt_benchmark) diff --git a/groestlcoin.cpp b/groestlcoin.cpp index dd34e03..0073744 100644 --- a/groestlcoin.cpp +++ b/groestlcoin.cpp @@ -45,11 +45,11 @@ extern "C" void groestlhash(void *state, const void *input) sph_groestl512_context ctx_groestl[2]; //these uint512 in the c++ source of the client are backed by an array of uint32 - uint32_t hashA[16], hashB[16]; + uint32_t hashA[16], hashB[16]; sph_groestl512_init(&ctx_groestl[0]); sph_groestl512 (&ctx_groestl[0], input, 80); //6 - sph_groestl512_close(&ctx_groestl[0], hashA); //7 + sph_groestl512_close(&ctx_groestl[0], hashA); //7 sph_groestl512_init(&ctx_groestl[1]); sph_groestl512 (&ctx_groestl[1], hashA, 64); //6 @@ -62,10 +62,9 @@ static bool init[MAX_GPUS] = { 0 }; extern "C" int scanhash_groestlcoin(int thr_id, uint32_t *pdata, const uint32_t *ptarget, uint32_t max_nonce, unsigned long *hashes_done) -{ +{ uint32_t start_nonce = pdata[19]++; - uint32_t throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*2048 - apiReportThroughput(thr_id, throughput); + uint32_t throughput = device_intensity(thr_id, __func__, 1 << 19); // 256*256*8 throughput = min(throughput, max_nonce - start_nonce); uint32_t *outputHash = (uint32_t*)malloc(throughput * 16 * sizeof(uint32_t)); @@ -79,7 +78,7 @@ extern "C" int scanhash_groestlcoin(int thr_id, uint32_t *pdata, const uint32_t groestlcoin_cpu_init(thr_id, throughput); init[thr_id] = true; } - + // Endian Drehung ist notwendig uint32_t endiandata[32]; for (int kk=0; kk < 32; kk++) @@ -87,7 +86,7 @@ extern "C" int scanhash_groestlcoin(int thr_id, uint32_t *pdata, const uint32_t // Context mit dem Endian gedrehten Blockheader vorbereiten (Nonce wird später ersetzt) groestlcoin_cpu_setBlock(thr_id, endiandata, (void*)ptarget); - + do { // GPU uint32_t foundNounce = 0xFFFFFFFF; @@ -118,7 +117,7 @@ extern "C" int scanhash_groestlcoin(int thr_id, uint32_t *pdata, const uint32_t else pdata[19] += throughput; } while (pdata[19] < max_nonce && !work_restart[thr_id].restart); - + *hashes_done = pdata[19] - start_nonce + 1; free(outputHash); return 0; diff --git a/heavy/heavy.cu b/heavy/heavy.cu index 1177e0b..b70b7fd 100644 --- a/heavy/heavy.cu +++ b/heavy/heavy.cu @@ -136,8 +136,7 @@ int scanhash_heavy(int thr_id, uint32_t *pdata, { const uint32_t first_nonce = pdata[19]; // CUDA will process thousands of threads. - int throughput = opt_work_size ? opt_work_size : (1 << 19) - 256; // 256*2048 - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, (1U << 19) - 256); throughput = min(throughput, (int)(max_nonce - first_nonce)); int rc = 0; diff --git a/lyra2/lyra2RE.cu b/lyra2/lyra2RE.cu index 40aa8bb..12f9d26 100644 --- a/lyra2/lyra2RE.cu +++ b/lyra2/lyra2RE.cu @@ -63,8 +63,7 @@ extern "C" int scanhash_lyra2(int thr_id, uint32_t *pdata, { const uint32_t first_nonce = pdata[19]; int intensity = (device_sm[device_map[thr_id]] >= 500 && !is_windows()) ? 18 : 17; - int throughput = opt_work_size ? opt_work_size : (1 << intensity); // 18=256*256*4; - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, 1U << intensity); // 18=256*256*4; throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) diff --git a/miner.h b/miner.h index c23c133..156b161 100644 --- a/miner.h +++ b/miner.h @@ -378,7 +378,7 @@ extern int scanhash_x17(int thr_id, uint32_t *pdata, /* api related */ void *api_thread(void *userdata); -void apiReportThroughput(int thr_id, uint32_t throughput); +void api_set_throughput(int thr_id, uint32_t throughput); struct cgpu_info { uint8_t gpu_id; @@ -462,7 +462,6 @@ extern bool opt_debug; extern bool opt_quiet; extern bool opt_protocol; extern bool opt_tracegpu; -extern int opt_intensity; extern int opt_n_threads; extern int active_gpus; extern int opt_timeout; @@ -483,7 +482,6 @@ extern int api_thr_id; extern struct work_restart *work_restart; extern bool opt_trust_pool; extern uint16_t opt_vote; -extern uint32_t opt_work_size; extern uint64_t global_hashrate; extern double global_diff; @@ -492,6 +490,7 @@ extern double global_diff; extern char* device_name[MAX_GPUS]; extern short device_map[MAX_GPUS]; extern long device_sm[MAX_GPUS]; +extern uint32_t gpus_intensity[MAX_GPUS]; #define CL_N "\x1B[0m" #define CL_RED "\x1B[31m" @@ -535,6 +534,7 @@ extern int timeval_subtract(struct timeval *result, struct timeval *x, extern bool fulltest(const uint32_t *hash, const uint32_t *target); extern void diff_to_target(uint32_t *target, double diff); extern void get_currentalgo(char* buf, int sz); +extern uint32_t device_intensity(int thr_id, const char *func, uint32_t defcount); struct stratum_job { char *job_id; diff --git a/myriadgroestl.cpp b/myriadgroestl.cpp index 94abbac..a19808a 100644 --- a/myriadgroestl.cpp +++ b/myriadgroestl.cpp @@ -36,14 +36,9 @@ static bool init[MAX_GPUS] = { 0 }; extern "C" int scanhash_myriad(int thr_id, uint32_t *pdata, const uint32_t *ptarget, uint32_t max_nonce, unsigned long *hashes_done) -{ - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x000000ff; - +{ uint32_t start_nonce = pdata[19]++; - - uint32_t throughput = opt_work_size ? opt_work_size : (1 << 17); - apiReportThroughput(thr_id, throughput); + uint32_t throughput = device_intensity(thr_id, __func__, 1 << 17); throughput = min(throughput, max_nonce - start_nonce); uint32_t *outputHash = (uint32_t*)malloc(throughput * 16 * sizeof(uint32_t)); @@ -60,14 +55,14 @@ extern "C" int scanhash_myriad(int thr_id, uint32_t *pdata, const uint32_t *ptar #endif init[thr_id] = true; } - + uint32_t endiandata[32]; for (int kk=0; kk < 32; kk++) be32enc(&endiandata[kk], pdata[kk]); // Context mit dem Endian gedrehten Blockheader vorbereiten (Nonce wird später ersetzt) myriadgroestl_cpu_setBlock(thr_id, endiandata, (void*)ptarget); - + do { // GPU uint32_t foundNounce = 0xFFFFFFFF; @@ -80,7 +75,7 @@ extern "C" int scanhash_myriad(int thr_id, uint32_t *pdata, const uint32_t *ptar uint32_t tmpHash[8]; endiandata[19] = SWAP32(foundNounce); myriadhash(tmpHash, endiandata); - if (tmpHash[7] <= Htarg && + if (tmpHash[7] <= Htarg && fulltest(tmpHash, ptarget)) { pdata[19] = foundNounce; *hashes_done = foundNounce - start_nonce + 1; diff --git a/pentablake.cu b/pentablake.cu index 5c6837b..0e9307d 100644 --- a/pentablake.cu +++ b/pentablake.cu @@ -370,8 +370,7 @@ extern "C" int scanhash_pentablake(int thr_id, uint32_t *pdata, const uint32_t * const uint32_t first_nonce = pdata[19]; uint32_t endiandata[20]; int rc = 0; - int throughput = opt_work_size ? opt_work_size : (128 * 2560); // 18.5 - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, 128U * 2560); // 18.5 throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) diff --git a/quark/animecoin.cu b/quark/animecoin.cu index ca5285e..180da4a 100644 --- a/quark/animecoin.cu +++ b/quark/animecoin.cu @@ -167,8 +167,7 @@ extern "C" int scanhash_anime(int thr_id, uint32_t *pdata, unsigned long *hashes_done) { const uint32_t first_nonce = pdata[19]; - int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*2048 - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, 1 << 19); // 256*256*8 throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) diff --git a/quark/quarkcoin.cu b/quark/quarkcoin.cu index e245af2..69314cc 100644 --- a/quark/quarkcoin.cu +++ b/quark/quarkcoin.cu @@ -138,8 +138,7 @@ extern "C" int scanhash_quark(int thr_id, uint32_t *pdata, { const uint32_t first_nonce = pdata[19]; - int throughput = opt_work_size ? opt_work_size : (1 << 20); // 256*4096 - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, 1 << 20); // 256*4096 throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) diff --git a/qubit/deep.cu b/qubit/deep.cu index 19ab71a..da81523 100644 --- a/qubit/deep.cu +++ b/qubit/deep.cu @@ -60,9 +60,8 @@ extern "C" int scanhash_deep(int thr_id, uint32_t *pdata, { const uint32_t first_nonce = pdata[19]; uint32_t endiandata[20]; - int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8 - apiReportThroughput(thr_id, (uint32_t) throughput); - throughput = min(throughput, (int)(max_nonce - first_nonce)); + int throughput = (int) device_intensity(thr_id, __func__, 1U << 19); // 256*256*8 + 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 24b520b..bfa0556 100644 --- a/qubit/doom.cu +++ b/qubit/doom.cu @@ -40,8 +40,7 @@ extern "C" int scanhash_doom(int thr_id, uint32_t *pdata, { const uint32_t first_nonce = pdata[19]; uint32_t endiandata[20]; - uint32_t throughput = opt_work_size ? opt_work_size : (1 << 22); // 256*256*8*8 - apiReportThroughput(thr_id, (uint32_t) throughput); + uint32_t throughput = device_intensity(thr_id, __func__, 1U << 22); // 256*256*8*8 throughput = min(throughput, (max_nonce - first_nonce)); if (opt_benchmark) diff --git a/qubit/qubit.cu b/qubit/qubit.cu index 02aa536..987b784 100644 --- a/qubit/qubit.cu +++ b/qubit/qubit.cu @@ -80,8 +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 - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, 1U << 19); // 256*256*8 throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) diff --git a/x11/fresh.cu b/x11/fresh.cu index e11aa39..0ebe3ae 100644 --- a/x11/fresh.cu +++ b/x11/fresh.cu @@ -77,8 +77,7 @@ extern "C" int scanhash_fresh(int thr_id, uint32_t *pdata, const uint32_t first_nonce = pdata[19]; uint32_t endiandata[20]; - int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, 1 << 19); throughput = min(throughput, (int) (max_nonce - first_nonce)); if (opt_benchmark) diff --git a/x11/s3.cu b/x11/s3.cu index 9878206..dd2e390 100644 --- a/x11/s3.cu +++ b/x11/s3.cu @@ -62,8 +62,7 @@ extern "C" int scanhash_s3(int thr_id, uint32_t *pdata, // reduce by one the intensity on windows intensity--; #endif - int throughput = opt_work_size ? opt_work_size : (1 << intensity); - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, 1 << intensity); throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) diff --git a/x11/x11.cu b/x11/x11.cu index e5e21a1..5dc2980 100644 --- a/x11/x11.cu +++ b/x11/x11.cu @@ -133,8 +133,7 @@ extern "C" int scanhash_x11(int thr_id, uint32_t *pdata, { const uint32_t first_nonce = pdata[19]; int intensity = (device_sm[device_map[thr_id]] >= 500 && !is_windows()) ? 20 : 19; - int throughput = opt_work_size ? opt_work_size : (1 << intensity); // 20=256*256*16; - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, 1 << intensity); // 19=256*256*8; throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) diff --git a/x13/x13.cu b/x13/x13.cu index 4410bd8..abeca30 100644 --- a/x13/x13.cu +++ b/x13/x13.cu @@ -152,8 +152,7 @@ extern "C" int scanhash_x13(int thr_id, uint32_t *pdata, { const uint32_t first_nonce = pdata[19]; int intensity = 19; // (device_sm[device_map[thr_id]] > 500 && !is_windows()) ? 20 : 19; - int throughput = opt_work_size ? opt_work_size : (1 << intensity); // 19=256*256*8; - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, 1 << intensity); // 19=256*256*8; throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) diff --git a/x15/whirlpool.cu b/x15/whirlpool.cu index 7702e8e..193e2e7 100644 --- a/x15/whirlpool.cu +++ b/x15/whirlpool.cu @@ -57,8 +57,7 @@ extern "C" int scanhash_whc(int thr_id, uint32_t *pdata, { const uint32_t first_nonce = pdata[19]; uint32_t endiandata[20]; - int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, 1U << 19); // 19=256*256*8; throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) diff --git a/x15/x14.cu b/x15/x14.cu index b22f735..05b9201 100644 --- a/x15/x14.cu +++ b/x15/x14.cu @@ -163,8 +163,8 @@ extern "C" int scanhash_x14(int thr_id, uint32_t *pdata, { const uint32_t first_nonce = pdata[19]; uint32_t endiandata[20]; - int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; - apiReportThroughput(thr_id, (uint32_t) throughput); + + int throughput = (int) device_intensity(thr_id, __func__, 1U << 19); // 19=256*256*8; throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) diff --git a/x15/x15.cu b/x15/x15.cu index aa19929..34b3124 100644 --- a/x15/x15.cu +++ b/x15/x15.cu @@ -174,8 +174,7 @@ extern "C" int scanhash_x15(int thr_id, uint32_t *pdata, const uint32_t first_nonce = pdata[19]; uint32_t endiandata[20]; - int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; - apiReportThroughput(thr_id, (uint32_t) throughput); + int throughput = (int) device_intensity(thr_id, __func__, 1U << 19); // 19=256*256*8; throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark) diff --git a/x17/x17.cu b/x17/x17.cu index 00db242..f8c47a2 100644 --- a/x17/x17.cu +++ b/x17/x17.cu @@ -191,8 +191,8 @@ extern "C" int scanhash_x17(int thr_id, uint32_t *pdata, unsigned long *hashes_done) { const uint32_t first_nonce = pdata[19]; - int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; - apiReportThroughput(thr_id, (uint32_t) throughput); + + int throughput = (int) device_intensity(thr_id, __func__, 1U << 19); // 19=256*256*8; throughput = min(throughput, (int)(max_nonce - first_nonce)); if (opt_benchmark)