Browse Source

TC adjustments for nscrypt.

nfactor-troky^2
unknown 11 years ago
parent
commit
a7e46721f6
  1. 20
      ocl.c

20
ocl.c

@ -484,20 +484,28 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) @@ -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…
Cancel
Save