mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 06:48:05 +00:00
Use shaders param if provided.
This commit is contained in:
parent
614d7402e5
commit
8c1f7e272b
@ -1046,13 +1046,13 @@ static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, __maybe_u
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_threads_hashes(unsigned int vectors, unsigned int compute_shaders, int64_t *hashes, size_t *globalThreads,
|
static void set_threads_hashes(unsigned int vectors, size_t shaders, int64_t *hashes, size_t *globalThreads,
|
||||||
unsigned int minthreads, __maybe_unused int *intensity, __maybe_unused int *xintensity, __maybe_unused int *rawintensity)
|
unsigned int minthreads, __maybe_unused int *intensity, __maybe_unused int *xintensity, __maybe_unused int *rawintensity)
|
||||||
{
|
{
|
||||||
unsigned int threads = 0;
|
unsigned int threads = 0;
|
||||||
if (use_nscrypt) {
|
if (use_nscrypt && shaders) {
|
||||||
// new intensity calculation based on shader count
|
// new intensity calculation based on shader count
|
||||||
threads = (compute_shaders * minthreads << (MAX_INTENSITY-19)) >> (MAX_INTENSITY - *intensity);
|
threads = (shaders * minthreads << (MAX_INTENSITY-19)) >> (MAX_INTENSITY - *intensity);
|
||||||
|
|
||||||
if (threads < minthreads)
|
if (threads < minthreads)
|
||||||
threads = minthreads;
|
threads = minthreads;
|
||||||
@ -1064,7 +1064,7 @@ static void set_threads_hashes(unsigned int vectors, unsigned int compute_shader
|
|||||||
if (*rawintensity > 0) {
|
if (*rawintensity > 0) {
|
||||||
threads = *rawintensity;
|
threads = *rawintensity;
|
||||||
} else if (*xintensity > 0) {
|
} else if (*xintensity > 0) {
|
||||||
threads = compute_shaders * *xintensity;
|
threads = shaders * *xintensity;
|
||||||
} else {
|
} else {
|
||||||
threads = 1 << *intensity;
|
threads = 1 << *intensity;
|
||||||
}
|
}
|
||||||
@ -1455,7 +1455,7 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
|
|||||||
gpu->intervals = 0;
|
gpu->intervals = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_threads_hashes(clState->vwidth, clState->compute_shaders, &hashes, globalThreads, localThreads[0],
|
set_threads_hashes(clState->vwidth, gpu->shaders ? gpu->shaders : clState->compute_shaders, &hashes, globalThreads, localThreads[0],
|
||||||
&gpu->intensity, &gpu->xintensity, &gpu->rawintensity);
|
&gpu->intensity, &gpu->xintensity, &gpu->rawintensity);
|
||||||
if (hashes > gpu->max_hashes)
|
if (hashes > gpu->max_hashes)
|
||||||
gpu->max_hashes = hashes;
|
gpu->max_hashes = hashes;
|
||||||
|
5
ocl.c
5
ocl.c
@ -384,10 +384,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cgpu->shaders) {
|
if (!cgpu->shaders) {
|
||||||
clState->compute_shaders = cgpu->shaders;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// AMD architechture got 64 compute shaders per compute unit.
|
// AMD architechture got 64 compute shaders per compute unit.
|
||||||
// Source: http://www.amd.com/us/Documents/GCN_Architecture_whitepaper.pdf
|
// Source: http://www.amd.com/us/Documents/GCN_Architecture_whitepaper.pdf
|
||||||
clState->compute_shaders = compute_units * 64;
|
clState->compute_shaders = compute_units * 64;
|
||||||
|
Loading…
Reference in New Issue
Block a user