mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-25 05:54:19 +00:00
TC adjustments for nscrypt.
This commit is contained in:
parent
850f5149dd
commit
a7e46721f6
20
ocl.c
20
ocl.c
@ -484,20 +484,28 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
|
||||
} else
|
||||
cgpu->lookup_gap = cgpu->opt_lg;
|
||||
|
||||
// TODO: check if this params can be the same for both scrypt and nscrypt
|
||||
unsigned int sixtyfours = use_nscrypt ? ((cgpu->max_alloc*cgpu->lookup_gap) / (2048*128) / 64 - 1) : (cgpu->max_alloc / 131072 / 64 - 1);
|
||||
if (!cgpu->opt_tc) {
|
||||
unsigned int sixtyfours;
|
||||
|
||||
sixtyfours = cgpu->max_alloc / 131072 / 64 - 1;
|
||||
cgpu->thread_concurrency = sixtyfours * 64;
|
||||
if (cgpu->shaders && cgpu->thread_concurrency > cgpu->shaders) {
|
||||
cgpu->thread_concurrency -= cgpu->thread_concurrency % cgpu->shaders;
|
||||
if (cgpu->thread_concurrency > cgpu->shaders * 5)
|
||||
cgpu->thread_concurrency = cgpu->shaders * 5;
|
||||
size_t tc_limit = cgpu->shaders * use_nscrypt ? 11 : 5;
|
||||
if (cgpu->thread_concurrency > tc_limit)
|
||||
cgpu->thread_concurrency = tc_limit;
|
||||
}
|
||||
applog(LOG_DEBUG, "GPU %d: selecting thread concurrency of %d", gpu, (int)(cgpu->thread_concurrency));
|
||||
} else
|
||||
} else {
|
||||
cgpu->thread_concurrency = cgpu->opt_tc;
|
||||
}
|
||||
|
||||
// TODO: check if this works with standard scrypt, too
|
||||
if (use_nscrypt) {
|
||||
if (((cgpu->thread_concurrency * (2048*128)) / cgpu->lookup_gap) > cgpu->max_alloc) {
|
||||
cgpu->thread_concurrency = sixtyfours * 64;
|
||||
applog(LOG_INFO, "GPU %d: thread concurrency too high, set to %d", gpu, (int)(cgpu->thread_concurrency));
|
||||
}
|
||||
}
|
||||
|
||||
FILE *binaryfile;
|
||||
size_t *binary_sizes;
|
||||
|
Loading…
x
Reference in New Issue
Block a user