|
|
@@ -676,8 +676,6 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
|
|
|
|
|
|
#ifdef USE_SCRYPT
|
|
|
if (opt_scrypt) {
|
|
|
- cl_ulong ma = cgpu->max_alloc, mt;
|
|
|
-
|
|
|
if (!cgpu->opt_lg) {
|
|
|
applog(LOG_DEBUG, "GPU %d: selecting lookup gap of 2", gpu);
|
|
|
cgpu->lookup_gap = 2;
|
|
|
@@ -685,29 +683,15 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
|
|
|
cgpu->lookup_gap = cgpu->opt_lg;
|
|
|
|
|
|
if (!cgpu->opt_tc) {
|
|
|
- cgpu->thread_concurrency = ma / 32768 / cgpu->lookup_gap;
|
|
|
+ cgpu->thread_concurrency = cgpu->max_alloc / 32768 / cgpu->lookup_gap;
|
|
|
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;
|
|
|
}
|
|
|
-
|
|
|
applog(LOG_DEBUG, "GPU %u: selecting thread concurrency of %lu", gpu, (unsigned long)cgpu->thread_concurrency);
|
|
|
} else
|
|
|
cgpu->thread_concurrency = cgpu->opt_tc;
|
|
|
-
|
|
|
- /* If we have memory to spare, try to find a power of 2 value
|
|
|
- * >= required amount to map nicely to an intensity */
|
|
|
- mt = cgpu->thread_concurrency * 32768 * cgpu->lookup_gap;
|
|
|
- if (ma > mt) {
|
|
|
- ma = 1;
|
|
|
- while (ma < mt)
|
|
|
- ma <<= 1;
|
|
|
- if (ma < cgpu->max_alloc) {
|
|
|
- cgpu->max_alloc = ma;
|
|
|
- applog(LOG_DEBUG, "Max alloc decreased to %lu", (unsigned long)cgpu->max_alloc);
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
#endif
|
|
|
|