Browse Source

extra_work_queue so devices can influence their effect on the central work queue somewhat (titan needs less than 1-per-proc)

Luke Dashjr 11 years ago
parent
commit
4d6024c868
3 changed files with 9 additions and 2 deletions
  1. 3 0
      driver-titan.c
  2. 5 2
      miner.c
  3. 1 0
      miner.h

+ 3 - 0
driver-titan.c

@@ -161,9 +161,12 @@ static bool knc_titan_detect_one(const char *devpath)
 		.deven = DEV_ENABLED,
 		.deven = DEV_ENABLED,
 		.procs = cores,
 		.procs = cores,
 		.threads = prev_cgpu ? 0 : 1,
 		.threads = prev_cgpu ? 0 : 1,
+		.extra_work_queue = -1,
 		.device_data = knc,
 		.device_data = knc,
 	};
 	};
 	const bool rv = add_cgpu_slave(cgpu, prev_cgpu);
 	const bool rv = add_cgpu_slave(cgpu, prev_cgpu);
+	if (!prev_cgpu)
+		cgpu->extra_work_queue += WORK_QUEUE_PREFILL;
 	prev_cgpu = cgpu;
 	prev_cgpu = cgpu;
 	return rv;
 	return rv;
 }
 }

+ 5 - 2
miner.c

@@ -212,6 +212,7 @@ struct cgpu_info **devices_new;
 bool have_opencl;
 bool have_opencl;
 int opt_n_threads = -1;
 int opt_n_threads = -1;
 int mining_threads;
 int mining_threads;
+int base_queue;
 int num_processors;
 int num_processors;
 #ifdef HAVE_CURSES
 #ifdef HAVE_CURSES
 bool use_curses = true;
 bool use_curses = true;
@@ -11255,7 +11256,9 @@ void register_device(struct cgpu_info *cgpu)
 
 
 	if (!cgpu->proc_id)
 	if (!cgpu->proc_id)
 		cgpu->device_line_id = device_line_id_count++;
 		cgpu->device_line_id = device_line_id_count++;
-	mining_threads += cgpu->threads ?: 1;
+	int thr_objs = cgpu->threads ?: 1;
+	mining_threads += thr_objs;
+	base_queue += thr_objs + cgpu->extra_work_queue;
 #ifdef HAVE_CURSES
 #ifdef HAVE_CURSES
 	adj_width(mining_threads, &dev_width);
 	adj_width(mining_threads, &dev_width);
 #endif
 #endif
@@ -12707,7 +12710,7 @@ begin_bench:
 		cp = current_pool();
 		cp = current_pool();
 
 
 		// Generally, each processor needs a new work, and all at once during work restarts
 		// Generally, each processor needs a new work, and all at once during work restarts
-		max_staged += mining_threads;
+		max_staged += base_queue;
 
 
 		mutex_lock(stgd_lock);
 		mutex_lock(stgd_lock);
 		ts = __total_staged();
 		ts = __total_staged();

+ 1 - 0
miner.h

@@ -471,6 +471,7 @@ struct cgpu_info {
 	char proc_repr_ns[9];
 	char proc_repr_ns[9];
 	struct cgpu_info *device;
 	struct cgpu_info *device;
 	struct cgpu_info *next_proc;
 	struct cgpu_info *next_proc;
+	int extra_work_queue;
 	
 	
 	const char *device_path;
 	const char *device_path;
 	void *device_data;
 	void *device_data;