mirror of
https://github.com/GOSTSec/ccminer
synced 2025-02-09 13:24:21 +00:00
cuda: throughput2intensity function to show default
This commit is contained in:
parent
9f2ed5135b
commit
65cd430d76
15
cuda.cpp
15
cuda.cpp
@ -172,6 +172,21 @@ uint32_t cuda_default_throughput(int thr_id, uint32_t defcount)
|
|||||||
return throughput;
|
return throughput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// since 1.8.3
|
||||||
|
double throughput2intensity(uint32_t throughput)
|
||||||
|
{
|
||||||
|
double intensity = 0.;
|
||||||
|
uint32_t ws = throughput;
|
||||||
|
uint8_t i = 0;
|
||||||
|
while (ws > 1 && i++ < 32)
|
||||||
|
ws = ws >> 1;
|
||||||
|
intensity = (double) i;
|
||||||
|
if (i && ((1U << i) < throughput)) {
|
||||||
|
intensity += ((double) (throughput-(1U << i)) / (1U << i));
|
||||||
|
}
|
||||||
|
return intensity;
|
||||||
|
}
|
||||||
|
|
||||||
// if we use 2 threads on the same gpu, we need to reinit the threads
|
// if we use 2 threads on the same gpu, we need to reinit the threads
|
||||||
void cuda_reset_device(int thr_id, bool *init)
|
void cuda_reset_device(int thr_id, bool *init)
|
||||||
{
|
{
|
||||||
|
@ -116,6 +116,7 @@ extern "C" int scanhash_lbry(int thr_id, struct work *work, uint32_t max_nonce,
|
|||||||
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
|
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
|
||||||
CUDA_LOG_ERROR();
|
CUDA_LOG_ERROR();
|
||||||
}
|
}
|
||||||
|
gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput);
|
||||||
|
|
||||||
if(device_sm[dev_id] <= 500)
|
if(device_sm[dev_id] <= 500)
|
||||||
CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 8 * sizeof(uint64_t) * throughput));
|
CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 8 * sizeof(uint64_t) * throughput));
|
||||||
|
1
miner.h
1
miner.h
@ -513,6 +513,7 @@ int cuda_available_memory(int thr_id);
|
|||||||
|
|
||||||
uint32_t cuda_default_throughput(int thr_id, uint32_t defcount);
|
uint32_t cuda_default_throughput(int thr_id, uint32_t defcount);
|
||||||
#define device_intensity(t,f,d) cuda_default_throughput(t,d)
|
#define device_intensity(t,f,d) cuda_default_throughput(t,d)
|
||||||
|
double throughput2intensity(uint32_t throughput);
|
||||||
|
|
||||||
void cuda_log_lasterror(int thr_id, const char* func, int line);
|
void cuda_log_lasterror(int thr_id, const char* func, int line);
|
||||||
void cuda_clear_lasterror();
|
void cuda_clear_lasterror();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user