1
0
mirror of https://github.com/GOSTSec/ccminer synced 2025-01-22 04:24:29 +00:00

xmr: allow to set intensity on command line

This commit is contained in:
Tanguy Pruvot 2017-01-08 22:32:17 +00:00
parent 804b5b5f53
commit 39aad5a003
2 changed files with 10 additions and 5 deletions

View File

@ -11,8 +11,8 @@
extern char *device_config[MAX_GPUS]; // -l 32x16
uint32_t cn_blocks = 32;
uint32_t cn_threads = 16;
static __thread uint32_t cn_blocks = 32;
static __thread uint32_t cn_threads = 16;
static uint32_t *d_long_state[MAX_GPUS];
static uint32_t *d_ctx_state[MAX_GPUS];
@ -44,12 +44,16 @@ extern "C" int scanhash_cryptonight(int thr_id, struct work* work, uint32_t max_
if (device_config[thr_id]) {
sscanf(device_config[thr_id], "%ux%u", &cn_blocks, &cn_threads);
throughput = cuda_default_throughput(thr_id, cn_blocks*cn_threads);
gpulog(LOG_INFO, thr_id, "Using %u x %u (%u) threads kernel launch config",
gpulog(LOG_INFO, thr_id, "Using %u x %u kernel launch config, %u threads",
cn_blocks, cn_threads, throughput);
} else {
throughput = cuda_default_throughput(thr_id, cn_blocks*cn_threads);
gpulog(LOG_INFO, thr_id, "Intensity set to %g, (%u x %u) %u threads",
throughput2intensity(throughput), cn_blocks, cn_threads, throughput);
if (throughput != cn_blocks*cn_threads && cn_threads) {
cn_blocks = throughput / cn_threads;
throughput = cn_threads * cn_blocks;
}
gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u threads (%ux%u)",
throughput2intensity(throughput), throughput, cn_blocks, cn_threads);
}
if(sizeof(size_t) == 4 && throughput > UINT32_MAX / MEMORY) {

View File

@ -10,6 +10,7 @@
#include "cryptonight.h"
#ifdef WIN32
// to prevent ui freeze
int cn_bfactor = 8;
int cn_bsleep = 100;
#else