mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 06:48:05 +00:00
Removed --nscrypt option and introduced use_nscrypt flag that is kernel dependant.
This commit is contained in:
parent
854e1089d7
commit
f8579404bc
@ -1024,7 +1024,7 @@ static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, __maybe_u
|
||||
uint32_t timestamp;
|
||||
cl_uint nfactor = 10; // scrypt default
|
||||
|
||||
if (opt_nscrypt) {
|
||||
if (use_nscrypt) {
|
||||
timestamp = bswap_32(*((uint32_t *)(blk->work->data + 17*4)));
|
||||
nfactor = vert_GetNfactor(timestamp) + 1;
|
||||
}
|
||||
@ -1039,7 +1039,7 @@ static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, __maybe_u
|
||||
CL_SET_VARG(4, &midstate[0]);
|
||||
CL_SET_VARG(4, &midstate[16]);
|
||||
CL_SET_ARG(le_target);
|
||||
if (opt_nscrypt) {
|
||||
if (use_nscrypt) {
|
||||
CL_SET_ARG(nfactor);
|
||||
}
|
||||
|
||||
@ -1050,7 +1050,7 @@ static void set_threads_hashes(unsigned int vectors, unsigned int compute_shader
|
||||
unsigned int minthreads, __maybe_unused int *intensity, __maybe_unused int *xintensity, __maybe_unused int *rawintensity)
|
||||
{
|
||||
unsigned int threads = 0;
|
||||
if (opt_nscrypt) {
|
||||
if (use_nscrypt) {
|
||||
// new intensity calculation based on shader count
|
||||
threads = (compute_shaders * minthreads << (MAX_INTENSITY-19)) >> (MAX_INTENSITY - *intensity);
|
||||
|
||||
|
2
miner.h
2
miner.h
@ -981,7 +981,7 @@ extern bool opt_restart;
|
||||
extern bool opt_worktime;
|
||||
extern int swork_id;
|
||||
extern int opt_tcp_keepalive;
|
||||
extern bool opt_nscrypt;
|
||||
extern bool use_nscrypt;
|
||||
|
||||
#if LOCK_TRACKING
|
||||
extern pthread_mutex_t lockstat_lock;
|
||||
|
3
ocl.c
3
ocl.c
@ -458,6 +458,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
|
||||
applog(LOG_WARNING, "Kernel nscrypt is experimental.");
|
||||
strcpy(filename, NSCRYPT_KERNNAME".cl");
|
||||
strcpy(binaryfilename, NSCRYPT_KERNNAME);
|
||||
use_nscrypt = true;
|
||||
break;
|
||||
case KL_NONE: /* Shouldn't happen */
|
||||
break;
|
||||
@ -782,7 +783,7 @@ built:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cl_uint bsize = opt_nscrypt ? 2048 : 1024;
|
||||
cl_uint bsize = use_nscrypt ? 2048 : 1024;
|
||||
|
||||
size_t ipt = (bsize / cgpu->lookup_gap + (bsize % cgpu->lookup_gap > 0));
|
||||
size_t bufsize = 128 * ipt * cgpu->thread_concurrency;
|
||||
|
4
scrypt.c
4
scrypt.c
@ -414,7 +414,7 @@ void scrypt_regenhash(struct work *work)
|
||||
uint32_t *nonce = (uint32_t *)(work->data + 76);
|
||||
uint32_t *ohash = (uint32_t *)(work->hash);
|
||||
|
||||
if (opt_nscrypt) {
|
||||
if (use_nscrypt) {
|
||||
timestamp = bswap_32(*((uint32_t *)(work->data + 17*4)));
|
||||
nfactor = vert_GetNfactor(timestamp) + 1;
|
||||
}
|
||||
@ -422,7 +422,7 @@ void scrypt_regenhash(struct work *work)
|
||||
be32enc_vect(data, (const uint32_t *)work->data, 19);
|
||||
data[19] = htobe32(*nonce);
|
||||
|
||||
if (opt_nscrypt) {
|
||||
if (use_nscrypt) {
|
||||
scratchbuf = (char *)alloca((1 << nfactor) * 128 + 512);
|
||||
scrypt_1024_1_1_256_sp(data, scratchbuf, ohash, (1 << nfactor));
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ int opt_dynamic_interval = 7;
|
||||
int opt_g_threads = -1;
|
||||
int gpu_threads;
|
||||
bool opt_restart = true;
|
||||
bool opt_nscrypt = false;
|
||||
bool use_nscrypt = false;
|
||||
|
||||
struct list_head scan_devices;
|
||||
static bool devices_enabled[MAX_DEVICES];
|
||||
@ -1270,9 +1270,6 @@ static struct opt_table opt_config_table[] = {
|
||||
OPT_WITH_ARG("--sched-stop",
|
||||
set_schedtime, NULL, &schedstop,
|
||||
"Set a time of day in HH:MM to stop mining (will quit without a start time)"),
|
||||
OPT_WITHOUT_ARG("--nscrypt",
|
||||
opt_set_bool, &opt_nscrypt,
|
||||
"Use the scrypt-vert algorithm for mining (NO scyrpt!)"),
|
||||
OPT_WITH_ARG("--shaders",
|
||||
set_shaders, NULL, NULL,
|
||||
"GPU shaders per card for tuning scrypt, comma separated"),
|
||||
|
Loading…
Reference in New Issue
Block a user