mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Intensity can be set for each pool individually
This commit is contained in:
parent
dca83c1112
commit
efe1ebd7ae
3
miner.h
3
miner.h
@ -1218,6 +1218,9 @@ struct pool {
|
|||||||
char *rpc_proxy;
|
char *rpc_proxy;
|
||||||
|
|
||||||
algorithm_t algorithm;
|
algorithm_t algorithm;
|
||||||
|
const char *intensity;
|
||||||
|
const char *xintensity;
|
||||||
|
const char *rawintensity;
|
||||||
|
|
||||||
pthread_mutex_t pool_lock;
|
pthread_mutex_t pool_lock;
|
||||||
cglock_t data_lock;
|
cglock_t data_lock;
|
||||||
|
38
sgminer.c
38
sgminer.c
@ -788,6 +788,27 @@ static char *set_pool_algorithm(const char *arg)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *set_pool_intensity(const char *arg)
|
||||||
|
{
|
||||||
|
struct pool *pool = get_current_pool();
|
||||||
|
pool->intensity = arg;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *set_pool_xintensity(const char *arg)
|
||||||
|
{
|
||||||
|
struct pool *pool = get_current_pool();
|
||||||
|
pool->xintensity = arg;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *set_pool_rawintensity(const char *arg)
|
||||||
|
{
|
||||||
|
struct pool *pool = get_current_pool();
|
||||||
|
pool->rawintensity = arg;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static char *set_pool_nfactor(const char *arg)
|
static char *set_pool_nfactor(const char *arg)
|
||||||
{
|
{
|
||||||
struct pool *pool = get_current_pool();
|
struct pool *pool = get_current_pool();
|
||||||
@ -1284,6 +1305,15 @@ static struct opt_table opt_config_table[] = {
|
|||||||
set_rawintensity, NULL, NULL,
|
set_rawintensity, NULL, NULL,
|
||||||
"Raw intensity of GPU scanning (" MIN_RAWINTENSITY_STR " to "
|
"Raw intensity of GPU scanning (" MIN_RAWINTENSITY_STR " to "
|
||||||
MAX_RAWINTENSITY_STR "), overrides --intensity|-I and --xintensity|-X."),
|
MAX_RAWINTENSITY_STR "), overrides --intensity|-I and --xintensity|-X."),
|
||||||
|
OPT_WITH_ARG("--pool-intensity",
|
||||||
|
set_pool_intensity, NULL, NULL,
|
||||||
|
"Intensity of GPU scanning (pool-specific)"),
|
||||||
|
OPT_WITH_ARG("--pool-xintensity",
|
||||||
|
set_pool_xintensity, NULL, NULL,
|
||||||
|
"Shader based intensity of GPU scanning (pool-specific)"),
|
||||||
|
OPT_WITH_ARG("--pool-rawintensity",
|
||||||
|
set_pool_rawintensity, NULL, NULL,
|
||||||
|
"Raw intensity of GPU scanning (pool-specific)"),
|
||||||
OPT_WITH_ARG("--kernel-path|-K",
|
OPT_WITH_ARG("--kernel-path|-K",
|
||||||
opt_set_charp, opt_show_charp, &opt_kernel_path,
|
opt_set_charp, opt_show_charp, &opt_kernel_path,
|
||||||
"Specify a path to where kernel files are"),
|
"Specify a path to where kernel files are"),
|
||||||
@ -6096,6 +6126,14 @@ static void get_work_prepare_thread(struct thr_info *mythr, struct work *work)
|
|||||||
thr->cgpu->drv->thread_prepare(thr);
|
thr->cgpu->drv->thread_prepare(thr);
|
||||||
}
|
}
|
||||||
rd_unlock(&mining_thr_lock);
|
rd_unlock(&mining_thr_lock);
|
||||||
|
// Apply other pool-specific settings
|
||||||
|
if (work->pool->intensity)
|
||||||
|
set_intensity(work->pool->intensity);
|
||||||
|
if (work->pool->xintensity)
|
||||||
|
set_xintensity(work->pool->xintensity);
|
||||||
|
if (work->pool->rawintensity)
|
||||||
|
set_rawintensity(work->pool->rawintensity);
|
||||||
|
// Finish switching pools
|
||||||
algo_switch_n = 0;
|
algo_switch_n = 0;
|
||||||
mutex_unlock(&algo_switch_lock);
|
mutex_unlock(&algo_switch_lock);
|
||||||
// Signal other threads to start working now
|
// Signal other threads to start working now
|
||||||
|
Loading…
x
Reference in New Issue
Block a user