|
|
@ -476,11 +476,13 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) |
|
|
|
cl_ulong ma = cgpu->max_alloc, mt; |
|
|
|
cl_ulong ma = cgpu->max_alloc, mt; |
|
|
|
int pow2 = 0; |
|
|
|
int pow2 = 0; |
|
|
|
|
|
|
|
|
|
|
|
if (!cgpu->lookup_gap) { |
|
|
|
if (!cgpu->opt_lg) { |
|
|
|
applog(LOG_DEBUG, "GPU %d: selecting lookup gap of 2", gpu); |
|
|
|
applog(LOG_DEBUG, "GPU %d: selecting lookup gap of 2", gpu); |
|
|
|
cgpu->lookup_gap = 2; |
|
|
|
cgpu->lookup_gap = 2; |
|
|
|
} |
|
|
|
} else |
|
|
|
if (!cgpu->thread_concurrency) { |
|
|
|
cgpu->lookup_gap = cgpu->opt_lg; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!cgpu->opt_tc) { |
|
|
|
cgpu->thread_concurrency = ma / 32768 / cgpu->lookup_gap; |
|
|
|
cgpu->thread_concurrency = ma / 32768 / cgpu->lookup_gap; |
|
|
|
if (cgpu->shaders && cgpu->thread_concurrency > cgpu->shaders) { |
|
|
|
if (cgpu->shaders && cgpu->thread_concurrency > cgpu->shaders) { |
|
|
|
cgpu->thread_concurrency -= cgpu->thread_concurrency % cgpu->shaders; |
|
|
|
cgpu->thread_concurrency -= cgpu->thread_concurrency % cgpu->shaders; |
|
|
@ -489,7 +491,8 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
applog(LOG_DEBUG, "GPU %d: selecting thread concurrency of %u",gpu, cgpu->thread_concurrency); |
|
|
|
applog(LOG_DEBUG, "GPU %d: selecting thread concurrency of %u",gpu, cgpu->thread_concurrency); |
|
|
|
} |
|
|
|
} else |
|
|
|
|
|
|
|
cgpu->thread_concurrency = cgpu->opt_tc; |
|
|
|
|
|
|
|
|
|
|
|
/* If we have memory to spare, try to find a power of 2 value
|
|
|
|
/* If we have memory to spare, try to find a power of 2 value
|
|
|
|
* >= required amount to map nicely to an intensity */ |
|
|
|
* >= required amount to map nicely to an intensity */ |
|
|
|