|
@@ -77,7 +77,6 @@
|
|
|
#include "adl.h"
|
|
#include "adl.h"
|
|
|
#include "driver-cpu.h"
|
|
#include "driver-cpu.h"
|
|
|
#include "driver-opencl.h"
|
|
#include "driver-opencl.h"
|
|
|
-#include "bench_block.h"
|
|
|
|
|
#include "scrypt.h"
|
|
#include "scrypt.h"
|
|
|
|
|
|
|
|
#ifdef USE_AVALON
|
|
#ifdef USE_AVALON
|
|
@@ -4604,18 +4603,21 @@ static void calc_diff(struct work *work, int known)
|
|
|
|
|
|
|
|
static void get_benchmark_work(struct work *work)
|
|
static void get_benchmark_work(struct work *work)
|
|
|
{
|
|
{
|
|
|
- // Use a random work block pulled from a pool
|
|
|
|
|
- static uint8_t bench_block[] = { CGMINER_BENCHMARK_BLOCK };
|
|
|
|
|
-
|
|
|
|
|
- size_t bench_size = sizeof(*work);
|
|
|
|
|
- size_t work_size = sizeof(bench_block);
|
|
|
|
|
- size_t min_size = (work_size < bench_size ? work_size : bench_size);
|
|
|
|
|
- memset(work, 0, sizeof(*work));
|
|
|
|
|
- memcpy(work, &bench_block, min_size);
|
|
|
|
|
|
|
+ static uint32_t blkhdr[20];
|
|
|
|
|
+ for (int i = 19; i >= 0; --i)
|
|
|
|
|
+ if (++blkhdr[i])
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ memcpy(&work->data[ 0], blkhdr, 80);
|
|
|
|
|
+ memcpy(&work->data[80], workpadding_bin, 48);
|
|
|
|
|
+ calc_midstate(work);
|
|
|
|
|
+ set_target(work->target, 1.0);
|
|
|
|
|
+
|
|
|
work->mandatory = true;
|
|
work->mandatory = true;
|
|
|
work->pool = pools[0];
|
|
work->pool = pools[0];
|
|
|
cgtime(&work->tv_getwork);
|
|
cgtime(&work->tv_getwork);
|
|
|
copy_time(&work->tv_getwork_reply, &work->tv_getwork);
|
|
copy_time(&work->tv_getwork_reply, &work->tv_getwork);
|
|
|
|
|
+ copy_time(&work->tv_staged, &work->tv_getwork);
|
|
|
work->getwork_mode = GETWORK_MODE_BENCHMARK;
|
|
work->getwork_mode = GETWORK_MODE_BENCHMARK;
|
|
|
calc_diff(work, 0);
|
|
calc_diff(work, 0);
|
|
|
}
|
|
}
|
|
@@ -8861,6 +8863,12 @@ static
|
|
|
void _submit_work_async(struct work *work)
|
|
void _submit_work_async(struct work *work)
|
|
|
{
|
|
{
|
|
|
applog(LOG_DEBUG, "Pushing submit work to work thread");
|
|
applog(LOG_DEBUG, "Pushing submit work to work thread");
|
|
|
|
|
+
|
|
|
|
|
+ if (opt_benchmark)
|
|
|
|
|
+ {
|
|
|
|
|
+ free_work(work);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
mutex_lock(&submitting_lock);
|
|
mutex_lock(&submitting_lock);
|
|
|
++total_submitting;
|
|
++total_submitting;
|
|
@@ -11422,8 +11430,6 @@ int main(int argc, char *argv[])
|
|
|
if (opt_benchmark) {
|
|
if (opt_benchmark) {
|
|
|
struct pool *pool;
|
|
struct pool *pool;
|
|
|
|
|
|
|
|
- if (opt_scrypt)
|
|
|
|
|
- quit(1, "Cannot use benchmark mode with scrypt");
|
|
|
|
|
want_longpoll = false;
|
|
want_longpoll = false;
|
|
|
pool = add_pool();
|
|
pool = add_pool();
|
|
|
pool->rpc_url = malloc(255);
|
|
pool->rpc_url = malloc(255);
|
|
@@ -11767,6 +11773,7 @@ begin_bench:
|
|
|
cgtime(&total_tv_start);
|
|
cgtime(&total_tv_start);
|
|
|
cgtime(&total_tv_end);
|
|
cgtime(&total_tv_end);
|
|
|
|
|
|
|
|
|
|
+ if (!opt_benchmark)
|
|
|
{
|
|
{
|
|
|
pthread_t submit_thread;
|
|
pthread_t submit_thread;
|
|
|
if (unlikely(pthread_create(&submit_thread, NULL, submit_work_thread, NULL)))
|
|
if (unlikely(pthread_create(&submit_thread, NULL, submit_work_thread, NULL)))
|