mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-08 22:08:02 +00:00
Provide a helper function for determining dev runtime and use it in the hashmeters used.
This commit is contained in:
parent
3323f9f9bf
commit
a58ef1b8c7
5
api.c
5
api.c
@ -1632,8 +1632,11 @@ static void gpustatus(struct io_data *io_data, int gpu, bool isjson, bool precom
|
||||
|
||||
if (gpu >= 0 && gpu < nDevs) {
|
||||
struct cgpu_info *cgpu = &gpus[gpu];
|
||||
double dev_runtime;
|
||||
|
||||
cgpu->utility = cgpu->accepted / ( total_secs ? total_secs : 1 ) * 60;
|
||||
dev_runtime = cgpu_runtime(cgpu);
|
||||
|
||||
cgpu->utility = cgpu->accepted / dev_runtime * 60;
|
||||
|
||||
#ifdef HAVE_ADL
|
||||
if (!gpu_stats(gpu, >, &gc, &gm, &gv, &ga, &gf, &gp, &pt))
|
||||
|
1
miner.h
1
miner.h
@ -691,6 +691,7 @@ endian_flip128(void __maybe_unused *dest_p, const void __maybe_unused *src_p)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern double cgpu_runtime(struct cgpu_info *cgpu);
|
||||
extern void _quit(int status);
|
||||
|
||||
/*
|
||||
|
16
sgminer.c
16
sgminer.c
@ -2071,12 +2071,10 @@ static void suffix_string(uint64_t val, char *buf, size_t bufsiz, int sigdigits)
|
||||
}
|
||||
}
|
||||
|
||||
static void get_statline(char *buf, size_t bufsiz, struct cgpu_info *cgpu)
|
||||
double cgpu_runtime(struct cgpu_info *cgpu)
|
||||
{
|
||||
char displayed_hashes[16], displayed_rolling[16];
|
||||
uint64_t dh64, dr64;
|
||||
struct timeval now;
|
||||
double dev_runtime, wu;
|
||||
double dev_runtime;
|
||||
|
||||
if (cgpu->dev_start_tv.tv_sec == 0)
|
||||
dev_runtime = total_secs;
|
||||
@ -2087,6 +2085,16 @@ static void get_statline(char *buf, size_t bufsiz, struct cgpu_info *cgpu)
|
||||
|
||||
if (dev_runtime < 1.0)
|
||||
dev_runtime = 1.0;
|
||||
return dev_runtime;
|
||||
}
|
||||
|
||||
static void get_statline(char *buf, size_t bufsiz, struct cgpu_info *cgpu)
|
||||
{
|
||||
char displayed_hashes[16], displayed_rolling[16];
|
||||
double dev_runtime, wu;
|
||||
uint64_t dh64, dr64;
|
||||
|
||||
dev_runtime = cgpu_runtime(cgpu);
|
||||
|
||||
wu = cgpu->diff1 / dev_runtime * 60.0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user